Install and configure SendGrid (Drupal 7)

December 4, 2018
SendGrid

Emails from websites tend to end up in spam boxes. This is getting a harder problem every day. It's very unpredictable and debugging is really hard. 

In come transactional email services: these services deliver emails with a specific API or SMTP. They also offer tracking of email delivery. 

There are many services on the market with such services. 

The most common providers on drupal.org: 

In this tutorial I will focus on SendGrid. SendGrid is one of the biggest transactional email providers; it's moderately priced and is a good choice for SMB's. 

Sending with the API or with SMTP? 

Most transactional email providers recommend sending through an API. Sending with an API is faster and scales better. Using SMTP on the other hand has the advantage of being more flexible. 

For example, when using Drupal, you could install the SMTP module (https://www.drupal.org/project/smtp) and switch between providers easily. When using an API: the setup is often tied to one provider. 

Installation and configuration of the SMTP-module on Drupal 7

Install the SMTP module and configure it with these settings: 

  • SMTP Server - smtp.sendgrid.net
  • SMTP Port - 587
  • Use Encrypted Protocol - No. If you want encryption choose "Use SSL" and set SMTP Port to 465
  • Username - SendGrid Username
  • Password - SendGrid Password

Source: https://sendgrid.com/docs/for-developers/sending-email/drupal/#using-the-smtp-authentication-support-module

Installation and configuration of the API on Drupal 7

Installation: 

Configuration: 

  • Enable the module. 
  • Go to /admin/config/services/sendgrid and enter the API Secret Key. 
  • Test if everything is working well under /admin/config/services/sendgrid/test by sending a test email message. 

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.