Join us
@sofiatarhonska ・ Oct 12,2022 ・ 6 min read ・ 1093 views ・ Originally posted on mailtrap.io
If you have a website running on WordPress and need to send newsletters or email notifications, then you have to perform additional setup actions. The native WordPress functionality for email sending uses the PHP mail() function, which is not the best option. First, its capabilities are pretty limited so that you can’t easily build HTML templates, embed images, or add attachments. Second, PHP mail() is poor with proper email headers. And this is just one of the reasons why such emails frequently land in spam folders. The latter increases the risk of lowering your domain reputation with mass emails.
Some WordPress hosts, like One, Warpgate, or Tap, have an SMTP server already pre-configured for each website – but this is more a rare exception than a trend among hosting providers. In most cases, additional steps will need to be made to ensure maximum deliverability for your emails.
To improve email deliverability, it is recommended to send all WordPress emails via an SMTP server. And here you have two reliable options:
In this article, we will inspect both options so you can choose the one suitable for you.
This is a tech-savvy method. If you are ready to deal with the email development using PHPMailer and don’t want to depend on WordPress plugins, this option is for you. The setup is quite easy. Go to your functions.php
file and configure the WordPress SMTP settings with the following code:
That’s it! Save the file: now you can manage your emails with PHPMailer and your SMTP server.
Note: WordPress was updated to the 5.5 version on Aug 11, 2020, that affected the PHPMailer library (support updated from 5.2.27 to 6.1.6.). This update might have caused errors with the previous integrations.
An even more popular option for integrating your SMTP server with your WordPress site is installing the appropriate plugin. On the “Plugins” page in WordPress, you will find around 400 results for the “SMTP” search query. How do you choose the right one? Check the following details:
As a result, we have chosen four plugins that have high popularity, work properly according to users’ reviews, and are regularly updated and tested.
WP Mail SMTP is the most used plugin with over one million active installations. Its free version allows you to integrate your preferred SMTP server or choose one of the built-in email sending providers (Sendinblue, Mailgun, SendGrid, and Gmail). The Pro version adds support for Amazon SES, Outlook, and Office 365. The more advanced plans allow you to set up DNS verifications as well as test and verify email delivery.
In general, the plugin setup is super easy and no coding skills are required.
Source: WP Mail SMTP
So you just go to the Settings page, choose a built-in mailer or “Other SMTP” if you use another provider. If you are going to send emails with one of the integrated providers, you will need to login to your account and configure the minimum settings. When using an alternative server, you will have to enter:
Source: WP Mail SMTP
Note that in this case, your password will be stored in the website database in plain text. This why for extra security it is recommended to set up the password in your wp-config.php
file by adding these two lines of code:
Once the configuration file is successfully updated, the password field in the setting will be disabled. If you are new to WordPress, you might want to check their instructions on editing wp-config.php
.
Easy WP SMTP is a similar and simple plugin for WordPress SMTP setup. It also uses the PHPMailer library. Its capabilities include:
Source: Easy WP SMTP
Like in a previous example, you will need to specify hostname, port, encryption and authentication details, as well as set up the “From” name and address. The debugging option lets you send a test message to any email address.
Post SMTP mailer utilizes Zend_Mail and in addition to the SMTP server setup provides the following capabilities:
Source: Post SMTP Mailer
This plugin is not a pure SMTP integration solution. It provides advanced functionality for sending newsletters and managing subscribers from your WordPress site or blog. The main capabilities include:
Source: Email Subscribers & Newsletters
Custom SMTP integration is available in paid subscription plans, which start at $6.50 monthly.
CBX Email SMTP & Logger for WordPress plugin helps to send emails using SMTP and logs them to keep the record. You can use multiple SMTP services to test email sending, you can also utilize features such as resenting, auto-deleting emails, and previews.
Source: CBX Email SMTP & Logger for WordPress
The core plugin is free with all the major features.
As we have demonstrated above, you can set up an SMTP server manually or with one of the SMTP plugins that are compatible with Namecheap, Hosting Forest, Kinsta, and many other popular WordPress hosts.
In addition, the most popular email sending providers have their own official plugins:
Note: We listed only those plugins, which have been updated in the last year
Any method you choose to set up sending your emails from WordPress via SMTP, you should properly test them before reaching the inboxes of real users. If you use a plugin, you can use its functionality to send test emails to your own inbox. But if you integrate SMTP manually, it is essential to test if email sending actually works. Set Mailtrap as your SMTP server first: it is a fast and easy way to verify email sending functionality, check email headers, and view your messages rendered by a webmail client.
If you have never used Mailtrap before, you can create a free account in just three clicks. Then go to your Mailtrap inbox, copy the necessary settings like hostname, port, your username, and password, and paste them to the WordPress settings file or appropriate plugin tab. Then compose an email and send it. It will be delivered to your Mailtrap inbox right away:
This way, you can safely test numerous email notifications and different types of messages without flooding your inbox or affecting your domain reputation.
Once you have verified that your emails look perfect, set your real SMTP server’s credentials and enjoy email sending from your WordPress website.
Thank you for reading our guide on setting up SMTP in WordPress. It was originally published on Mailtrap Blog by Diana Lepilkina: https://mailtrap.io/blog/wordpress-smtp-settings/
Join other developers and claim your FAUN account now!
Influence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.