Laravel 5 - check if mail is send

2019-05-21 14:01发布

Is there a way to be a 100% sure that the email you want to send is actually delivered (I'm not talking about an email address that doesn't exist)?

Can you do an extra check? I'm working in Larevel 5.0.

3条回答
Lonely孤独者°
2楼-- · 2019-05-21 14:18

Are you checking Mail::failures() ?

查看更多
何必那么认真
3楼-- · 2019-05-21 14:21

If you want 100% certainty, you should use a third party API such as mailgun. Laravel supports them out of the box, and they offer in-depth tracking.

查看更多
孤傲高冷的网名
4楼-- · 2019-05-21 14:28
Mail::send(...)

And Error Reporting is

if( count(Mail::failures()) > 0 ) {

   foreach(Mail::failures as $email_address) {
       echo "$email_address <br />";
    }

} else {
    echo "Mail sent successfully!";
}
查看更多
登录 后发表回答