dimanche 15 septembre 2019

Can't detect result when send mail with hotmail?

I using hotmail and send mail from laravel 5.8:

            Mail::send([], [], function($message) use ($mailto, $mailtitle, $body, $pathToFile) {
                $message->from(env('MAIL_USERNAME'), env('MAIL_FROM_NAME'));
                $message->subject($mailtitle);

                if ($pathToFile != "")
                    $message->attach($pathToFile);
                $message->setBody($body, 'text/html');
                $message->to(explode(",", $mailto));
            });              
            // check for failures
            if (Mail::failures()) {
                $return["status"] = "NG";
                 $return["error"] = "Can't send mail.";
        }

I had attach a file txt has content (test file is virus):

X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

Mail can't send, but it not show any message.

How can detect the result of send mail by Hotmail?

With Gmail it will occur a exception.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire