V
V
Vladimir2017-09-17 02:42:30
Yii
Vladimir, 2017-09-17 02:42:30

Not sending mail with SwiftMailer via ZohoMail, what's the error?

Hello!
There is an application on Yii2, on a test (local) server c Mail normally goes to runtime / mail On the working server, I use the service from Zoho as SMTP ( https://www.zoho.eu/mail/) The problem is as follows: The controller sends two letters one after the other (to the user and the manager), with the current settings, the first letter arrives, the second does not, and in debug I get a Swift_TransportException Expected response code 250 but got code "553", with message "553 Relaying disallowed as The config is as follows:useFileTransport' => true,

'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'useFileTransport' => false,
            'messageConfig' => [
                'charset' => 'UTF-8',
                'from' => '[email protected]'
            ],
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'host' => 'smtp.zoho.eu',
                'username' => '[email protected]',
                'password' => 'password',
                'port' => '465',
                'encryption' => 'ssl',
            ],
        ],

In the controller I have this:
//отправка письма юзеру
                Yii::$app->mailer->compose('order_user', ['session' => $session, 'order' => $order])
                        ->setFrom('info.domain.com'=>'Рога и Копыта'])
                        ->setTo($order->email)
                        ->setSubject('Заказ № '.$order->id.' на сайте Рога и Копыта')
                        ->send();
                
//отправка письма менеджеру
                 Yii::$app->mailer->compose('order_manager', ['session' => $session, 'order' => $order])
                        ->setFrom([$order->email => $order->name])
                        ->setTo('[email protected]')
                        ->setSubject('Новый заказ - № '.$order->id)
                        ->send();

I understand that the answer was 250, but received 553, but why? and why then the first letter goes fine and the second does not?
In which direction to dig?
If anything, then it all works on nginx + php-fpm
I will be glad for any tips, because I tried a lot of options and the skis no longer go.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-09-17
@webinar

Got an error? Paste it into the search, most likely you are not the first:
Yasha

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question