1

How do I check if the email is RECEIVED by the recipient? In Laravel 5, I try using this method from this question:

$status = Mail::send('blah', $data, function($message) {
    // callback function
});

if($status) {
   // email is successfully sent
}
else {
   // email is not sent
}

But even if the email is invalid, I still got $status = 1 after the code execution. I also have tried Mail::failures() which contain an array of failed attempt. But it always return 0, which mean all email is succesfully sent.

Is there any other way that I can check whether in Laravel?

OR

is it possible to check if the email is valid using PHP? Since the email is invalid, there is no point to send it.

Community
  • 1
  • 1
Hussaini
  • 415
  • 2
  • 5
  • 12
  • You cannot check if the actual mail is received by the recipient by my knowlegde with Laravel mailer. You can however check if the email was sent from your server or not, check this out http://stackoverflow.com/questions/24772531/laravel-mail-sending-email-but-returning-false Laravel uses SwiftMailer to send mail, you can read up on more functions on the SwiftMailer class here http://swiftmailer.org/ – oBo Jun 26 '15 at 07:34

1 Answers1

1

To check if someone has received put this in the header:

 Disposition-Notification-To:<xxx.xxx@example.com>

But this option is not very reliable it is better to check if your email was read like so:

<img src="http://yourdomain.com/received?read=<email of `receiver>">

This method also does not always work. For example if the Email client doesn't download the images automatically.

I hope this helped anyway and was what you were searching for.

иikolai
  • 175
  • 1
  • 8