【发布时间】:2016-04-19 10:48:01
【问题描述】:
我正在使用 PHPMailer;
$oPM->SMTPDebug = 2;
$oPM->Debugoutput = 'html';
if ( !$oPM->send() ) echo "Mailer Error: " . $oPM->ErrorInfo;
else echo "Message sent!";
$oPM->Send() 运行后,无论成功/失败,我都想接收 SMTP 状态代码。
使用SMTPDebug 选项,我可以让它返回一个字符串,如下所示;
MAIL FROM command failed: 500 5.0.0 Envelope From Address of...
我可以从字符串中获取代码。但真的很想返回实际的代码。
这可能吗,还是我应该走 strpos 路线?谢谢!
【问题讨论】: