Using Mailgun for sending out transactional emails helps prevent messages from going to spam. This is why we recommend the service to our clients.
Signing Up for an Account
The first step is to sign up for a Mailgun account: https://signup.mailgun.com/new/signup
Add a Domain to Your Mailgun Account
Once your account has been set up, you’ll need to add your domain. To prevent interference with your current email hosting, Mailgun suggests using a subdomain instead of your root domain, such as mg.waaz.co versus of waaz.co. Submit the “Add Domain” form and keep the page open, we will need the provided settings to use in GoDaddy’s settings.
Add the DNS Records to GoDaddy
Log into your GoDaddy account and go to the My Products page. Scroll to the Domains section and expand it if needed. Find the domain you added to Mailgun and click on the DNS button in its row. Keep this tab open so we can quickly add the records from Mailgun.
Adding the TXT Records
We need to copy the two TXT records over to GoDaddy from the Mailgun tab.
Copy Over the SPF Record
Go back to the Mailgun settings tab and copy the first provided value from “Enter This Value” column.
In GoDaddy’s DNS settings page, scroll to the bottom of the list of DNS records and click the Add button. Select TXT from the dropdown menu in the dialog.
In our example, we are setting up mg.waaz.co, so “mg” needs to be used for the Host field (make sure you don’t add the full domain to the Host field, just the subdomain portion).
For the Time To Live (TTL) setting, choose custom, and then in the Seconds field enter 600 and click Save.
Copy Over the Domain Key Record
Next step is to copy the domain key from Mailgun to GoDaddy. From the Mailgun tab, copy the Enter This Value for the second TXT row.
Back in the GoDaddy tab, click the Add button in the DNS settings list. For the Host field add “krs._domainkey.mg” (notice the .mg at the end of that value and adjust accordingly). Paste in the value copied from Mailgun into the TXT Value field.
Adding the MX Records
Next up are the two, super-simple MX records. In the DNS settings page for GoDaddy, start the dialog for a new DNS record (click Add at the bottom of the page).
Choose MX from the dialog dropdown. Enter the following values:
- Host: mg (adjust according the to subdomain you added to Mailgun)
- Points to: mxa.mailgun.com
- Priority: 10
- TTL: Custom
- Seconds: 600
Repeat those same steps for a second MX record, but use mxb.mailgun.com instead of the mxa prefixed value for the Points to field.
Add the CNAME Record
Finally, we are going to add the CNAME record. This setting is optional, but is beneficial for tracking open rates of the emails.
Start another dialog to add a DNS record in GoDaddy and choose CNAME from the Type dropdown.
Use the following values for the fields:
- Host: email.mg (adjust the “mg” portion as needed)
- Points to: mailgun.org
- TTL: Custom
- Seconds: 600
Finalize the Domain Validation
Now that the DNS records have been added to the domain, we can validate the domain in Mailgun. In the Mailgun tab we have open (with all of the DNS settings to use), scroll to the bottom of the page and click Get Started Sending.
On the following page, scroll to the Domain Validation & DNS section and expand it.
Click on the Check DNS Records Now button. Hopefully everything listed now has a green check box. If not, wait a few more minutes and try again. Typically these settings only take 5-10 minutes to propagate, but could take upwards of 24-48 hours.
Bonus: Setting Up Mailgun with WordPress
After the DNS settings are configured for your domain, setting up WordPress to utilize Mailgun is a breeze.
In Mailgun, go to the Domains page and click on the domain you added earlier. Copy the API Key near the top of the page.
Log into your WordPress admin dashboard and go to the plugins page. Click on the Add New button at the top of the page. Type “Mailgun” into the search bar at the top right. Find the plugin named “Mailgun for WordPress” by Mailgun and click Install (screenshot below). When it finishes installing click the Activate button.
When the plugin activates, hover over the Settings menu on the left and click on Mailgun. Scroll down to the API Key setting and paste in the API Key from Mailgun.
Finally, for the Mailgun Domain Name setting put in the domain you gave during the initial Mailgun configuration.
Scroll to the bottom of the page and click Save Changes.
We’re Here to Help
If you’re struggling with getting Mailgun setup on GoDaddy, feel free to contact us and we’ll help you get squared away.