Guides › Developers
How to set up an SMTP relay
An SMTP relay is a mail server that sends email for you. Almost every piece of software with an "email settings" page can use one: WordPress, online shops, CRMs, helpdesks, printers. Pointing them at a proper relay, from your own verified domain, stops their email landing in spam.
6 min read · updated November 8, 2026
The settings you need
| Setting | Sendflume value | Notes |
|---|---|---|
| Host (server) | smtp.sendflume.com | Your provider's relay address |
| Port | 587 | Use 2525 if 587 is blocked by your host |
| Encryption | STARTTLS (sometimes called TLS) | Starts plain and upgrades to encrypted |
| Username | Anything, for example "api" | Some providers need a specific username |
| Password | Your API key | Create a key with permission to send |
| From address | An address on your verified domain | Mail from unverified domains is refused |
Which port?
| Port | Use it? | Why |
|---|---|---|
| 587 | Yes | The standard port for sending with a login, using STARTTLS |
| 2525 | Yes, as a fallback | Not official, but widely offered for hosts that block 587 |
| 465 | Only if your provider supports it | Encrypted from the first byte (implicit TLS) |
| 25 | No | For server-to-server delivery; most hosts and home connections block it |
WordPress
WordPress sends through the web server by default, which often lands in spam. Install a free SMTP plugin (for example WP Mail SMTP or FluentSMTP), choose "Other SMTP", and enter the settings above. Send the plugin's test email, then check it arrived with SPF, DKIM and DMARC passing.
Python
import os
import smtplib
from email.message import EmailMessage
msg = EmailMessage()
msg["From"] = "Your Shop <[email protected]>"
msg["To"] = "[email protected]"
msg["Subject"] = "Order A-1044 confirmed"
msg.set_content("Thanks Rae, your order is on its way.")
msg.add_alternative("<p>Thanks Rae, your order is on its way.</p>", subtype="html")
with smtplib.SMTP("smtp.sendflume.com", 587, timeout=15) as s:
s.starttls()
s.login("api", os.environ["SENDFLUME_API_KEY"])
s.send_message(msg)Node.js (Nodemailer)
import nodemailer from 'nodemailer';
const transport = nodemailer.createTransport({
host: 'smtp.sendflume.com',
port: 587,
secure: false, // STARTTLS on 587
auth: { user: 'api', pass: process.env.SENDFLUME_API_KEY },
});
await transport.sendMail({
from: 'Your Shop <[email protected]>',
to: '[email protected]',
subject: 'Order A-1044 confirmed',
text: 'Thanks Rae, your order is on its way.',
html: '<p>Thanks Rae, your order is on its way.</p>',
});Fixing common errors
| Error | Likely cause | Fix |
|---|---|---|
| Connection timed out | Your host blocks the port | Try 2525, or ask your host to open 587 |
| 535 Authentication failed | Wrong or revoked key | Create a new key and paste it again, with no spaces |
| 550, sender or domain refused | The From domain is not verified | Verify the domain, or send from one that is |
| TLS or certificate errors | Wrong encryption setting | Use STARTTLS on 587, not SSL |
| Repeated login failures, then refused | Too many failed logins | Wait 15 minutes, then fix the password |
Questions
What is the difference between an SMTP relay and an email API?
They send the same email. SMTP works with any software that has email settings; an API is easier and more featureful for code you are writing.
Can I use my Gmail account as an SMTP relay?
For a few personal emails, yes. For a website or app it is a poor choice: daily limits are low, and mail from @gmail.com sent by another server fails DMARC.
How many recipients can one SMTP message have?
It depends on the provider. Sendflume accepts up to 50 recipients per message, and each recipient is checked and counted on its own.
Read next
Email that lands in the inbox.
Send campaigns and app email from your own domain, with SPF, DKIM and DMARC set up for you. Free to start.
No credit card needed.