When I want to send a email with command in terminal I get Swift_TransportException:
Expected response code 220 but got an empty response in AbstractSmtpTransport.php:445
I've created SendEmailController class in commands dir and method in that class:
public function actionSend() {
Yii::$app->mailer->compose()->setFrom('[email protected]')
->setTo('[email protected]')
->setSubject('Test Subject from command')
->setTextBody('Test Body')
->send();
}
I have the same method in the SiteController and when I call over the url, it works. What's the difference between command and url in this case? Did anyone have the same problem? Thanks !