- 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- MAIL_DRIVER=mailgun
- MAIL_HOST=smtp.mailgun.org
- MAIL_PORT=587
- MAIL_USERNAME=[email protected]
- MAIL_PASSWORD=502fd951f7------------------------
- MAILGUN_DOMAIN=sandbox21f9a-----------------------166f.mailgun.org
- MAILGUN_SECRET=key-ee-----------------------------
-Now your mailgun configuration is complete and your are to send email
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