Drupal Configure SMTP Module to Work with Gmail [Updated]

Posted on March 21, 2016 - 3 Minute Read

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.

Screen Shot 2016 03 20 at 7 58 57 AM

  1. Navigate to the configuration page admin/config/system/smtp
  2. 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.

Screen Shot 2016 03 20 at 8 01 57 AM

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

Screen Shot 2016 03 20 at 8 06 44 AM

  1. Under SMTP port enter 587

Screen Shot 2016 03 20 at 8 06 51 AM

  1. Under Use encrypted protocol select Use TLS

Screen Shot 2016 03 20 at 8 06 57 AM

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

Screen Shot 2016 03 21 at 7 39 48 AM

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

Screen Shot 2016 03 21 at 7 40 29 AM

  1. 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

Screen Shot 2016 03 21 at 7 48 41 AM

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

Screen Shot 2016 03 21 at 7 51 35 AM

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

Screen Shot 2016 03 21 at 7 53 40 AM

Screen Shot 2016 03 21 at 7 53 47 AM

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

Screen Shot 2016 03 21 at 7 55 17 AM

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

Screen Shot 2016 03 21 at 7 55 55 AM

Categorized In:Tagged In: