DEV Community

Cover image for Using Mailgun to Send Emails from your Website
ExpressionEngine for ExpressionEngine

Posted on • Originally published at on


Using Mailgun to Send Emails from your Website

Mailgun’s SMTP Relay service is a quick an easy way to have ExpressionEngine transactional emails handled through a dedicated email provider. There’s just one tiny glitch you need to be aware of. The line ending setting needs to be changed from the default \n to \r\n. That’s it. Everything else is self-evident. But in case it’s not…

In your Mailgun account, go to the Overview for your domain. In my case, I just have their default sandbox domain. You’re going to select ‘SMTP’ as your mail option and the required settings, including username and password, will be revealed.

Go to your ‘Settings- Outgoing Email’ settings in your ExpressionEngine control panel and enter your Mailgun settings

Setting Value
Protocal SMTP
Newline Character \r\n
Server Address
Server Port 587
Connection Type STARTTLS

Save your settings and send a few test emails from the Communicate page.


Originally published by Robin Sowell at

Top comments (0)

Advice For Junior Developers

Advice from a career of 15+ years for new and beginner developers just getting started on their journey.