Why use Mailgun? How to fix the outbound email issue when using WordPress forms.

As some of you may be aware and others may not, due to the way that servers work, it can be difficult to get website servers to send emails out to other email addresses.

The simple version of this is that hosting servers are not designed to be email servers and although hosting servers can send emails, it is not best practice to do so. This is why we use Office 365 and some other companies use Hosted Gmail or other Exchange providers, with other options also being available. You may also be aware of other email marketing tools such as Mailchimp, Campaign Monitor and others, they work in a similar way, they do not hosted emails, instead, they simply send email outbound.  

In many instances, there is a need for websites to send emails, such as forms or product purchases, this is where third-party solutions such as MailGun and SendGrid come in to play. They are more akin to MailChimp than Office365 / Gmail, as they too are similar in the way that they are meant for sending email outbound. The difference is that the intention is that email generated on the website is routed through MailGun and sent outbound appearing to come from an email address associated with the website (sort of like mailchimp etc).

In the event that we host a website, including our own or a website hosted for a client, we ensure to use MailGun.

Here is our simple guide to setting up mailgun:

  1. Add the domain to the mailgun account
  2. Ensure that the Post SMTP plugin is added to wordpress.
  3. Add the API keys to the plugin settings within wordpress.
  4. Ensure that the email is set as [email protected] (replacing the insert website text).
  5. Check the DNS records and ensure that they are all correct and verified.
  6. Conduct a test on the plugin and check that it has gone through on the mailgun logs.