Categories
Articles

Mailgun – Quick and easy option to integrate email

Email integration has been painful exercise, with the need to install SMTP server and using right set of libraries to send email. Moreover the follow up with administrators to enable specific ports for application and if you are small company, maintaining your own SMTP server is really frustrating. The fight with spam and a need to respond instantaneously to customer queries, may end up eating most of your crucial time. While experimenting with quite a few email services, I came across Mailgun. An easy to use HTTP service to send/receive emails.

The prerequisites to integrate Mailgun, requires

  1. Having your own domain.
  2. Verification stage which requires adding MX, CNAME and TXT entries.
  3. Use ready to get started APIs available on Mailgun site.

I won’t be listing the steps required to do the setup, as Mailgun has excellent documentation for same. But let me give you few glimpse of sample configuration that I did for one of my domain. Note that I am using GoDaddy control panel for modifying DNS settings.

DNS verification
DNS verification

dns_verification_2
DNS verification

godaddy-dns-settings
Godaddy settings

Send email

While setting up things is a piece of cake, the APIs to send email is also much easier. Developers are expected to post the required parameters to a specified URL and the job is done. The options includes adding attachments, tags and specifying delivery time. Thats not all, there is also an option to send email via SMTP, but that will require opening up SMTP port for communication.

Receive email

While Mailgun has stopped access to POMP3 and IMAP, that still doesn’t limit an option to receive email. In fact, the options provided to receive email are ideal choice for building scalable solution. Invoking a web accessible URL, provides opportunity to have customized handling of the message and leads to improving automation. Mailgun will ensure that whenever the email arrives it will invoke the provided URL with parsed message. Note to avoid pressure on your servers, Mailgun also provides option to store the messages upto 3 days and retrieve it later.
The other option include setting routes to forward message to predesignated email addresses.

Mailgun relieves you from maintaining your own SMTP server and thereby take care of all the hassles associated with it. Simply focus your energy on the critical aspects of the applications and let Mailgun do its job best.

By Carbon Rider

Hi this is Yogesh, welcome to my world. Being passionate about learning new technologies and building frameworks, I end up spending most of my time in front of computer. But over last few months, I realised apart from being good coder and designer (Yes I am) I have something hidden in me. And thats called ART.

Leave a Reply