What is Transactional Email

Transactional email is the email sent when something triggered from your Web Application such as resetting the user password.

My WordPress didn’t send email

This is a common problem if you didn’t configure your server to relay email. Configuring the server to send email is hard. How hard it is? You need to pass 6 marks in MailTester to send an email to Gmail. And your email must be sent using SSL/TLS. Instead of sending email using secure communication, a perfect Simple Mail Transfer Protocol (SMTP) server would require you to set DomainKeys Identification Mail (DKIM), Sender Rewriting Scheme (SRS) (If you are sending email from multiple domains), Sender Policy Framework (SPF), Pointer Record (PTR) and also Domain Message Authentication Reporting (DMARC). Apart from that, you have to deal with messy Postfix configuration which you can’t understand at first look of its configuration files. You read it right, files, not file.

What is MailGun

MailGun is a transactional email service. It is a good third party email service which you can use to send your email to any available email without dealing with messy configuration. MailGun can send up to 10,000 emails per month for free and that is why we are suggesting MailGun for your transactional email service. We are not affiliated to MailGun in any way and we are recommending it because it is the best transactional email service we have tried so far. If you don’t want to use MailGun and insisted on sending email from your own server, take a look at our post on how to send email via PHP.

Registering to MailGun

When you are registered to MailGun, you need to add your Credit Card. They won’t charge you if you didn’t reach 10,000 emails per month. If you didn’t add your Credit Card, your email is limited to only whitelisted emails (we won’t discuss what it is).

Adding A New Domain To MailGun

To add a new domain, MailGun will ask you to use a subdomain instead of the root domain. In this tutorial, I will show you how to configure MailGun for runcloud.ga domain. As suggested by MailGun, I will be using mg.runcloud.ga.

Configuring DNS Records

After that, you will receive configuration options like the image below.

Mailgun DNS records

Don’t freak out! It is an easy setup. MailGun will ask you to add DNS record as shown above. I am a fan of Cloudflare DNS (only the DNS), and I am using their DNS service to manage my runcloud.ga domain. If you are using other DNS Service such as DNSMadeEasy, Digital Ocean DNS, or Linode DNS, this configuration won’t be any different.

After filling out the DNS Records inside Cloudflare, we will get the settings like the image below.

Check DNS Records

After filling in the DNS records, wait for at least 1 minutes (if you are using Cloudflare) and go back to MailGun. You will see a button to check DNS Records. By clicking that button, you should get all green check marks if you do everything right.

Besides that, you can see your domain is active inside MailGun

Creating MailGun Sender Account

To add a sender account, click Manage SMTP Credentials inside MailGun. Fill in the data like the image below.

You can use any username that you want. For me, I simply choose [email protected]. And don’t forget the password. We will use this account in the next step.

WordPress SMTP Plugin

There are plenty of WordPress plugins for SMTP and my suggestion is Easy WP SMTP and SMTP Mailing Queue. What is the different between both plugins? Easy WP SMTP just a plugin to replace default WordPress email sending method. While SMTP Mailing Queue will queue the email and send the email using cronjob. Check out our post on how to enable true cron job and make WordPress faster.

SMTP Settings

Inside any SMTP plugins that you are using, every plugin won’t differ much in configuration. All of them will ask for SMTP host, encryption, port, and credential. Now fill in the data with the same credential that you have created inside MailGun.

For the host, MailGun uses smtp.mailgun.org. For the port, you can use either 25, 587 or 465.

Testing

Some of the plugins that you are using may have a function to test sending email. But if your plugin doesn’t have it, just request a forgot password from WordPress.

Wrapping Up

RunCloud is a powerful and easy-to-use platform that helps you manage your websites on any cloud server. With RunCloud, you don’t need to be a Linux expert to set up, secure, and optimize your web applications. You can do everything from a simple and intuitive dashboard, saving you time and hassle.

RunCloud supports various web servers, PHP versions, databases, and frameworks. You can also monitor your server performance, back up your data, and automate your tasks with RunCloud. Whether you are a developer, a freelancer, or a business owner, RunCloud can help you run your websites faster and smoother.

What are you waiting for? Join RunCloud today and enjoy the best web hosting solution for your websites. It’s free for 7 days, no strings attached!