Drupal Atlanta Medium Publication: How to Configure the SMTP Module in Drupal 10 with Gmail, Since Google Removed Less Secure Apps

Starting on September 30, 2024, Google no longer allows you to enable the less secure apps. Learn how to add app-specific passwords for your Google Account.

Image removed.Sending Drupal 10 website Emails through Googles SMTP

To ensure your Drupal 10 website can send emails, like password reset links, you must configure the SMTP Module, especially after Google’s policy change on September 30, 2024, which prohibits the use of less secure apps. This guide will show you how to set up the SMTP Module in Drupal 10 for sending password reset emails and other form submissions via Gmail.

Before you begin, ensure you have the necessary tools. You will need Composer and Drush installed on your computer. Additionally, you must have access to a Gmail account and its password, which will be used to send the emails. Follow these steps to configure SMTP in Drupal 10, ensuring your site’s email functionality is uninterrupted by Google’s security updates.

Note: The instructions below are for a standard Gmail and have not been tested on a Google Workspace email address.

Download and Enable the Module

  • First, you must download and enable the module.
    - We are going to use composer to download and then a drush command to enable it. Or you could just enable the module in the
composer require 'drupal/smtp'

drush en smtp -y

Configure the SMTP Module in Drupal

  • Navigate to the configuration page admin/config/system/smtp
  • Under Turn this module on or off select On.
  • Under SMTP server enter the following smtp.gmail.com. Leave SMTP backup server blank
  • Under SMTP port enter 587
  • Under Use encrypted protocol select Use TLS
  • Under E-MAIL OPTIONS use the same Gmail address as you did above and enter an E-mail from name

Update Gmail Account Settings

Create App-Specific Password for GMAIL

Image removed.

How to Configure the SMTP Module in Drupal 10 with Gmail, Since Google Removed Less Secure Apps was originally published in Drupal Atlanta on Medium, where people are continuing the conversation by highlighting and responding to this story.

PubDate

Tags