CakePHP 3 - How to check whether an Email has been delivered successfully?

Viewed 1116

i am trying to sending mail using cakephp 3.0 . My code is :

Email::configTransport('WebMail',[
'className' => 'Smtp',
'host' => $host,
'port' => $port,
'timeout' => 30,
'username' => $username,
'password' => $password,
'client' => null,
'tls' => null]
);
$transport = ['transport' => 'WebMail'];
$email = new Email($transport);
$email
->from([$username => $senderName])
->to($email_to)
->subject('Password Reset Code');
$response = $email->send('hello');

its working fine but the problem is how to check if the email was delivered successfully or not to the recipient. if I debug $response variable I got the array of all mail related data. Now how can I check if the email was delivered or not .

3 Answers
Related