I am using PHPMailer to connect to a remote smtp server running Exim. In my exim logs, I can see that the sending failed, but PHPMailer does not catch an exception and it seems like the SMTP server is returning an "Ok" status.
Here is the excerpt from my exim log:
2019-06-27 17:03:00 1hgbXj-0000O5-Vl == *******@gmail.com R=dnslookup T=remote_smtp defer (-44) H=alt4.gmail-smtp-in.l.google.com [108.177.119.27]: SMTP error from remote mail server after RCPT TO:<********@gmail.com>: 452-4.2.2 The email account that you tried to reach is over quota. Please direct\n452-4.2.2 the recipient to\n452 4.2.2 https://support.google.com/mail/?p=OverQuotaTemp **** - gsmtp
And here is the (end of the) PHPMailer debug output:
SERVER -> CLIENT: 250 OK id=1hgbf8-0008CL-15
CLIENT -> SERVER: RSET
SERVER -> CLIENT: 250 Reset OK
Done @0.0734977722168s
CLIENT -> SERVER: QUIT
Any way I can see this error in PHP so that I can log the error in my application?