The free Gmail SMTP server

Feb 15, 2021

In this tutorial, I'm going to show you how to configure the Gmail SMTP server with Laravel. Usually, when you want to send emails you have to pay for some service. But using the Gmail server you can do it for free!

Configuring Laravel

In your Laravel .env file, add these values:

MAIL_MAILER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_USERNAME=john@gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=john@example.org
MAIL_FROM_NAME="${APP_NAME}"

Be sure to add your full Gmail email address in the MAIL_USERNAME section, like john@gmail.com. Next, add your password in the MAIL_PASSWORD section.

When you start sending emails you'll probably get an email from Google where you have to confirm you want to use it.

That's it! Now you can send unlimited free emails using the Gmail SMTP server.

Note: using the Gmail SMTP server, you are limited to 100 emails per day.


Leave a comment


Comments

  • olragon 4 days ago

    With Gmail SMTP, you are limited to 100 emails/day. https://support.google.com/a/answer/166852?hl=en

  • Jeroen van Rensen 4 days ago

    Thanks for letting me know. However, I still think this is useful for others to know.

  • Rui Costa 14 hours ago

    You can use sendinblue.com The free account has a limit of 300 emails per day. 3 times better than gmail.