DevGypsy

Migrating away from Mailgun to Amazon SES

So, Ive been a relatively happy user of Mailgun for all my transactional store and support emails and also for my newsletter blasts. When I say relatively happy, it was not without issue. I run my rails/node apps on subdomains. And with this setup, it was just not possible to configure Mailgun to send the transactional emails from the base domain. As an example, the licenses from my store were being sent with headers showing as coming from licensing.sweetpproductions.com, rather than sweetpproductions.com. This was causing issues with gmail putting license emails into users spam folders, as the mail server didn’t match correctly… While this was annoying to deal with, as an indie dev, its hard to argue with free emails… which is what Mailgun were offering. 10,000 free emails per month to be exact. So, I added a note to my store, to let users know they should check their spam folders for any misplaced emails from me…

Mailgun price changes

Well, the free email party has ended with the release of Mailgun’s new pricing structure. And while I can’t blame them, I saw it as an opportunity to migrate away to a cheaper solution. Mailgun has moved to a pay as you go fee structure with a generous $0.80 per 1000 emails. While this is extremely cheap, Amazon SES pay as you go structure is much more enticing for anyone wanting to minimize their expenses: $0.10 per 1000 emails!. And because I only used Mailgun to ensure deliverability of emails, and not for receiving emails, it made total sense to switch to the most cost effective solution.

Switching to Amazon SES (Simple Email Service)

Im not sure why I avoided using SES when I initially looked for a transactional email service… I think the confusing admin panel and the fact that you need to request to leave the sandbox put me off, also Mailgun is very developer friendly, and had that generous 10,000 free monthly emails. Anyhow, It was time to change, so I dove straight in, and found the process much easier than i thought, which was a nice surprise. After setting up an SES account, I used my sandbox SMTP credentials and plugged them into my rails store, my node newsletter mailer, and my node support forums. Super easy!

I also needed to add a few custom DNS records, and remove all the Mailgun DNS records. I use CloudFlare, and editing these was a breeze. I ran a quick couple of tests to make sure everything worked - which it did.

Finishing up

The final step before going live was to get out of the sandbox and lift any sending restrictions. Also super easy. I sent the request on a Sunday afternoon, and the restrictions were lifted monday evening!