CloudLinux.ro
Email

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 pricing

Related tutorials