How to Configure SMTP in Drupal 8

Updated on Mar 13, 2019

Configuring your Drupal 8 mail service via SMTP can improve user experience as the emails send from your website (verification emails, newsletters, etc.) will certainly be delivered and not marked as spam.

To send mails via SMTP in Drupal 8, you will need to:

step

Create an Email Account

To create a new email account, you will need to navigate to cPanel -> Email Accounts.

Accessing the Email Accounts section of cPanel

Enter the following information:

Creating a new Email Account

  • Email - The name for your new email address
  • Password - The password for your new email account
step

Download and Install the SMTP Module

The most used SMTP module for Drupal can be found here. At the time of writing this tutorial, the 8.x version is still not fully adopted and thus is not listed under the Recommended releases section.

Downloading version 8 of the SMTP module

Click on the .tar.gz or .zip download links to download the package or just copy the link from the newly opened window (ex. http://ftp.drupal.org/files/projects/smtp-8.x-1.x-dev.zip)

Now login to your Drupal 8's admin account and access the Manage -> Extend section.

Accessing the Extend menu in Drupal 8

Click on the Install new module button.

Installing a new module in Drupal 8

Here you will be able to either use the URL you have copied to the module or upload the archive file itself from your local computer.

Installing the new module

step

Configure the SMTP Module

Now return to the Extend menu, find the SMTP Authentication Support module located in the MAIL section and click on the Configure option.

Configuring the SMTP module

The first option will be to enable the module. Click the On radio button to turn the module on.

"Turning

Next are the SMTP Server Settings:

  • SMTP server - The address for your outgoing SMTP server which is mail.emailaddress
  • SMTP backup server - If you have a second SMTP server for this email, fill this field
  • SMTP port - The port on which the SMTP service will be established. Use 25 or 2525 for non encrypted and 465 for encrypted connection.
  • Use encrypted protocol - If you want to use SSL encryption set this to yes and use the appropriate port specified above

Configuring the SMTP Server Settings

For the SMTP Authentication fields, use your email address username and password.

Filling the SMTP Authentication fields

In the E-mail Options field you will be able to configure the From field of your email and the email address that will be shown to the recipient. You can also enable HTML formatting in emails.

Configuring the E-mail options in Drupal 8

The last field is for testing purposes. If you wish to send yourself a test email, type here the email on which you want to receive it. Check the Enable debugging option to see any possible issues with the emails you send.

Sending a test email and completing the setup of SMTP

Click on the Save configuration button to save and apply the changes you just did.

Congratulations, you can now send emails from your Drupal 8 based website without worrying they will not be received.

On this page...

    Drupal 8 Hosting

    • Free Drupal 8 Installation
    • 24/7 Drupal 8 Support
    • Free Domain for life
    • Hack-free Protection
    • Fast SSD Storage
    • Free Drupal Transfer
    • Free CloudFlare CDN
    • Immediate Activation
    View More