R
R
Ruslan Tilyaev2019-05-02 16:32:10
Yii
Ruslan Tilyaev, 2019-05-02 16:32:10

How to check for sending a message to email?

If a person enters a non-existent email in the field, then an error occurs:
Expected 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
"
Model:

public function sendEmail($email)
    {
        return Yii::$app->mailer->compose('resume', ['user' => $this])
            ->setTo($this->email)
            ->setFrom("[email protected]")
            ->setSubject($this->surname ." " .$this->name . ", вы зарегистрировали свою анкету.")
            ->setTextBody("Ваш ID Анкеты: " . $this->id_cart)
            ->send();
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question