Drupal8 letters fall into the spam. How to fight?

Send e-mails using the SwiftMailer module, but some users emails end up in spam, for instance, those who are registered on gmail.com.

Letters sent this:

$mailManager = \Drupal::service('plugin.manager.mail');
$result = $mailManager->mail($module, $key, $to, $langcode, $params, NULL, $send)
and are formed via hook_mail
June 10th 19 at 14:46
2 answers
June 10th 19 at 14:48
Try to send via SMTP.
If you are already, check whether correctly configured spf, dkim, dmarc.
Everything seems correct... - alanis.Considine commented on June 10th 19 at 14:51
June 10th 19 at 14:50
Use your mail server. Moved me to the Adjuster, but it looks like it is unfinished...

Test results:

MIME_HTML_ONLY Message only has text/html MIME parts
You need to add a text version of the email (text/plain)

RDNS_NONE Delivered to internal network by a host with no rDNS
Maybe it's a false alarm, but please check the reverse DNS zone

[SPF] does not allow Your server to use

[Sender ID] does not allow Your server to use

Your message is not DKIM signed

We did not find the mail server (a-record) on the host - alanis.Considine commented on June 10th 19 at 14:53
DKIM I managed to add, but faced with such a problem

Your DKIM signature is not valid
DomainKeys Identified Mail (DKIM) is a method of creating a matching domain name in the email message, allowing a person, role, or organization to claim some responsibility for that message.
The DKIM signature of Your letter:


We were not able to obtain Your public key.

Where to dig?.. - alanis.Considine commented on June 10th 19 at 14:56

Find more questions by tags DrupalE-mail