After setting up my Drupal 8 site in the server, I noticed that none of the emails go to the inbox in Gmail and it all gets stored in Spam. Upon further investigation I found that this is because the emails are being sent via the PHP Mailer and its not being signed and authenticated.

I'm not that familiar with Drupal programming, therefore any suggestions and instructions on how I can get this configured via code/modules etc would be greatly appreciated.

  • 3
    DMARC is part of your DNS configuration, Drupal does not affect that. DKIM is part of your mailserver configuration, Drupal cannot affect that either. What you can do is make sure that all Drupal's mails are send/redirected via a properly configured mailserver by using one of the modules below. Commented May 6, 2018 at 19:32

1 Answer 1


Please check out the following two modules to have your Drupal mails send by a mailserver. Apart from that it may already be sufficient to just set a SPF record for your domain as DKIM and DMARC has actually nothing to do with Drupal.



Adds SMTP support for sending e-mails using the PHPMailer library. Comes with detailed configuration instructions for how to use Google Mail as mail server.

SMTP Authentication Support


This module allows Drupal to bypass the PHP mail() function and send email directly to an SMTP server. The module supports SMTP authentication and can even connect to servers using SSL if supported by PHP.

How To use an SPF Record to Prevent Spoofing & Improve E-mail Reliability


A carefully tailored SPF record will reduce the likelihood of your domain name getting fraudulently spoofed and keep your messages from getting flagged as spam before they reach your recipients.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.