Answer the question
In order to leave comments, you need to log in
Why is Yii2 swiftmailer not working?
Hello, I am making a website in yii2 (basic). Made mail for a domain on Yandex. Writes that the domain is connected.
Next, in the config/web.php file, I added the following:
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@app/mail',
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'ssl://smtp.yandex.ru',
'username' => '[email protected]',
'password' => 'moiparol',
'port' => 465,
],
'useFileTransport' => false,
],
Yii::$app->mailer->compose()
->setFrom('[email protected]')
->setTo('[email protected]')
->setSubject('Тема письма')
->setTextBody('Текст')
->send();
Connection could not be established with host ssl://smtp.yandex.ru [ #0]
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