我正在尝试使用正则表达式来匹配不存在的地址的gmail反弹,以便将其与PHPMailer-BHM一起使用。
这是消息
<majsha77665251001@gmail.com>: host
gmail-smtp-in-v4v6.l.google.com[173.194.70.26] said: 550-5.1.1 The email
account that you tried to reach does not exist. Please try 550-5.1.1
double-checking the recipient's email address for typos or 550-5.1.1
unnecessary spaces. Learn more at 550 5.1.1
http://support.google.com/mail/bin/answer.py?answer=6596 n7si4762785wiy.46
(in reply to RCPT TO command)
我希望该规则与电子邮件和“您尝试访问的电子邮件帐户不存在”,或者至少“您尝试访问的帐户不存在”的消息相匹配。
答案 0 :(得分:0)
我自己找到了,php代码:
preg_match ("/<(\S+@\S+\w)>.*\n?.*\n?.*account that you tried to reach does not exist/i",$body,$match)