Laravel 5.5 mailgun not sending emails - no errors
Your configuration is wrong:
'mailgun' => [
'domain' => env('sandbox1e...60.mailgun.org'),
'secret' => env('key-146...419'),
],
The env function looks for an environment variable with the name you provide and returns the value. You should change it to the name of an environment variable and define it in your .env or don't use the env function, but that's not recommended.
Whereas Esteban Garcia's answer is correct, I to wish improve it with code snippets showing how exactly the configuration should look like:
In your config/services.php
, leave the configuration as shown below:
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
],
In your .env
file, that is where you define the actual mailgun credentials:
MAIL_DRIVER=mailgun
MAILGUN_DOMAIN=sandbox1e...60.mailgun.org
MAILGUN_SECRET=key-146...419