WordPress ·

Fast Emails by Configuring SMTP in WordPress

Fast Emails by Configuring SMTP in WordPress
Configure SMTP to avoid email sending and receiving issues in WordPress

Using the shared server where our website is hosted for sending emails is rarely the best option.

One of the best solutions is to use an external server specialised in sending emails — that is where using SMTP in your WordPress comes in.

What is an SMTP server

Although we colloquially call them SMTP servers, that is not technically the most accurate term. SMTP is not a server type but an email transmission protocol. In fact, SMTP (an acronym from Poe's language) stands for Simple Mail Transfer Protocol. The word "server" comes from the machine responsible for these services. Essentially, the SMTP server is the computer responsible for using the SMTP protocol to transport an email from one place to another.

SMTP Protocol

Surprisingly, this protocol has existed since 1982 and, despite improvements, still does the same thing: verifying that the sender and recipient are who they should be.

Benefits of using SMTP in WordPress

Using this service can bring a large number of improvements. Below I show you some of them.

WordPress does not send emails locally

When we have WordPress installed locally — whether in Xampp, Wamp, or any similar service — one of the barriers we encounter is that we cannot send emails. This is because wp_mail() is not supported locally since it works through PHP's mail() function, which requires the configuration of an MTA (Mail Transfer Agent).

A simple solution is to use an SMTP server. One thing to keep in mind is that these servers usually verify the sender's mail domain via DNS zone records. For this reason, if we want to configure it locally, we can always do so through an email account of a website we have up and running online.

WordPress does not send emails locally

Faster emails for your WordPress

Using SMTP servers usually offers faster delivery and reception than the servers used to host websites.

External responsibility

Delegating the responsibility of email transfer to companies specialised in this type of service should be an improvement.

Server usage limitation

Many servers have limited resource consumption. That is why using a service that manages email transfer from an external server will optimise and save resources on the server where our website is hosted.

Many SMTP services are free

Yes, being free is also a benefit. We will not deny that.

Statistical reports

SMTP servers usually include a section where we can see reports on how, what, and when emails are delivered.

Support for bulk mailing

SMTP services must properly support sending emails in bulk. A real marvel.

Greater security

The basic principle of the protocol is data verification. So yes, using SMTP should improve security in email transfer.

Free SMTP servers to use in WordPress

Free SMTP servers for WordPress

There are plenty of SMTP services you can work with, but if you are looking for a bulk email service to get started, Mailrelay is undoubtedly a good option, as it allows you to send up to 80,000 free emails per month, and also has a fairly comprehensive API, which definitely deserves some stars.

But do not start sending emails wildly — there are some details to keep in mind when running mailing campaigns. Take a look at this article on bulk mailing where some key details are explained.

Mailrelay SMTP in WordPress

To benefit from using Mailrelay, you will need to complete some prior configuration:

  1. Once registered, go to Control Panel / Settings / Email Authentication
  2. Access your server and find the DNS configuration section
  3. From there you can create a new TXT record
  4. Copy the code shown in the SPF section — the one starting with v=spf
  5. Paste it in the "value" field when creating the TXT record. The name field does not need to be filled in
  6. Clear the server cache, if it exists, to make sure the new content is displayed

And voilà, your SMTP service is configured. Simple, right? Now go to the Mailrelay control panel at Control Panel / Settings / SMTP configurations, enable SMTP, and you're done! You will have the ability to use it with that domain. When I say you can use it with that domain, I mean using it with an email from that domain. For example, if you use Contact Form 7, in the configuration area of a specific contact form, you will need to enter an email from the domain you configured. That email must have been added as a sender and verified from the control panel.

Once everything is configured, to verify it is working correctly, simply send an email and verify it reached the destination account. Open it and, if you are using Gmail for example, you will see a small downward arrow next to the sender's email. Click it, and inside the popup you should see: signed by: mrelayip.com.

There are also other free SMTP servers, although somewhat more limited. Among them we can highlight:

  • Gmail
  • Hotmail
  • Yahoo
  • AOL
  • Zoho Mail
  • Hushmail
  • GMX
  • Sendinblue
  • SMTP2GO
  • MailerSend
  • Netcore
  • Moosend
  • Mailgun
  • Amazon SES
  • SendGrid
  • Elastic Email

How to configure SMTP in WordPress without plugins

Once we have the SMTP server credentials, we just need to configure it in our website for use in forms. For this we only need to add a small snippet of code in, for example, our functions.php:

function webheroe_php_mailer(PHPMailer\PHPMailer\PHPMailer $phpmailer){
    $phpmailer->Host             = 'smtp1.s.ipzmarketing.com'; // SMTP server
    $phpmailer->Port              = 587; // Port used on the SMTP server
    $phpmailer->Username     = 'us_ua_rio_smtp'; // SMTP username
    $phpmailer->Password      = 'La_CoNtrAseÑa_123'; // SMTP server password
    $phpmailer->SMTPAuth    = true;
    $phpmailer->SMTPSecure = 'tls'; // Encryption type
    $phpmailer->IsSMTP()
}
add_action( 'phpmailer_init', 'webheroe_php_mailer', 10, 1 );
Bulk mailing in WordPress with SMTP

SMTP Plugins

There are a large number of plugins to configure SMTP in WordPress. If you are only implementing the SMTP service, I do not recommend using these types of plugins to avoid potentially bloating your website with code.

It is not that these particular plugins significantly bloat a website, but I am one of those who prefers to save resources whenever possible. These are just some of the many SMTP plugins in the WordPress repository:

  • WP Mail SMTP by WPForms
  • POST SMTP Mailer
  • Easy WP SMTP by SendLayer
  • FluentSMTP
  • SMTP Mailer
  • WP SMTP
  • WP Mail Smtp
  • WordPress Simple SMTP

Conclusion

SMTP in WordPress is a great ally for managing mailing campaigns and guaranteeing security and speed in email transfer. Moreover, there are a large number of free SMTP servers offering genuinely outstanding services. In fact, if you are not running "titanic" mailing campaigns, these free services should be more than sufficient.

Something I must highlight about using SMTP servers is the data they provide. This way we can study and improve our mailing campaigns.

Note: if you want to keep optimising your website and improving all these details, you should take a look at WordPress Schema, a tool that can make a difference in your search engine rankings.

Keep reading

Professional Website Maintenance: How Much Does Skipping It Cost You?

How to Translate Your WordPress Plugin (or Theme)

The WordPress Trash: An Underrated Feature

Comments

Be the first to comment on this post.

Leave a comment

Your email won't be public. Comments are moderated before being published.