Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to authenticate on SMTP server with username "apikey"

i am getting this error when i try to send mails via sendgrid in laravel 6:

Failed to authenticate on SMTP server with username "apikey" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 250

my .env:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=apikey
MAIL_PASSWORD=***** (my key copied from sendgrid)
MAIL_ENCRYPTION=tls
like image 762
shape Avatar asked Oct 15 '22 09:10

shape


1 Answers

I had this same problem and I solved it by encoding the APIKEY in Base64.

Here's a little more help: https://sendgrid.com/docs/API_Reference/SMTP_API/getting_started_smtp.html#-Sending-a-test-SMTP-email-with-Telnet

like image 76
Ever CR Avatar answered Nov 16 '22 13:11

Ever CR