简体   繁体   English

如何加快PHP Mail? (使用CRON)

[英]How to Speed up PHP Mail ? (using CRON)

I'm using PHP 5 and creating Mail commands to send information. 我正在使用PHP 5并创建Mail命令来发送信息。

My Linux (Shared) Host (www.KoreDomains.com) is sending the E-mails approximately on an hourly basis. 我的Linux(共享)主机(www.KoreDomains.com)大约每小时发送一次电子邮件。

What would be a good CRON command / set of commands to speed up the process (say E-mail what is in the queue every 5 minutes) ? 有什么好用的CRON命令/命令集来加快该过程(例如,每5分钟发送电子邮件给队列中的内容)?

The goal is to make it so the E-mails show up to the user in near "Real-Time". 目标是做到这一点,从而使电子邮件在“实时”附近显示给用户。

Thanks, in advance, for your help ! 在此先感谢您的帮助 !

James 詹姆士

As with every issue related to sending mail from php I've ever come across, this is nothing to do with PHP and all about the configuration of the MTA. 就像我遇到过的与从php发送邮件有关的每个问题一样,这与PHP和MTA的配置无关。 It doesn't matter what you do in terms of scheduling when you send mail nor how you tweak the PHP code since it appears that the MTA only processes the queue every hour. 发送邮件时的调度方式和PHP代码的调整方式都没有关系,因为MTA似乎每小时仅处理一次队列。

If you want mail to be sent as soon as possible, then you need to change the MTA settings. 如果您希望尽快发送邮件,则需要更改MTA设置。 That's not going to be practical on most managed services, let alone a shared one. 在大多数托管服务上,这是不切实际的,更不用说共享服务了。 You'll need to find a different provider. 您需要找到其他提供商。 But don't expect providers to publish information about the specifics of how the MTA is configured. 但是不要期望提供者发布有关MTA配置细节的信息。

Or keep your code where it is and try connecting to a different MTA (you'll need a SMTP capable PHP client - eg phpmailer) and this presupposes that your service provider has configured the server to allow outgoing SMTP connections and can resolve IP addresses. 或者将您的代码保留在原处,然后尝试连接到其他MTA(您将需要具有SMTP功能的PHP客户端-例如phpmailer),并且这前提是您的服务提供商已将服务器配置为允许传出SMTP连接并可以解析IP地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM