

Send Email with Laravel and SendGrid
source link: https://www.laravelcode.com/post/send-email-with-laravel-and-sendgrid
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Send Email with Laravel and SendGrid
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.
MAIL_MAILER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=465
MAIL_USERNAME=apikey
MAIL_PASSWORD=SG.YPAMv...........V_1yoO78
MAIL_ENCRYPTION=ssl
MAIL_FROM_NAME="HackTheStuff"
MAIL_FROM_ADDRESS=hackthestuffinfo.com
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.
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.

Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
Recommend
-
34
When your application sends emails it is useful to know what happens to those emails, like whether it has been delivered or...
-
7
Create a Mailing List in PHP using Laravel, Vue.js, and Twilio's SendGrid Email API
-
8
To use SendGrid in NestJS project, we simply use official mailer module from NestJS (https://github.com/nest-modules/mailer). Then setup the mailer
-
6
Send Emails using the SendGrid API with .NET 6 and C#
-
9
How to send Email in C# .NET using SMTP and SendGrid
-
8
This blog post was written for Twilio and originally published at the Twilio blog.
-
9
How to send Emails in C# .NET with FluentEmail, Razor, and SendGrid
-
5
Send Recurring Emails using C# .NET and Hangfire with SendGrid
-
7
-
2
Introduction As a Python developer I want to stay up2date with trends and useful tips & tricks. Of course there are great newsletters like Pycoders, but those are already h...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK