Answer the question
In order to leave comments, you need to log in
Why does gmail put emails sent via yii\swiftmailer\Mailer in the Spam folder?
In config:
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'useFileTransport' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'mail.site.online',
'username' => '[email protected]',
'password' => 'passwd_here',
'port' => '587',
'encryption' => 'tls',
'streamOptions' => [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
],
],
],
],
$mail_template = 'email_ru';
Yii::$app->mailer->compose($mail_template, ['param' => 'value'])
->setFrom('[email protected]')
->setReplyTo('[email protected]')
->setTo('[email protected]')
->setSubject(Yii::t('app','Регистрация на сайте Site.online'))
->send();
Answer the question
In order to leave comments, you need to log in
First of all, gmail pays attention to the correct SPF record. The combination of HELO + rDNS is also very critical.
In general, it is best to test through https://www.mail-tester.com/ where all the "jambs" will come out. True, he poorly evaluates if rDNS or HELO is not registered and rDNS does not match, for good in these cases it is necessary to give -5
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question