Backup SMTP transport
On this page
Set up a second SMTP server that sends your email automatically when your main mailer fails, and learn which failures it never retries.
A backup SMTP transport is a second way out for your site's email. If your main mailer cannot send a message, CRM-NG SMTP tries again straight away through the backup server. This article explains how to set it up, when it is used, and when it is not. It is for site owners who cannot afford to lose password resets, orders or bookings during a mail-service outage.
When the backup is used
The tab sums it up: Used only when the primary transport fails. Permanent recipient and partial-delivery errors are never retried.
In practice:
- Every email first goes through your main mailer, as usual.
- If the main mailer succeeds, the backup is never touched.
- If the main mailer fails with a problem that a different server could fix, such as a timeout, a refused connection or a server error, CRM-NG SMTP sends the same message through the backup at once.
- If the backup succeeds, the log shows Sent-backup and the Error field starts with "Primary failed:" followed by the reason. No failure alert is sent.
- If the backup also fails, the email is marked Failed and your alerts go out.
Failures that are never retried
Some failures would fail again on any server, or retrying could cause harm. CRM-NG SMTP does not use the backup when:
- The main mailer answered with an HTTP 4xx error. API mailers return these for problems such as a bad request, an invalid or revoked API key, or an unverified sender.
- The error mentions a recipient, mailbox or address, or says the message was rejected. A bad address is bad everywhere.
- The error mentions partial delivery. Some recipients already received the message, and a retry would send them a duplicate.
The backup does not fix a broken main mailer
Because invalid API keys usually come back as 4xx errors, an expired or revoked key is not rescued by the backup. The backup covers outages and connection problems. Keep alerts on so you notice when your main settings need attention.
Test emails never use the backup
Emails sent from Tools → Email Test always go through the main mailer only. That way a test tells you the truth about your main settings, instead of quietly succeeding through the backup.
Set it up
You need SMTP details from a second mail service: host, port, encryption and, usually, a username and password. For real protection, choose a different provider from your main mailer. A backup on the same provider fails at the same time.
- Open the Alerts tab
Go to CRM-NG SMTP → Settings → Alerts and scroll to Backup SMTP Transport.
- Switch it on
Tick Enabled next to Backup transport.
- Enter the server
Type the server name into SMTP host, for example
smtp.example-mail.com. - Choose port and security
On the Port / security row, enter the port and pick None, SSL or TLS. The usual pairs are 587 with TLS and 465 with SSL. Avoid None unless the provider tells you to use it.
- Set authentication
Leave Use SMTP authentication ticked for almost every provider, then fill in Username and Password.
- Save
Press Save Alert Settings.
The password is Stored encrypted with the plugin encryption key. After saving, its box shows Saved — leave blank to keep. Type a new password only when you want to change it.
How the backup sends
- It sends the same message: same From address, recipients, subject, body and attachments.
- It waits up to 15 seconds for the backup server before giving up.
- The From address must be allowed by the backup provider. Many providers only send from addresses or domains you have verified with them. Add your sending domain there, and publish their SPF and DKIM records too. See DNS records for email.
- The backup only applies while CRM-NG SMTP is the plugin sending your site's email.
Check that it works
The easiest safe check is on a staging copy of your site: set your main mailer's host or port to something unreachable, send an ordinary email from the site (not from Email Test), and look for Sent-backup on the Email Log tab. Then restore the main settings.
On your live site, check the Sent by backup total on Email reports now and then. Any number above zero means your main mailer had trouble.
Use the backup for chosen emails
The same backup server can also carry selected emails all the time, chosen by recipient or subject. See Smart routing.
