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:
- Setup SMTP programmatically.
- Integrate it with the help of a WordPress plugin.
In this article, we will inspect both options so you can choose the one suitable for you.
How to configure SMTP settings in WordPress programmatically
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: