Задать вопрос

Как правильно настраивать symfony/mailer?

Коллеги, здравствуйте!

Пытаюсь заюзать Sending Emails with Mailer
Всё что нужно настроить, настроил.

Единственное что не могу понять как правильно настроить Transport

Написано

Emails are delivered via a "transport". And without installing anything else, you can deliver emails over smtp by configuring your .env file:


Вопрос к этой строке, могу ли я указать здесь например логин и пароль от почтового сервиса yandex?
# .env
MAILER_DSN=smtp://user:pass@smtp.example.com


Я побывал настраивать следующим образом

# .env
MAILER_DSN=smtp://login:pass@smtp.yandex.ru


Пытаясь выполнить отправку

docker exec -ti cc.app php bin/secure messenger:consume -vv


Масса ошибок
PS D:\OpenServer\OSPanel\domains\сhinese-catalog> docker exec -ti cc.app php bin/secure messenger:consume -vv


 [OK] Consuming messages from transports "async".


 // The worker will automatically exit once it has received a stop signal via the messenger:stop-workers command.

 // Quit the worker with CONTROL-C.

2019-11-15T21:05:55+00:00 [info] Received message Symfony\Component\Mailer\Messenger\SendEmailMessage
2019-11-15T21:05:55+00:00 [error] Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Dispatching for retry #1 using 1000 ms delay. Error: "Expected response code "250" but got an empty response."
2019-11-15T21:05:55+00:00 [info] Sending message Symfony\Component\Mailer\Messenger\SendEmailMessage with Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport
2019-11-15T21:05:56+00:00 [info] Received message Symfony\Component\Mailer\Messenger\SendEmailMessage
2019-11-15T21:05:56+00:00 [error] Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Dispatching for retry #3 using 4000 ms delay. Error: "Expected response code "250" but got an empty response."
2019-11-15T21:05:56+00:00 [info] Sending message Symfony\Component\Mailer\Messenger\SendEmailMessage with Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport
2019-11-15T21:05:57+00:00 [info] Received message Symfony\Component\Mailer\Messenger\SendEmailMessage
2019-11-15T21:05:57+00:00 [error] Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Dispatching for retry #1 using 1000 ms delay. Error: "Expected response code "250" but got an empty response."
2019-11-15T21:05:57+00:00 [info] Sending message Symfony\Component\Mailer\Messenger\SendEmailMessage with Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport
2019-11-15T21:05:57+00:00 [info] Received message Symfony\Component\Mailer\Messenger\SendEmailMessage
2019-11-15T21:05:57+00:00 [error] Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Dispatching for retry #2 using 2000 ms delay. Error: "Connection to "tcp://smtp.yandex.ru:25" has been closed unexpectedly."
2019-11-15T21:05:57+00:00 [info] Sending message Symfony\Component\Mailer\Messenger\SendEmailMessage with Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport
2019-11-15T21:05:58+00:00 [info] Received message Symfony\Component\Mailer\Messenger\SendEmailMessage
2019-11-15T21:05:58+00:00 [error] Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Dispatching for retry #2 using 2000 ms delay. Error: "Expected response code "250" but got an empty response."
2019-11-15T21:05:58+00:00 [info] Sending message Symfony\Component\Mailer\Messenger\SendEmailMessage with Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport
2019-11-15T21:05:59+00:00 [info] Received message Symfony\Component\Mailer\Messenger\SendEmailMessage
2019-11-15T21:06:00+00:00 [error] Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Dispatching for retry #3 using 4000 ms delay. Error: "Expected response code "250" but got an empty response."
2019-11-15T21:06:00+00:00 [info] Sending message Symfony\Component\Mailer\Messenger\SendEmailMessage with Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport
2019-11-15T21:06:00+00:00 [info] Received message Symfony\Component\Mailer\Messenger\SendEmailMessage
2019-11-15T21:06:01+00:00 [critical] Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Removing from transport after 3 retries. Error: "Expected response code "250" but got an empty response."
2019-11-15T21:06:01+00:00 [info] Received message Symfony\Component\Mailer\Messenger\SendEmailMessage
2019-11-15T21:06:01+00:00 [error] Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Dispatching for retry #3 using 4000 ms delay. Error: "Expected response code "250" but got an empty response."
2019-11-15T21:06:01+00:00 [info] Sending message Symfony\Component\Mailer\Messenger\SendEmailMessage with Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport


Как правильно конфигурировать?
# .env
MAILER_DSN=smtp://login:pass@smtp.yandex.ru
  • Вопрос задан
  • 1920 просмотров
Подписаться 2 Средний 2 комментария
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы