Configuring an SMTP plugin in WordPress
By default WordPress sends mail through the PHP mail function of your hosting, and that is why password resets and form messages so often end up in the spam folder. With an SMTP plugin you let all mail from your site leave through 2Mail, with an authenticated sender and a log entry per message.
What you need
- the server name shown in your 2mail account
- an SMTP login and password, created in the dashboard for this website
- a sender address on your own domain, registered as a sending domain in your account
- an SMTP plugin of your choice from the plugin library; the common ones all ask for the same four details
Step 1: install the plugin
Install and activate an SMTP plugin. Pick one that is actively maintained and has a test function and a log; those two save you a lot of searching later. We advise against editing the code of your theme yourself: at the next theme update that change is gone.
Step 2: set up the mailer
In the plugin, choose the option for another SMTP server as the mailer. Fill in:
- Host: the server name from your 2mail account
- Encryption: TLS (STARTTLS), with port 587
- Authentication: on, with the 2Mail SMTP login and password
- From address and name: an address on your own domain and your company name
Tick that the plugin may force the from address. Otherwise some plugins and forms still send mail in the visitor's name, and our relay cannot authenticate that sender.
Step 3: keep the password safe
Most plugins offer to store the login not in the database but in the WordPress configuration file. Do that if you can: the password is then not part of a database backup and not visible to other administrators of the site.
Step 4: test
Use the plugin's test function and send a message to an address outside your domain. Then check two things: is the message in the delivery log of the 2Mail dashboard, and does it land in the inbox rather than the spam folder? If the second is not the case, the SPF and DKIM records of your domain are usually still missing.
Common mistakes
- Connection refused — some hosting plans block outgoing connections on port 587. Ask your host to open the port.
- Sender in the visitor's name — forcing the from address is switched off.
- Mail works, but orders do not — WooCommerce has its own sender settings; read WooCommerce emails via 2Mail.
Everything about this integration is gathered on SMTP for WordPress.
Still stuck?
Send us the error from the plugin's log via contact. With that message and the time, we find the message right away.
Does it behave differently than described above, or are you stuck anyway? Get in touch with your domain name or customer number at hand and we will take a look with you.
Contact support