SMTP Integration
Emitlo supports SMTP relay on port 587 with STARTTLS. Use this if your application or framework already has SMTP support and you don’t want to integrate the REST API.
SMTP settings
| Setting | Value |
|---|---|
| Host | api.emitlo.com |
| Port | 587 |
| Security | STARTTLS |
| Authentication | AUTH PLAIN |
| Username | Your credential username |
| Password | Your credential secret key |
Configuration examples
import nodemailer from 'nodemailer';
const transporter = nodemailer.createTransport({ host: 'api.emitlo.com', port: 587, secure: false, // STARTTLS auth: { user: 'YOUR_CREDENTIAL_USERNAME', pass: 'YOUR_SECRET_KEY', },});
await transporter.sendMail({ from: '"Your App" <hello@yourdomain.com>', to: 'user@example.com', subject: 'Hello from Emitlo SMTP', html: '<p>This email was sent via SMTP.</p>',});<?phpuse PHPMailer\PHPMailer\PHPMailer;use PHPMailer\PHPMailer\SMTP;
$mail = new PHPMailer(true);$mail->isSMTP();$mail->Host = 'api.emitlo.com';$mail->SMTPAuth = true;$mail->Username = 'YOUR_CREDENTIAL_USERNAME';$mail->Password = 'YOUR_SECRET_KEY';$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;$mail->Port = 587;
$mail->setFrom('hello@yourdomain.com', 'Your App');$mail->addAddress('user@example.com', 'John Doe');$mail->Subject = 'Hello from Emitlo SMTP';$mail->isHTML(true);$mail->Body = '<p>This email was sent via SMTP.</p>';
$mail->send();import smtplibfrom email.mime.multipart import MIMEMultipartfrom email.mime.text import MIMEText
msg = MIMEMultipart('alternative')msg['Subject'] = 'Hello from Emitlo SMTP'msg['From'] = 'hello@yourdomain.com'msg['To'] = 'user@example.com'msg.attach(MIMEText('<p>This email was sent via SMTP.</p>', 'html'))
with smtplib.SMTP('api.emitlo.com', 587) as server: server.ehlo() server.starttls() server.login('YOUR_CREDENTIAL_USERNAME', 'YOUR_SECRET_KEY') server.sendmail('hello@yourdomain.com', 'user@example.com', msg.as_string())MAIL_MAILER=smtpMAIL_HOST=api.emitlo.comMAIL_PORT=587MAIL_USERNAME=YOUR_CREDENTIAL_USERNAMEMAIL_PASSWORD=YOUR_SECRET_KEYMAIL_ENCRYPTION=tlsMAIL_FROM_ADDRESS=hello@yourdomain.comMAIL_FROM_NAME="Your App"EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'EMAIL_HOST = 'api.emitlo.com'EMAIL_PORT = 587EMAIL_USE_TLS = TrueEMAIL_HOST_USER = 'YOUR_CREDENTIAL_USERNAME'EMAIL_HOST_PASSWORD = 'YOUR_SECRET_KEY'DEFAULT_FROM_EMAIL = 'hello@yourdomain.com'SMTP vs REST API
| SMTP | REST API | |
|---|---|---|
| Setup | Drop-in for existing SMTP config | Requires API integration |
| Batch sending | One message at a time | Up to 500 per request |
| Attachments | Native MIME support | Base64-encoded |
| Tracking | Same delivery tracking | Same delivery tracking |
| Rate limits | Shared with API | Shared with SMTP |
Use SMTP when you already have SMTP configured and want a quick switch. Use the REST API for new integrations, batch sending, or when you need more control.
Troubleshooting
Authentication failed (535)
- Double-check your username and password
- Ensure the credential has
sendpermission - Verify the credential is not suspended or revoked
Sender domain rejected
- The
From:address domain must match the credential’s sending domain - Ensure the domain is verified
Connection refused
- Confirm you’re connecting to port
587with STARTTLS (not port 465 with SSL)