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

时间:2021-07-14 18:11:34

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

我正在使用PHPMailer从我的网页发送邮件。但它太慢了。

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.

大约4分钟。

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

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

1 个解决方案

#1


0  

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.

您的服务器可能正在使用名为greetdelay的东西。在SMTP规范中,在服务器向您发送内容之前发送任何内容是违规的,这用于发现行为不端的客户端(即Spambots)并将其踢出。因为这一切都发生在远程服务器端,所以phpmailer无法做到这一点。

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.

这说明SMTP并非真正用于交互式使用。解决方案是拥有一个本地邮件服务器,您可以更快地提交邮件,并让它等待,以便您可以继续提供您的页面。

#1


0  

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.

您的服务器可能正在使用名为greetdelay的东西。在SMTP规范中,在服务器向您发送内容之前发送任何内容是违规的,这用于发现行为不端的客户端(即Spambots)并将其踢出。因为这一切都发生在远程服务器端,所以phpmailer无法做到这一点。

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.

这说明SMTP并非真正用于交互式使用。解决方案是拥有一个本地邮件服务器,您可以更快地提交邮件,并让它等待,以便您可以继续提供您的页面。