tribungbu tribungbu - 10 months ago 181
PHP Question

Using mailgun on laravel 5.2 - failed to authenticate my sandbox account

I'm using Laravel 5.2 that has mailgun integrated. Was trying to send out email via SMTP but couldn't succeed because of the error:

Failed to authenticate on SMTP server with username
"" using
3 possible authenticators

I'm developing the app on my localhost with virtual host set up (i.e.
) so I have to use the sandbox account to do all the testing.

These are the laravel's

'driver' => env('MAIL_DRIVER', 'mailgun'),
'host' => env('MAIL_HOST', ''),
'port' => env('MAIL_PORT', 587),
'from' => ['address' => null, 'name' => null],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => '',
'password' => 'mypassword'

's configurations

'mailgun' => [
'domain' => '',
'secret' => 'key-63sztbx99h-qdhp7j3-gp6346jsxxxx',

Everything looks good as I copied directly from my mailgun dashboard for the sandbox account, but the app still can't send out email due to failed authentication.

Does anybody know what is happening here?


Try with post 2525 maybe? You can edit it in the config/mail.php file where 587 is currently or through setting it in your .env file: