Is there a way to check which system was used to send mail?

I followed Sending html mails in Drupal 8/9 programmatically. I'm using the SMTP module to make sure that emails are sent via SMTP instead of using the PHP mailer. Emails sent via my website seem to have a higher spam score than when the ones sent directly from my SMTP server. I wonder whether my mails are being sent via SMTP or not.

Is there a method to check this?

1 Answer 1


A way to check is using Gmail.

Sometimes it's obvious:

enter image description here

But most aren't, so you can click on the 3 dots and select show original

enter image description here

Here, for example, you can see this other one was sent using Zoho Mail's SMTP

enter image description here

By the way, I was also seeing emails sometimes land in the spam box using SMTP. Once I setup SPF, DKIM, and DMARC for my domain, I've never seen them land in spam again.

There are three main types of authentication used to prove to mailbox providers that your email is worth being placed in the inbox:

SPF (Sender Policy Framework) is an IP address-based authentication method used to compare the sender’s IP indicated in the domain’s DNS record with a list of IPs authorized to send from that domain.

DKIM (Domain Keys Identified Mail) is a method for validating domains through a publicly available cryptographic signature. This signature is verified on the receiving end using the DNS record.

DMARC (Domain-based Message Authentication, Reporting, and Conformance) is a protocol aimed at reducing email phishing and spoofing. It allows a sender to specify that their email is properly authenticated using DKIM and SPF records.

Senders who authenticate their messages with all three methods may see less filtering and fewer emails going to spam.

source: How to Prevent Emails from Going to Spam: The Ultimate Guide

  • Ah I see, showing the original shows me the following: Using PHPMailer 6.5.4 so I guess the SMTP module is not used. How can I force my code to use the SMTP module?
    – Joost
    Mar 21, 2022 at 10:53
  • @Joost install the Mail System module and in its configuration /admin/config/system/mailsystem for "sender" select SMTP.
    – No Sssweat
    Mar 21, 2022 at 19:09
  • I'm using mailsystem and just changed everything to SMTP. In the top it still says: From: # Using PHPMailer 6.6.0 (https://github.com/PHPMailer/PHPMailer) But in the code part you are mentioning it says: Received: from # by mx.google.com with SMTP So I think it works? Right? I tried sending via Google Workspace.
    – Joost
    Mar 22, 2022 at 7:54

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.