PHP (PHPMailer) SMTP
Send email from plain PHP through eusend using PHPMailer over SMTP — implicit TLS on port 465, DKIM-signed and tracked.
For a PHP app without a framework, PHPMailer is the standard SMTP client. Point it at eusend and your mail is DKIM-signed, tracked, and subject to the same limits as the HTTP API.
Install
composer require phpmailer/phpmailerSend an email
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php';
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'smtp.eusend.dev';
$mail->SMTPAuth = true;
$mail->Username = 'eusend'; // the literal string "eusend"
$mail->Password = getenv('EUSEND_API_KEY'); // eu_live_…
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; // implicit TLS
$mail->Port = 465;
// From must be on a domain verified in eusend
$mail->setFrom('no-reply@yourdomain.com', 'Acme');
$mail->addAddress('alice@example.com');
$mail->isHTML(true);
$mail->Subject = 'Your order has shipped';
$mail->Body = '<p>Order #1234 is on its way.</p>';
$mail->AltBody = 'Order #1234 is on its way.';
$mail->send();
} catch (Exception $e) {
echo "Send failed: {$mail->ErrorInfo}";
}Use ENCRYPTION_SMTPS with port 465 (implicit TLS), not ENCRYPTION_STARTTLS. STARTTLS on
587 is not supported.
Connection reference
| Property | Value |
|---|---|
Host | smtp.eusend.dev |
Port | 465 |
SMTPSecure | PHPMailer::ENCRYPTION_SMTPS |
Username | eusend |
Password | your eusend API key (eu_live_…) |
setFrom() | an address on a verified domain |
Use an eu_test_ key while developing — sends are tracked but not delivered. See
the SMTP overview for limits and status codes.
Ghost SMTP
Configure your Ghost blog to send transactional email — member sign-in links, password resets, staff invites — through eusend over SMTP.
Payload CMS
Send Payload's verification, password-reset and application email through eusend with the official email adapter — a REST adapter that works on serverless, unlike SMTP.