generaldrupal

Configure SMTP for outbound emails

Drupal 8

Install and configure the SMTP Authentication Support module for Drupal 8, as follows:

  • Download the SMTP Authentication Support module for Drupal to your Drupal installation’s modules directory and unzip.

  • Log in to the Drupal 8 administration panel.

  • Navigate to the “Extend” tab and enable “SMTP Authentication Support”.

  • Navigate to the “Configuration” tab, scroll down to the “SMTP Authentication Support” section and select it.

  • On the resulting page, turn the module “On” and enter the SMTP configuration options. For example, if using a Gmail account, replace USERNAME and PASSWORD with your Gmail account username and password respectively.

      SMTP Server - smtp.gmail.com
      SMTP backup server - leave blank
      SMTP port - 465
      Use encrypted protocol - Use SSL
      Username - USERNAME@gmail.com
      Password - PASSWORD
      Email from address - USERNAME@gmail.com
      E-mail from name - the name you want emails to appear to be from (e.g. 'Yourdomain Support' or your real name)
    
  • Enter a test email address.

  • Click “Save configuration” to save your changes and send a test email.

To configure the application to use other third-party SMTP services for outgoing email, such as SendGrid, refer to the FAQ.

NOTE: If you are using Gmail as the outbound email server, your application’s attempts to send outgoing emails may be blocked by Gmail if it considers the authentication attempts to be suspicious. When this happens, you will receive a Gmail security alert at the corresponding Gmail address. To proceed, you will need to manually confirm the validity of the authentication attempt before Gmail will permit the application to send outbound emails. For more information on this and other Gmail issues related to outbound email from your application, refer to our Gmail SMTP troubleshooting page.

Drupal 7 and earlier

Install and configure the SMTP Authentication Support module for Drupal 7, as follows:

  • Download the SMTP Authentication Support module for Drupal to your Drupal installation’s sites/all/modules directory and extract. Previous Drupal versions have the module already installed in the modules/ directory.

  • The PHPMailer package is included in Drupal 7. For older versions, follow these additional steps:

    • Create a phpmailer/ directory in the new sites/all/modules/smtp directory.

    • Download the PHPmailer package from Github and extract it to the sites/all/modules/smtp/phpmailer directory.

  • Log in to the Drupal 7 administration panel.

  • Go to the “Administer -> Site Building -> Modules” section and enable “SMTP Authentication Support”.

  • Now go to the “Administer by Module” tab, scroll down to the “SMTP Authentication Support” section and click the “SMTP Authentication Support” option.

  • Enter the following configuration options. For example, if using a Gmail account, replace USERNAME and PASSWORD with your Gmail account username and password respectively.

      SMTP Server - smtp.gmail.com
      SMTP backup server - leave blank
      SMTP port - 465
      Use encrypted protocol - Use SSL
      Username - USERNAME@gmail.com
      Password - PASSWORD
      Email from address - USERNAME@gmail.com
      E-mail from name - the name you want emails to appear to be from (e.g. 'Yourdomain Support' or your real name)
    
  • Send a test email.

Last modification July 3, 2024