如何限制 PHPList 发送的外发邮件速度
HostGator 的邮件政策规定,共享和转售客户每小时最多只能发送 500 封邮件。您可以在以下链接查看邮件政策:http://www.hostgator.com/mailpolicy.shtml。
本文包含具体说明,指导您如何调整邮件列表程序 PHPList,以遵守 HostGator 的邮件列表政策,确保每小时发送邮件数量低于 500 封。PHPList 可通过 Softaculous 自动安装,Softaculous 位于您的 cPanel 中。
如何限制 PHPList 发送速度:
- 首先找到您 PHPList 安装的配置文件。如果您将脚本安装在类似 http://www.domain.com/list/ 的域名路径下,则该文件的物理路径为:
/home/username/public_html/list/config/config.php
在 FTP 中,路径可能显示为:
/public_html/list/config/config.php - 下载该文件到本地电脑,或使用 cPanel 中的文件管理器直接编辑该文件。如果下载到本地,建议使用记事本或 WordPad 等程序编辑。
- 找到该文件中名为“batch processing(批处理)”的代码段。
- 在“batch processing”代码段下方,您会看到如下示例代码:
# define the amount of emails you want to send per period. If 0, batch processing
# is disabled and messages are sent out as fast as possible
define("MAILQUEUE_BATCH_SIZE",0);
# define the length of one batch processing period, in seconds (3600 is an hour)
define("MAILQUEUE_BATCH_PERIOD",3600);
# to avoid overloading the server that sends your email, you can add a little delay
# between messages that will spread the load of sending
# you will need to find a good value for your own server
# value is in seconds (or you can play with the autothrottle below)
define('MAILQUEUE_THROTTLE',0);
以上是默认设置。我们将替换这些设置,以确保每小时发送邮件数量低于 500 封。
以下是我建议的代码:
# define the amount of emails you want to send per period. If 0, batch processing
# is disabled and messages are sent out as fast as possible
define("MAILQUEUE_BATCH_SIZE",0);
# define the length of one batch processing period, in seconds (3600 is an hour)
define("MAILQUEUE_BATCH_PERIOD",3600);
# to avoid overloading the server that sends your email, you can add a little delay
# between messages that will spread the load of sending
# you will need to find a good value for your own server
# value is in seconds (or you can play with the autothrottle below)
define('MAILQUEUE_THROTTLE',8);
这些设置允许 PHPList 控制每小时发送 450 封邮件,恰好符合我们的服务条款建议。剩余的 50 封邮件额度仍可用于正常的邮件操作。
5. 保存文件,如果之前下载了文件,请通过 FTP 上传回原始位置。请务必备份原始文件,以防操作失误。
现在,您应该能够发送邮件而不会出现退信,也不会导致邮件服务器过载。