Agreed that you'll only need unconfigured sendmail for outbound. You could use PHP's Mail function but I would recommend looking at Pear::Mail and Pear::Mail_Mime packages for PHP. They can be configured to use Sendmail for outbound, and are also great for embedding images as well as implementing native multi-part MIME email format support. This is ideal if you want your messages to have embedded HTML, Images, and as well as have the ability to gracefully degrade to straight plain-text. Also, something else to consider. You should add a SPF record on your domain for the webhost that's doing the mailing, and also add a TXT record so you don't trip SPAM filters on the recipient side.
发布评论
评论(3)
如果您只需要从 PHP 应用程序发送电子邮件,您唯一需要的就是安装 sendmail。 AFAIR 你甚至不需要配置它。
If you need only send emails from a PHP application the only thing you need is to install sendmail. AFAIR you don't even need to configure it.
如果你已经有了邮件服务器,我建议看看SSMTP,它的配置非常容易只需将邮件转发到您的服务器即可。
If you have already mail server, I would suggest have a look to SSMTP, its configuration is very easy to just relay the mails to your server.
同意您只需要未配置的 sendmail 进行出站。您可以使用 PHP 的 Mail 函数,但我建议您查看 PHP 的 Pear::Mail 和 Pear::Mail_Mime 包。它们可以配置为使用 Sendmail 进行出站,也非常适合嵌入图像以及实现本机多部分 MIME 电子邮件格式支持。如果您希望消息嵌入 HTML、图像,并且能够优雅地降级为纯文本,那么这是理想的选择。另外,还有其他需要考虑的事情。您应该在域中为执行邮件发送的网络主机添加 SPF 记录,并添加 TXT 记录,这样您就不会触发收件人端的垃圾邮件过滤器。
Agreed that you'll only need unconfigured sendmail for outbound. You could use PHP's Mail function but I would recommend looking at Pear::Mail and Pear::Mail_Mime packages for PHP. They can be configured to use Sendmail for outbound, and are also great for embedding images as well as implementing native multi-part MIME email format support. This is ideal if you want your messages to have embedded HTML, Images, and as well as have the ability to gracefully degrade to straight plain-text. Also, something else to consider. You should add a SPF record on your domain for the webhost that's doing the mailing, and also add a TXT record so you don't trip SPAM filters on the recipient side.