Implement a Reliable Email Delivery System for MyListing Using Mailgun
Building better MyListing websites. One guide at a time.
Our Implement a Reliable Email Delivery System for MyListing Using Mailgun guide will show you how to easily implement this solution to send your customers email with confidence.
If you’ve ever had customers tell you that your website’s transactional email is constantly ending up in their SPAM/Junk folders or not received at all, this guide is definitely for you.
Transactional Email Types
- Receipts and Confirmations (ex. Order confirmations).
- Explicit Requests (ex. Password resets).
- Account Alerts (ex. Failed payment attempts).
- and more.
Mailgun signup is simple and they have a FREE plan/trial that includes 5,000 emails for the first 3 months, which is good for testing or for those just starting out with their MyListing website.
- 5,000 messages/month are included.
- There is a limit of 300 messages per day on the included sandbox domain.
- Data retention for Logs and the Events API is 1 day
- You cannot create custom domains.
- You can only send to Authorized Recipients, and there is a maximum of 5 Authorized Recipients.
If you opt to enter your credit card, after the trial period (the first 3 months) has ended and if you haven’t opted to upgrade into one of our subscription plans, you’ll continue on Flex (i.e. pay-as-you-go) plan, in which you’d pay for any messages you send at a rate of $0.80/1,000 messages.
Flex Plan Highlights:
- No daily sending limit.
- 5,000 FREE messages a month for the first 3 months.
- 5-day data retention for logs and the Events API.
- Custom domains.
- Use of Authorized Recipients is not required to send with custom domains.
Activate Your Account
For this guide, we jumped right to the Flex plan, so we could configure a custom domain, and because the pricing is so inexpensive, even if there were overages.
- Sign up for Mailgun.
- Enter payment information, unchecking the ‘Add payment info now’ box, unless you are comfortable with automatically being billed after the 3-month trial has ended.
- Click the ‘Create Account’ button and verify your account, using the email that Mailgun sends out.
Add and Verify Your Domain
After activating your account, Mailgun will drop you into your dashboard, where you will continue on with the instructions below.
- From your Mailgun dashboard, add your custom domain.
- Enter your domain name.
- Choose your Domain region to send mail from.
- Choose the strongest key length that your email system supports. (Note: Stick with the default option of 1024 if you don’t want to take the time to at least investigate implementing the stronger 2048 key length.).
- Click the ‘Add Domain’ button.
- Go to the DNS provider you use to manage the domain you’re adding to Mailgun. (Note: Mailgun provides some links to some common DNS providers, so you might be able to save a bit of time.).
Pro Tip: Cloudflare is our recommended provider for the fastest DNS services and we’ve written a comprehensive guide for MyListing website owners.
- Add the DNS sending records that are provided by Mailgun. (Note: Most website owners will be able to skip the MX records, as those should already be added for use with solutions like Microsoft 365, Google Workspace, etc.).
- Click the ‘Verify DNS Settings’ button, once all the desired DNS records have been added. (Note: It can take up to 48 hours for the DNS settings to propagate across the web and that is why we highly recommend Cloudflare, as it propagates almost instantly.).
- Continue clicking on the ‘Verify DNS Settings’ button, until Mailgun kicks you into their ‘Overview’ page, which means your DNS has been properly validated. (Note: You will also receive an email notification once DNS is ready to go.).
If you already have SPF records configured within your SMTP email service (Microsoft 365, Google Workplace, etc.) prior to setting up Mailgun for your domain, you’ll get a message saying that you can only have a single SPF record per domain.
Not to worry, as all you need to do is combine your SPF records into a single record.
For example, with Microsoft 365, you’ll have an SPF record of v=spf1 include:spf.protection.outlook.com -all and for Mailgun, you’ll have an SPF record of v=spf1 include:mailgun.org ~all, so you will combine them to be as shown below.
v=spf1 include:mailgun.org include:spf.protection.outlook.com -all
Sending API Keys
If you are setting up Mailgun for a handful of websites, using your account’s Private API key (the one created by default) is just fine.
Meaning, if the API key gets compromised, it would just be a matter of generating a new key and updating the key on your websites.
However, if you are managing say 10 or more websites or websites for clients, it would be a good idea to generate a Sending API Key for each website.
- Mailgun Dashboard > Sending > Domain Settings.
- Select a domain.
- Click on the ‘Sending API keys’ tab.
- Click on the ‘Add sending key’ button.
- Enter a sending key. (Note: Just keep the key super short and simple, as Mailgun will automatically generate a highly-secure/complex API key for you.).
- Click the ‘Create sending key’ button.
- Click the copy icon next to your new API Key and paste it into your website, which is covered in the following section.
- Rinse, repeat, for additional domains.
Configure Mailgun for WordPress
- Install and activate the official Mailgun plugin.
- Pull up the settings area of the plugin.
- Select Your Region > Ensure this setting matches what you chose in your Mailgun dashboard.
- Mailgun Domain Name > Ensure this setting matches what you chose in your Mailgun dashboard.
- API Key > Grab your Private API Key from your Mailgun dashboard (User Avatar > API Keys) and paste it here.
- From Address > Add an email address that matches your custom domain name (e.g. [email protected]).
- From Name > Add a name that matches your brand or business name (e.g. MyListing Club).
- Override “From” Details > Set to ‘Yes’.
- Click the ‘Save Changes’ button.
- Click the ‘Test Configuration’ button.
If everything is configured correctly, you should receive a ‘Mailgun HTTP API Test Success; status “Success”‘ message.
You will also receive an email that confirms sending is working, which region Mailgun is sending from and which method (e.g. HTTP API) is being used.
At this point, all transactional emails (order information, subscription information, password resets, etc.) are automatically sent through Mailgun.
Multiple Domains Under One Account
The following steps show how to include additional domains under a single Mailgun account.
- Repeat the steps from the ‘Add and Verify Your Domain’ section, above.
- Repeat the steps from the ‘Configure Mailgun for WordPress’ section, above.
- Rinse, repeat, for any additional domains you would like to add.
Remove a Website From Your Account
If you have an account where you are managing multiple domains, the following steps help you to remove a specific domain, while keeping your Mailgun account active.
- Mailgun Dashboard > Sending > Click on the domain.
- Expand the ‘Sending’ menu item.
- Click ‘Domain Settings’.
- Advanced > Deleted Domain > Click ‘Delete’.
- Remove all Mailgun DNS entries from wherever you manage your DNS.
- WordPress Dashboard > Remove the Mailgun plugin.
Getting ahead of your transactional email delivery issues is super important for your company’s reputation and internal success.
Mailgun’s Flex pricing is extremely low-cost, for what you get, so we see no downsides to implementing this solution on your MyListing website.