Reputation: 472
I am using sendgrid for sending mail in laravel it work perfectly on my local and one aws ec2 instance.But it fail to send mail on another ec2 instance.I tried all the port like 2525,25,2587,587 using tls encryption.But nothing work for me.It give the following error
Failed to authenticate on SMTP server with username "apikey" using 2 possible authenticators
Upvotes: 1
Views: 4562
Reputation: 400
if your issue occurred in server that using https, you should change MAIL_DRIVER to mail
and MAIL_PORT to 465
MAIL_DRIVER=mail
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=465
MAIL_USERNAME=yourusername
MAIL_PASSWORD=yourpassword
and on your config/mail.php
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
change to
encryption' => 'ssl',
that's work for me.
Upvotes: 2