Предположим, я отправляю письмо на адрес sample@mail. ком. Мой сервер отправляет его без ошибок, но позже я получаю вот такое письмо:
Код: Выделить всё
FROM: mailer-daemon@googlemail.com
Delivery Status Notification (Failure)
Address not found
The response from the remote server was:
550 Requested action not taken: mailbox unavailable For explanation visit https://postmaster.mail.com/en/case?c=r1601&i=ip&v=209.85.218.44&r=0MMkTR-1tRvZc35wN-008XeL
Мой код для отправки выглядит следующим образом:
Мой код для отправки выглядит следующим образом:
п>
Код: Выделить всё
$this->mail = new PHPMailer(true); // exceptions enabled
$this->mail->isSMTP();
$this->mail->SMTPAuth = true;
$this->mail->SMTPSecure = 'tls';
$this->mail->Host = env('mail.host'); // smtp.gmail.com
$this->mail->Port = env('mail.port'); // 587
$this->mail->CharSet = 'UTF-8';
$this->mail->Username = env('mail.user');
$this->mail->Password = env('mail.pass');
$this->mail->setFrom(env('mail.from'), env('mail.from.username'));
$this->mail->addAddress($recipient);
$this->mail->isHTML(true);
$this->mail->Subject = $subject;
$this->mail->Body = $body;
if(!$this->mail->send()) {
throw new MailException($this->mail->ErrorInfo); // custom exception that I handle later
}
До этого момента я ценю любую помощь.
Подробнее здесь: https://stackoverflow.com/questions/793 ... -not-exist