Answer the question
In order to leave comments, you need to log in
Why doesn't swiftmailer send emails to gmail mailboxes?
Good day!
I'm trying to send letters to various mailboxes (mail.ru and gmail.com). Everything comes to mail.ru, but not to gmail.com. I looked at the examples on the site, it still does not come to gmail.
$transporter = Swift_SmtpTransport::newInstance('smtp.gmail.com', 587, 'tls')
->setAuthMode('login')
->setUsername('логин')
->setPassword('пароль');
$mailer = Swift_Mailer::newInstance($transporter);
$message = (new Swift_Message($subject))
->setFrom($from)
->setTo($to)
>setBody($body, $type);
$result = $mailer->send($message);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question