du512926 2015-01-16 00:24
浏览 57

PHPMailer如此缓慢地连接到SMTP服务器

I'm using PHPMailer to send mail from my webpage. But it's too slow.

SMTPDebug

2015-01-15 23:43:51 Connection: opening to srv1.xxx.net:25, t=30, opt=array ( ) 
2015-01-15 23:43:51 Connection: opened 
2015-01-15 23:46:11 SERVER -> CLIENT: 220-srv1.xxx.net ESMTP Exim 4.84 #2 Fri, 16 Jan 2015 01:46:11 +0200 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. 
2015-01-15 23:46:11 CLIENT -> SERVER: EHLO localhost 
2015-01-15 23:46:11 SERVER -> CLIENT: 250-srv1.xxx.net Hello localhost [xx.yyy.xx.yyy] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250-STARTTLS 250 HELP 
2015-01-15 23:46:11 CLIENT -> SERVER: AUTH LOGIN 
2015-01-15 23:46:11 SERVER -> CLIENT: 334 VXNlcmsdsds5hbWU6 
2015-01-15 23:46:11 CLIENT -> SERVER: YmlsZ2lsdAcmVyZXJsdsdsdlsdcmFyYXJhLm5ldA== 
2015-01-15 23:46:11 SERVER -> CLIENT: 334 UGFsdsdzc3dvcmQ6 
2015-01-15 23:46:11 CLIENT -> SERVER: U0ZHdWxlsdsdcis3NDg1 
2015-01-15 23:46:11 SERVER -> CLIENT: 235 Authentication succeeded Connected ok!
2015-01-15 23:46:11 CLIENT -> SERVER: QUIT 
2015-01-15 23:46:11 SERVER -> CLIENT: 221 srv1.xxx.net closing connection 
2015-01-15 23:46:11 Connection: closed 

about 4 minutes.

CENTOS 6.6 x86_64, WHM 11.46.2, Apache/2.2.25 (Unix), PHP 5.4.17

  • 写回答

1条回答 默认 最新

  • dongzhuo5185 2015-01-16 06:33
    关注

    Your server is probably using something called a greetdelay. In the SMTP spec, it's a violation to send anything before the server sends you something, and this is used to spot badly behaved clients (i.e. Spambots) and kick them out. Because this is all happening on the remote server side, there is nothing phpmailer can do about it.

    This illustrates that SMTP is not really intended for interactive use. The solution to this is to have a local mail server that you can submit messages to more quickly, and have it do the waiting so you can get on with delivering your page.

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?