In order to help users dealing with spam, email services add harder filters every day. Lately, we’ve seen how more and more legitimate emails are rejected by Hotmail, others are flagged as spam by Gmail, and so on.
Providing professional, reliable mail hosting is difficult, if not impossible, using existing mail management control panels. For this reason, if you have problems with your email, do not blame CloudHotelier, Joomla, or your hosting provider: we strongly recommend using a third-party mail hosting provider rather than using your own mail servers.
Mailgun is our favorite email hosting provider as it allows you to send up to 10,000 emails per month for free. To use Mailgun, you need to sign up for a Mailgun account, add your domain and follow their steps to verify domain ownership. Then, all you need to do is configure Joomla to send emails through Mailgun service.
Step 1. Signup at Mailgun and verify domain ownership
This is the trickiest part, as it involves creating DNS records for your domain
Once signed up to the Mailgun panel, click on “Domains” tab and “Add New Domain”. Enter your domain and proceed.
Why does Mailgun warn to use a subdomain? Because it would prevent you to use Mailgun to receive emails. In 99% of the cases, you're not going to use Mailgun to receive email, so you can ignore the warning.
Once you added the domain you’ll need to add 2 txt records to your domain dns record entries.
The first one, SPF can be tricky, if you already have a SPF record, just add the include:mailgun.org before ~all. If you are creating a new one, use v=spf1 a mx include:mailgun.org ~all instead of the option suggested by Mailgun.
Add the DKIM record as well, and your domain should be verified by Mailgun. Once verified, you’ll get SMTP and API credentials so you're allowed to send emails through Mailgun.
Step 2. Configure Joomla to send over Mailgun SMTP servers
In this step, we are going to tell Joomla to send emails through Mailgun.
Login to your Joomla administrator and navigate to System -> Global Configuration. In the "Server" tab, under "Mail Settings" options:
- Mailer: SMTP
- SMTP Host: smtp.mailgun.org
- SMTP Port: 25
- SMTP Security: SSL/TLS
- SMTP Authentication: Yes
- SMTP Username: Mailgun credentials email (postmaster@...)
- SMTP Password: Mailgun credentials default password
Now you should be able to send emails using Mailgun SMTP servers.
The bad part is that sending emails through SMTP is slower than built-in email server. The best part of using Mailgun is that you can see in Mailgun logs if an email was delivered or not.
Pro tip: CloudHotelier extensions Mailgun API plugin.
When sending emails within CloudHotelier extensions, HRS Client, HRS Manager and JKit, you can use our Mailgun API plugin, that will replace the Joomla default emails settings using the Mailgun API to send emails instead.
All you have to do is to configure the plugin with your domain API credentials!
If everything went fine, your Joomla website should be using Mailgun service to send emails and you should be able to track email delivery information in Mailgun logs. With this easy steps, email delivery problems should be solved once and for all.