Here is my code:
$mail_object = Mail::factory('smtp', $params);
$send = $mail_object->send($email, $headers, $body);
if (PEAR::isError($send)) {
$error_message = $send->getMessage();
So, when there is an error, I get the error message. But I need the response from the SMTP server on success. The success message is usually something like "250 ok queued as xxx". I need to see this message. Is there a way?
The SMTP driver writes this number in the "queued_as" property:
https://github.com/pear/Mail/blob/master/Mail/smtp.php#L350
You can access this property on your
$mail_objectafter sending.