Drupal Configure SMTP Module to Work with Gmail [Updated]

At this point, there have been many great tutorials written about configuring Drupal’s SMTP Authentication Support with Gmail. However, these tutorials are out dated, and do not take into account Google’s added security settings. In this tutorial I’ll show you how to configure Drupal’s SMTP Authentication Support module and update Gmail’s security setting.

Install and Configure SMTP Module

  1. Install the SMTP Authentication Support module in the usual way.

    Click to expand

  2. Navigate to the configuration page admin/config/system/smtp
  3. Under Turn this module on or off select On. You can leave Send mail by queue and Retry sending mail on error deselected by default, but selecting them won’t affect Gmail.

    Click to expand

  4. Under SMTP server enter the following smtp.gmail.com. Leave SMTP backup server blank

    Click to expand

  5. Under SMTP port enter 587

    Click to expand

  6. Under Use encrypted protocol select Use TLS

    Click to expand

  7. Under SMTP AUTHENTICATION enter a Gmail address and password.

    Click to expand

  8. Under E-MAIL OPTIONS use the same Gmail address as you did above and enter an E-mail from name

    Click to expand

  9. Click Save

Update Gmail Account Settings

  1. Login to your Gmail account at https://myaccount.google.com/
  2. On the account homepage, click Sign-in & security or navigate to https://myaccount.google.com/security

    Click to expand

  3. Scroll down to the Allow less secure apps: widget, and have it enabled.

    Click to expand

  4. Now navigate to https://accounts.google.com/DisplayUnlockCaptcha and click Continue

    Click to expand

    Click to expand

  5. Go back to the SMTP configuration page at admin/config/system/smtp
  6. Enter an email address you would like to receive a test message from and click Save configuration

    Click to expand

  7. Check your inbox to confirm you received the test message.

    Click to expand