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

SettingSendflume valueNotes
Host (server)smtp.sendflume.comYour provider's relay address
Port587Use 2525 if 587 is blocked by your host
EncryptionSTARTTLS (sometimes called TLS)Starts plain and upgrades to encrypted
UsernameAnything, for example "api"Some providers need a specific username
PasswordYour API keyCreate a key with permission to send
From addressAn address on your verified domainMail from unverified domains is refused

Which port?

PortUse it?Why
587YesThe standard port for sending with a login, using STARTTLS
2525Yes, as a fallbackNot official, but widely offered for hosts that block 587
465Only if your provider supports itEncrypted from the first byte (implicit TLS)
25NoFor 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

ErrorLikely causeFix
Connection timed outYour host blocks the portTry 2525, or ask your host to open 587
535 Authentication failedWrong or revoked keyCreate a new key and paste it again, with no spaces
550, sender or domain refusedThe From domain is not verifiedVerify the domain, or send from one that is
TLS or certificate errorsWrong encryption settingUse STARTTLS on 587, not SSL
Repeated login failures, then refusedToo many failed loginsWait 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.