How to use an SMTP relay for reliable delivery
Updated 7/20/2026
An SMTP relay is a service your app sends email through, instead of sending directly. The service has IPs with good reputation, so messages reach the inbox.
When it is worth it
- You only send transactional emails (confirmations, resets) and do not want to run a full mail server.
- Port 25 is blocked or your IP has no reputation.
- You need reliable delivery for large volumes.
How it works
You configure the app to send through the relay's SMTP server, with a username and password:
MAIL_HOST=smtp.relay-service.com
MAIL_PORT=587
MAIL_USERNAME=your_key
MAIL_PASSWORD=your_secret
MAIL_ENCRYPTION=tls
Configure DNS
The relay usually asks you to add SPF and DKIM records so it can send on behalf of your domain, see SPF, DKIM and DMARC.
Your own relay
You can also run your own relay with Postfix on a server dedicated to sending, separating reputation from the main app. To receive email, you still need a full mail server.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to filter spam with Rspamd
Rspamd is a modern, fast spam filter. Here is how to use it to keep your inbox clean.
Updated 7/20/2026EmailHow to secure a mail server
A misconfigured mail server becomes a spam source. Here are the essential security rules.
Updated 7/20/2026EmailHow to test email deliverability (avoid the spam folder)
Check whether your emails reach the inbox and what spam score they have, with free tools.
Updated 7/20/2026