Table of content
- So how to solve this problem?
- 1 – Why configure SMTP and WordPress?
- Better email deliverability
- Reliability
- Security
- Email tracking
- 2 – why is SMTP essential for deliverability?
- Sender reputation
- Login Security
- Authentication
- Meets standards
- Reliability
- 3 – how to configure an SMTP on your site with a WordPress plugin;
- Install the WP Mail SMTP Plugin
- Configure WP Mail SMTP settings
- Save Changes
- Test sending email
- How to configure an SMTP on your site without a plugin (developer option)
- Open your functions.php file
- Add the following code to your functions.php file
- Replace the example values with your own SMTP information :
- Save your changes
- Conclusion
First, let's imagine a common scenario. You have worked hard to create an attractive WordPress site. You've installed all the required plugins, customized your theme, and added rich, engaging content. In addition, you have also configured an email sending system for important notifications, newsletters, order confirmations, and much more. However, you notice that your users are complaining about not receiving your emails, or they constantly find them in their spam folders. It's a frustrating problem, isn't it? It can seriously harm:
- your brand image,
- user engagement, and
- ultimately to your income.
This issue is often caused by the way WordPress handles sending emails. By default, WordPress uses PHP's mail()
function, which is usually frowned upon by mail servers. These servers may consider your emails as spam or reject them altogether.
So how to solve this problem?
The answer lies in SMTP or Simple Mail Transfer Protocol . By configuring your WordPress site to use SMTP to send emails, you can greatly improve your email deliverability, ensuring your messages reach your users' inboxes. In this article, we'll show you how to boost your email marketing strategy by setting up SMTP on your WordPress site. You'll learn why SMTP is essential for email deliverability, how to set it up on your site, and which are the best SMTP services to consider.
1 – Why configure SMTP and WordPress?
There are several reasons why you might want to configure SMTP on your WordPress site:
Better email deliverability
WordPress uses PHP's mail
function to send emails by default. However, many web hosts limit or completely block the use of this feature to prevent spam. This can cause email deliverability issues. With an SMTP, you can improve the likelihood of your emails reaching your users' inboxes.
Reliability
Emails sent via SMTP are usually more reliable. An SMTP requires authentication, which means emails are sent from a real email account. This makes it less likely that your emails will be marked as spam.
Security
SMTP usually uses a secure connection. Therefore, this means that your emails are sent securely. This can especially be important if you send sensitive information by email.
Email tracking
Some SMTP services offer tracking features. Thanks to this, you can see when your emails were opened and if the links they contain were clicked. However, it is crucial to note that there are potential costs associated with using an SMTP service. This is especially true if you send a lot of emails. Also, setting up SMTP can be a bit more complex than using the default WordPress mail
function. An alternative could be to create a dedicated email for SMTP in your web server.
2 – why is SMTP essential for deliverability?
In view of the first point, we can see that it is sometimes necessary to use an SMTP. We see some additional benefits below. SMTP or Simple Mail Transfer Protocol is essential for email deliverability for several reasons:
Sender reputation
Mail servers look at the sender's IP address and domain to determine if they are trustworthy. This is because SMTP uses authentication, which means emails are sent from a real email account with a good reputation. This reduces the likelihood of them being marked as spam.
Login Security
SMTP usually uses secure connections, often via TLS (Transport Layer Security) or SSL (Secure Sockets Layer). This means that the servers send emails securely. This factor plays an important role when mail servers determine deliverability.
Authentication
SMTP requires authentication in the form of a username and password. This ensures that only the authorized sender can send emails, adding an extra layer of trust and security.
Meets standards
The SMTP service is a well-established standard for sending emails. Indeed, mail servers around the world recognize and accept it easily.
Reliability
It offers a more reliable method for sending emails. In addition, It has mechanisms to handle errors and connection problems. Indeed, this mechanism is reassured to send your message or to inform you of the error that has occurred. These factors contribute to better email deliverability. In other words, your messages are more likely to reach your recipients' inboxes, rather than their spam folders. Therefore, for websites and applications that rely heavily on email communications, you should usually use SMTP.
3 – how to configure an SMTP on your site with a WordPress plugin;
Setting up SMTP on your WordPress site can be done simply using a plugin. Here's a step-by-step guide to doing it with the WP Mail SMTP plugin.
Install the WP Mail SMTP Plugin
Log in to your WordPress dashboard, go to "Extensions" > "Add", search for "WP Mail SMTP", then install and activate it.
Configure WP Mail SMTP settings
Once the plugin is activated, navigate to “WP Mail SMTP” in your WordPress dashboard. You will need to enter your SMTP details. This information will depend on the email provider you use (eg Gmail, Yahoo, your web host, etc.). Here are the typical settings:
- From Email: Enter the email from which you want to send your WordPress emails.
- From Name: Enter the name from which you wish to send your WordPress emails.
- Sender: Choose "Other SMTP".
- SMTP Host: You will get this from your email provider.
- Encryption: Choose SSL.
- SMTP port: Typically 465 for SSL encryption, or 587 for TLS.
- Auto TLS: Set to “On”.
- Authentication: Set to “On”.
- SMTP Username: The full email address of the account you wish to send emails from.
- SMTP password: The password for the email account mentioned above.
Save Changes
Once you have entered all the required information, click "Save Settings" .
Test sending email
WP Mail SMTP includes email testing functionality. Go to " WP Mail SMTP " > "Tools" > "Test Email", enter an email address to send an email, then click "Send Email". This will allow you to confirm that everything is working correctly. Note: This guide assumes that you have already created an email account. And, that you know your SMTP server details. If you use your host's email service, you can usually find these details in their documentation or by contacting their support.
How to configure an SMTP on your site without a plugin (developer option)
If you prefer to configure SMTP on WordPress without using a plugin, you can do so with the phpmailer_init action hook. Here's how you can do it:
Open your functions.php file
You can find it in your current theme directory (wp-content/themes/your-theme/). If you are using a child theme, use the child theme's functions.php file.
Add the following code to your functions.php file
add_action('phpmailer_init', 'my_phpmailer_example'); function my_phpmailer_example( $phpmailer ) { $phpmailer->isSMTP(); $phpmailer->Host = 'smtp.example.com'; $phpmailer->SMTPAuth = true; $phpmailer->Port = 465; $phpmailer->Username = '[email protected]'; $phpmailer->Password = 'your_password'; $phpmailer->SMTPSecure = 'ssl'; $phpmailer->From = '[email protected]'; $phpmailer->FromName = 'Your Name'; }
Replace the example values with your own SMTP information :
- First, Replace 'smtp.example.com' with your SMTP server name.
- Next, Replace ' [email protected] ' with your SMTP username.
- Replace 'your_password' with your SMTP password.
- Change the value of
$phpmailer->Port
if your SMTP server uses a different port. - Change the value of
$phpmailer->SMTPSecure
if your SMTP server uses another security protocol (or none). - Replace ' [email protected] ' with the email address you want to send emails from.
- Replace 'Your Name' with the name you want to display as the sender.
Save your changes
After adding and modifying the code, save your functions.php
file. Now WordPress will use the SMTP server you specified to send emails. Remember that this method puts your SMTP information in the clear in your code, which is not ideal for security. You should consider storing this information more securely, for example, with constants in the wp-config.php
file or through environment variables. (Or in the database) Also, if you modify or update your theme, you may need to repeat these steps, as changes to the functions.php
file may be overwritten. Using a child theme can help avoid this problem.
Conclusion
In conclusion, using SMTP to send emails from your WordPress site is an essential step to improving the deliverability of your emails. Whether you opt for:
- installing a plugin like WP Mail SMTP or
- manual configuration via the
functions.php
file,
the SMTP protocol will help you avoid your recipients' spam folders, strengthen your reputation as a sender and secure the transmission of your emails. Beyond these technical benefits, remember that every email you send is an interaction with your users or customers. Whether it be
- notification,
- an order confirmation,
- a newsletter or
- a simple word of welcome,
these emails are an opportunity to strengthen your brand and your relationship with your users. It is therefore crucial that these messages reach their destination. So remember that while this process seems technical, the goal is to improve your users' experience. A well-delivered email can be the difference between an engaged user and a lost user. We hope this guide will help you improve your WordPress email strategy with SMTP. Feel free to let us know your experiences, questions or concerns in the comments. Good deliverability! Contact us if you would like expert input on this.
Leave a comments: