Recently my colleagues at Reclaim start telling me my forwarded emails were sometimes delayed 2-3 hours or more, which can be very problematic when you have an issue to address that is timely. Tim noted it looked like SparkPost was holding the emails, and recommended trying Mailgun to see if that is any better. So, I limped through the week, but finally sat down this evening and when about switching from SparkPost to Mailgun, what follows are the boring details with some screenshots so I can refer back to this post when I have to do this all over again
First step is adding your domain for your email in Mailgun
The first step, and this kinda tripped me up, is adding the domain for the email you want to send over. I was sending (at least in this example) using email@example.com, but the domain I created was jim.rockawayhosting.com, even though I will not be sending email from firstname.lastname@example.org. Anyway, it is really a naming convention and a clean domain with rockawayhosting.com to set you various TXT, MX, and CNAME records. So, that was the next step:
Once you create your domain you are directed to go to where you manage DNS and add a number of records. We manage our DNS through AWS’s Route53, so I headed there and started adding records (there are two TXT records, two MX records, and one CNAME in all):
They will look something like the following (although your mileage may vary given this is the interface for Amazon’s Route53):
Once you have added all the records, you head back to Mailgun and verify they are working, which I did and they worked like a champ.
At this point I have Mailgun setup to send my email through their SMTP services, so now I have add email@example.com as an address I can use to send email from my main firstname.lastname@example.org account.
You go to Settings in your primary Gmail account:
And then under the “Accounts and Imports” tab you “Add another email address” in the “Send mail as” section:
From there, you specify the email you want to send mail from:
And then add the Mailgun SMTP server configuration settings:
After that, you are all set.
I tested it out, and I now have both email@example.com and firstname.lastname@example.org forwarded to my primary Gmail account (not covered above) as well as the ability to respond to those messages from from my primary email with the appropriate email address (covered above):
And it seems so clear right now, but two years later when this all goes to hell I will have forgotten everything I thought I know, hence the blog!
*Transactional email services are services that provide SMTP API-driven email infrastructure for applications that need to provide notifications, updates, and subscriptions. For example, a common one with WordPress would be a new account notification or a reset password email, etc. Using API driven email services like SparkPost, Mailgun, etc. has become more popular when running applications through infrastructure that makes it easier to just have an email services send these for you.