PHP:mail()和SendMail [英] PHP: mail() vs SendMail

查看:178
本文介绍了PHP:mail()和SendMail的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题:哪一个在批量发送邮件方面表现不错?

a simple question: which one has good performance for sending mails in bulk?

mail()功能或 sendmail

流行的PHP列表管理器包使用哪一个?

which one is used by popular PHP list manager packages?

推荐答案

那么 mail()函数并不适合大量发送的电子邮件,因为它打开并关闭每个发送的电子邮件的SMTP套接字,有效率如果您查看 PEAR :: Mail ,它可以让您使用3个后端:邮件 sendmail 和普通 SMTP 。对于什么是值得的,我个人喜欢SMTP,因为它很容易在Linux和Windows上支持。

Well the mail() function is not really suitable for emails sent in bulk because it opens and closes an SMTP socket for each email you send, which is far from being efficient. If you look at PEAR::Mail it allows you to use 3 backends: mail, sendmail and plain SMTP. For what it's worth, I've personally preferred SMTP because it's easy to support on both Linux and Windows.

如果您希望在后台使用队列发送邮件, PEAR :: Mail_Queue 可能是一个解决方案。

If you wish to send mails in the background using a queue, PEAR::Mail_Queue might be a solution.

这篇关于PHP:mail()和SendMail的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆