N
N
naonma2018-07-19 14:35:56
gmail
naonma, 2018-07-19 14:35:56

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);

What could be the problem? If the code would not work, then the messages would not leave at all, and so it comes to mail.ru.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-07-21
@dimonchik2013

send
From: [email protected]
via
'smtp.gmail.com', it's
not
at all strange that it allows you to send at least somewhere, rather, you are not saying something

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question