Send email with PHPMailer over SMTP
Use PHPMailer's SMTP mode to deliver through Unitpost from plain PHP. Port 587 with STARTTLS; don't use port 25.
Install PHPMailer
Add it via Composer.
Shellcomposer require phpmailer/phpmailerConfigure and send
Set PHPMailer to SMTP mode with your Unitpost credentials.
PHP<?php use PHPMailer\PHPMailer\PHPMailer; $mail = new PHPMailer(true); $mail->isSMTP(); $mail->Host = "smtp.unitpost.com"; $mail->SMTPAuth = true; $mail->Username = "unitpost"; $mail->Password = getenv("UNITPOST_API_KEY"); $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = 587; $mail->setFrom("you@yourdomain.com", "Your App"); $mail->addAddress("customer@example.com"); $mail->isHTML(true); $mail->Subject = "Hello from Unitpost"; $mail->Body = "<h1>Welcome!</h1><p>Sent via SMTP.</p>"; $mail->send();Verify delivery
The message appears in your Unitpost Activity view with full tracking.