Use Mailgun SMTP in a Laravel App

Mailgun is a service for sending transnational emails from your app. Once you’ve created your Mailgun account and verified it with your app’s domain, here are the steps for making your app use Mailgun’s SMTP service for sending emails from the app.

1. Edit the .env file on the production server.

I use Forge, so I go to my site on the dashboard at, click on Environment and edit the environment.
For the mail settings, I use the following:


2. Update the default “from” settings to match my app.

In the .env file, I add the following:

That’s it! Now my app is using Mailgun’s SMTP service to send emails from the app.

Leave a Reply

%d bloggers like this: