← Back to documentation

Custom SMTP Server (BYO-SMTP)

Configure a relay target to deliver emails via your own SMTP provider.

7 min read

Custom SMTP Server (BYO-SMTP)

By default, PayloadRelay sends email relay deliveries through its own email infrastructure. With BYO-SMTP, you can configure a relay target to send emails through your own SMTP server (AWS SES, SendGrid, Postmark, Mailgun, Office 365, Gmail, or any SMTP-compatible service).

Why use BYO-SMTP?

  • Sender domain control — emails arrive from your own domain, improving deliverability
  • Compliance — keep email traffic within your own infrastructure for compliance requirements
  • Cost transparency — pay your email provider directly for each delivery

Configuration

In the relay target editor, select Custom SMTP server as the delivery mode for an EMAIL target, then configure:

FieldRequiredDescription
HostYesSMTP server hostname (e.g. smtp.sendgrid.net)
PortYesSMTP port (typically 587 for STARTTLS, 465 for SSL/TLS)
SecurityYesSTARTTLS (recommended), SSL/TLS, or None
UsernameYesSMTP authentication username
PasswordYesSMTP authentication password
From addressYesSender email address (must be authorized on your SMTP provider)
From nameNoDisplay name shown in the sender field
Reply-ToNoAddress replies should go to

Common provider settings

ProviderHostPortSecurityNotes
AWS SES (SMTP)email-smtp.us-east-1.amazonaws.com587STARTTLSUse SMTP credentials from SES console
SendGridsmtp.sendgrid.net587STARTTLSUsername is always apikey, password is API key
Postmarksmtp.postmarkapp.com587STARTTLSUsername & password are the Server API Token
Mailgunsmtp.mailgun.org587STARTTLSUse SMTP credentials from Mailgun domain settings
Office 365smtp.office365.com587STARTTLSUse your M365 account credentials or app password
Gmailsmtp.gmail.com587STARTTLSRequires an App Password

Verification

Use the Verify connection button in the relay target editor to test your SMTP configuration. PayloadRelay will open a connection to your SMTP server and send a test message to the target email address. The result (success or error) is stored on the target and shown in the UI.

Verification may be temporarily rate-limited after repeated attempts.

Security

  • SMTP passwords are stored securely and are not shown again after saving.
  • Connections to your SMTP server use TLS (STARTTLS or SSL/TLS) by default.
  • Rotate the SMTP password in your provider and update the target if you suspect exposure.

Quota interaction

All relay deliveries — both BYO-SMTP and platform email — count against your monthly request quota.

Troubleshooting

ErrorLikely cause
Connection refusedWrong host or port; firewall blocking outbound SMTP
Authentication failedWrong username or password
STARTTLS is requiredUse STARTTLS security, not None
SSL handshake failedTry STARTTLS instead of SSL/TLS, or check the port
Sender address rejectedYour From address is not authorized on the SMTP server
Recipient address rejectedSMTP server requires authenticated senders or domain verification