Setting Up Mailgun for WordPress so your contact forms get through every time
Sending wordpress emails through Mailgun
Email is still a critical mode of communication for businesses to their customer base, and that’s not likely to change any time soon. However, the business of ensuring delivery of your email to those customers can be tricky indeed.
That’s why we generally recommend leaving the business of maintaining email servers and delivering mail to specialists in the field. There are many great transactional email providers out there. One that we use and recommend is Mailgun. We like Mailgun because they are easy to set up, have a free WordPress plugin, and have a free tier which allows up to 10,000 emails per month to be sent. This makes it easy for businesses to get started without worrying about additional overheads until their cost is justified.
STEP 1: Configure your domain on Mailgun
- If you don’t have a Mailgun account you’ll need to set one up for free at http://mailgun.com/signup. If you have one already you should log in.
- Enter your domain and click the ‘Add Domain’ button.
- NOTE: As per Mailgun’s recommendation, you should use a subdomain of your root domain. For example, if your domain name is mydomain.com you should use mg.mydomain.com. Don’t worry if you haven’t set up this subdomain yet, we’ll do that in step two. (Avoid mail.mydomain.com as cpanel reserves this subdomain for it’s own internal email routing.)
- You will need to create one CNAME record:
- From the dropdown, select ‘Add CNAME Record’.
- If the records have been entered correctly you should see green ticks next to each record and the domain should show as ‘Active’. NOTE: DNS records can take up to 24 hours to propagate, though they are usually ready almost immediately. If no records show up after checking, wait several hours and try again.
Step 4: Install and configure the WordPress Plugin
- Log in to your WordPress installation.
- Click Plugins > Add New.
- Search for ‘Mailgun’.
- Install “Mailgun for WordPress” by Mailgun.
- Activate the plugin.
- Click ‘configure Mailgun’ in the success alert.
- Enter the subdomain into the Mailgun Domain Name field in WordPress.
- Enter the API key from the Mailgun credentials page into the API key field in WordPress.
- Enter the default from email address and name for your site.
- Click ‘Save Changes’.
- Click ‘Test Configuration'.
- You will receive a browser alert stating the result of your attempt.