How to Configure SMTP Module to Send Emails From Your Drupal Website?

| | 2 min read

SMTP, which stands for Simple Mail Transfer Protocol, is the standard email protocol used for sending email messages. Mail systems like AWS Simple Email Service (SES), Mandril etc allow sending emails using SMTP. If you are using Drupal and want to use external email systems that support SMTP to sent emails, SMTP module is your best friend there. In this tutorial we will be covering step by step instructions on how to install and configure SMTP module for Drupal.

Installation

The recommended way to install the SMTP Module is via composer.

composer require 'drupal/smtp'

 

 

Configuration

After you install and enable the SMTP module, access the configuration page /admin/config/system/smtp.

Install Options

SMTP Install options

Put this on if you want to enable SMTP email support.

SMTP Server Settings

SMTP server settings

Input the SMTP details provided by your email provider. Eg. For AWS SES, here is a documentation on how to obtain the SMTP server details

 

 

SMTP Authentication

SMTP authentication

The SMTP credentials from your email service provider. Please note that, if you have already input the password and save this form before, even if the field is empty, you do not have to input password again, unless you want to change its value.

Email Configuation

Email Configuration

The "From" email address and "Name" that should be used for outgoing emails. If you want HTML email, the checkbox to allow to send emails formatted as HTML should be checked.

SMTP Client Settings

SMTP Client Settings

You can fill these fields if you want to set these to anything other than your default host host name. You can safely keep this blank if you are not sure.

Testing and Debugging

Testing and Debugging SMTP

You can input an email address to sent a test email. The debug checkbox, if checked will log SMTP messages for debugging. You can read the logs from the default location - /admin/reports/dblog

If you are using a local development machine where you do not have access to an SMTP service, you can use MailHog to test email functionalities.

Reference

https://www.drupal.org/project/smtp

 

 

Zyxware is a leading Drupal development company with a team of high expertise in Drupal custom module development services since 2006.