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.
5a36cbaf8b238964792011.png5a36cbb2f11d3651909096.png
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:

v=1;
a=rsa-sha256;
q=dns/txt;
c=relaxed/relaxed;
d=mysite.com;
s=dkim;
h=Content-Transfer-Encoding:Content-Type:MIME-Version:To:From:Subject:Date:Message-ID:Sender:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
bh=IHvEREZh5+65s9WlWHQ5Oh+vpCudqrTUny0d3p6NZII=;
b=VAIxJry6EE8xYfuFxI7Fr85+CdTx2gDBs5YuXsVKoWuraf2WlCZnoL1Wsxza2ccybyp2nqlievpqf5ebmuwocr0no27h2xfnscu8hb9gsr4krirvxqtfedkumq5e0cdjxthhycl0ryfxpgh8tucfuhud6jei7r4/6OIWyBglktk=;

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