How to configure Sendgrid SMTP in Laravel

Recently while working on Laravel mail functionalities, I have got some issues in sending email over SMTP server. I was using Sendgrid mail server to send email. I have done the same configuration as I have already done in my one of old project. You have already seen that doing same configuration on different projects sometimes not work. Same was happened with me.

So I have dig deep into that. While checking its official Laravel documentation, I have seen in the .env file, MAIL_USERNAME and MAIL_PASSWORD was changed to API Key. Before that, it was working with only your Sendgrid username and password.

So what is changed?

While login to Sendgrid account, first in the API Key menu under Settings section, create the API key and copy.

Now your Laravel .env file, change MAIL_USERNAME=apikey and MAIL_PASSWORD=<API Key>. This is full Mail configuration in your .env file.


If your website is not ssl certified, use MAIL_PORT=587 and MAIL_ENCRYPTION=tls.

You may have got error if you have not verified sender authenticate.

Expected response code 250 but got code "550", with message "550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit to see the Sender Identity requirements

To authenticate your sender authenticate, go to Sender Authenticate menu under the Settings section. Use Domain Authentication or Single Sender Verification option to verify.

The error sould have resolved now.