SMTP
Send emails via PostaSend's SMTP using any language or library that supports SMTP. No SDK required.
SMTP Credentials
PostaSend exposes a standard SMTP endpoint you can use with any mailer that supports SMTP authentication. Your SMTP username is your PostaSend API key (ps_live_... or ms_test_...). The password field is ignored. Pass any non-empty string. Use port 587 with STARTTLS, or port 465 with TLS.
Host: smtp.postasend.com
Port: 587
Username: ps_live_your_api_key_here
Password: ps_live_your_api_key_hereNodemailer (Node.js)
Configure Nodemailer to use PostaSend's SMTP by passing the host, port, and your API key as the user. The from address must belong to a verified domain in your account.
import nodemailer from 'nodemailer';
const transporter = nodemailer.createTransport({
host: 'smtp.postasend.com',
port: 587,
auth: {
user: process.env.POSTASEND_API_KEY,
pass: process.env.POSTASEND_API_KEY,
},
});
await transporter.sendMail({
from: 'hello@yourdomain.com',
to: 'user@example.com',
subject: 'Hello via SMTP',
text: 'Sent through PostaSend SMTP relay.',
html: '<p>Sent through PostaSend SMTP relay.</p>',
});Python (smtplib)
Use Python's built-in smtplib to send mail through the PostaSend.
import smtplib
from email.mime.text import MIMEText
msg = MIMEText("Sent through PostaSend SMTP.")
msg["Subject"] = "Hello via SMTP"
msg["From"] = "hello@yourdomain.com"
msg["To"] = "user@example.com"
with smtplib.SMTP("smtp.postasend.com", 587) as server:
server.ehlo()
server.login("ps_live_your_api_key_here", "postasend")
server.sendmail(msg["From"], [msg["To"]], msg.as_string())PHP (PHPMailer)
PHPMailer works out of the box with the PostaSend SMTP. Set SMTPAuth to true and pass your API key as the Username and Password.
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'smtp.postasend.com';
$mail->SMTPAuth = true;
$mail->Username = 'ps_live_your_api_key_here';
$mail->Password = 'ps_live_your_api_key_here';
$mail->Port = 587;
$mail->setFrom('hello@yourdomain.com', 'Your App');
$mail->addAddress('user@example.com');
$mail->Subject = 'Hello via SMTP';
$mail->Body = '<p>Sent through PostaSend SMTP relay.</p>';
$mail->isHTML(true);
$mail->send();Rate Limits and Quotas
SMTP sends count against the same monthly quota as API sends. Concurrent SMTP connections are limited to 10 per account. Each message may have up to 50 recipients across to, cc, and bcc combined. Attachments must not exceed 25 MB total per message. If you exceed your plan's quota, the SMTP server returns a 452 error and the message is rejected.
Troubleshooting
Common SMTP errors and how to resolve them: 535 Authentication failed — double-check that your Username and Password are your full API key (ms_live_...). 550 Sender domain not verified — the from address domain must be verified in your PostaSend account. 452 Quota exceeded — you have reached your monthly send limit; upgrade your plan or wait until the next billing cycle. If your mailer reports a TLS handshake failure, ensure it supports TLS 1.2 or higher.