How to check if email was sent successfully in CakePHP?
I can send letters without problems, but I want to be able to handle this error if it is not sent. How can i do this?
This is what I have done so far:
$email = new CakeEmail();
$email->from(array('email' => 'title'));
$email->to($to);
$email->subject('Account activation');
$activate_url = 'http://' . env('SERVER_NAME') .'/cakephp/users/activate/'.$id.'/'.$token;
$message = "Thank you for signing up. Click on the activation link to activate your account \n";
return $email->send($message.$activate_url);
source
share