PHP发送不转到SPAM文件夹的自动邮件? [英] PHP Sending Automated Mail That Doesn't Goto The SPAM Folder?

查看:71
本文介绍了PHP发送不转到SPAM文件夹的自动邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在通过PHP函数发送邮件时,我总是有些麻烦。
,但是直到我最新的项目才真正成为问题。

I've always been a little troubled when it comes to sending mail through PHP functions. But it hasn't really been a problem until my latest project.

我正在寻找通过PHP发送邮件的绝对最佳方式,它最终会出现在SPAM文件夹中:/

I'm looking for the absolute best way of sending mail through PHP and not having it end up in the SPAM folder :/

我知道它可能不会100%地起作用,
我只是在找

I'm aware that it won't probably work 100% of the time, I'm just looking for the best option.

谢谢:)

推荐答案

数字邮件通常会出现在SPAM文件夹中(当内容实际上不是垃圾邮件时)的原因之一是未设置发件人:标头或将其设置为非现有的电子邮件地址。如果标题为空,则该消息似乎来自 webmaster @ localdomain 之类。

The number one reason mail usually ends up in the SPAM folder (when the content isn't actually spammy) is that the From: header isn't set or is set to a non-existant email address. If the header is empty the message will appear to come from something like webmaster@localdomain.

mail()调用(请参考 docs ),请务必填充 $ additional_headers 字段,例如:

In the mail() call (refer to the docs) be sure to populate the $additional_headers field like:

mail('to@example.com', 'Subject', 'Body text...', 
             'From: me@realaddress.com');

这应该使您通过几乎所有垃圾邮件过滤器-假设您实际上并未发送垃圾内容! :)

That should get you past almost all spam filters -- assuming you're not actually sending out spammy content! :)

这篇关于PHP发送不转到SPAM文件夹的自动邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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