Answer the question
In order to leave comments, you need to log in
Yii2 outputting errors when sending messages?
Hello! Tell me how you can display "feedback" when sending a message. For example, the message was sent, the email address does not exist, or other errors from the server?
Faced with such a problem. When sent via:
Yii::$app->mailer->compose([
'text' => 'views/appointment/' . $_view . '-text',
], $jugle_data)->setTo([$_email => $Appointment->profile->name])
->setSubject($judge_subject)
->send();
, caught an E-mail that does not exist. The script gives the following errorExpected response code 250 but got code "550", with message "550 Message was not accepted -- invalid mailbox. Local mailbox [email protected] is unavailable: user not found
"
//Пробуем (try) что-либо сделать.
try{
}
//Перехватываем (catch) исключение, если что-то идет не так.
catch (Exception $ex) {
//Выводим сообщение об исключении.
echo $ex->getMessage();
}
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