Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Laravel Mailgun Setup

Mailgun setup

  • install Guzzle HTTP library : composer require guzzlehttp/guzzle
  • [sign up to mailgun] (http://www.mailgun.com)
  • Go to Domains tab and click on domains
  • You will find the necessary data for .env setup

-Now your mailgun configuration is complete and your are to send email

@ericmachine88

This comment has been minimized.

Copy link

commented May 22, 2016

Tried the above and getting this laravel 5.2 error

Swift_RfcComplianceException in MailboxHeader.php line 348:
Address in mailbox given [] does not comply with RFC 2822, 3.6.2.

any idea?

@Trodrige

This comment has been minimized.

Copy link

commented Jul 17, 2016

Tried this and had this error

Swift_TransportException in AbstractSmtpTransport.php line 383:
Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required
"

Please any idea why I'm seeing this?

@dswebsites

This comment has been minimized.

Copy link

commented Jul 26, 2016

I had a similar error with Laravel 5.2 and had to modify my .env file from:
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

to

MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME={your mailgun username} 1 - "Default SMTP Login" on your mailgun Domains page
MAIL_PASSWORD={your mailgun password} 2 - "Default Password" on your mailgun Domains page
MAIL_ENCRYPTION=null

MAILGUN_DOMAIN={your mailgun domain} 3 - Your mailgun Domain name
MAILGUN_SECRET={your mailgun API Key} 4 - "API Key" on your mailgun Domains page

2016-07-26_23h10_23

@edwardkarlsson

This comment has been minimized.

Copy link

commented Jan 15, 2017

This worked great for me, thanks @mrabbani for taking the time to share.

@bnlambert

This comment has been minimized.

Copy link

commented May 22, 2018

@dswebsites Thank you very much for pointing everything out.

@mrnerdy

This comment has been minimized.

Copy link

commented Jul 12, 2018

@dswebsites Thanks!

@aurawindsurfing

This comment has been minimized.

Copy link

commented Jul 28, 2018

Cheers!

@elinardo10

This comment has been minimized.

Copy link

commented Aug 2, 2018

but this do in app localhost or cloud? need config anything in DNS for digital ocean for exemple? thanks

@agoiabel

This comment has been minimized.

Copy link

commented Oct 2, 2018

Thanks

@alonzosims

This comment has been minimized.

Copy link

commented Dec 16, 2018

Thank you for taking the time and pointing everything out

@Axeres

This comment has been minimized.

Copy link

commented May 3, 2019

@dswebsites Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.