为公司防火墙优化 mail()
我在那里。
我正在为我的公司创建一份时事通讯 - 收件人很可能是使用其公司电子邮件地址的其他公司的员工。
问题是,当我使用 mail()
发送邮件时,它通常会被防火墙捕获,将其标记为垃圾邮件,因为它是由网络服务器发送的。
我怎样才能优化我的功能,这样被拒绝的邮件数量就会以某种方式减少。我确信我无法达到 100%,但至少大多数收件人应该收到邮件。
目前,该函数的外观如下:
mail($email, $subject, $message, '-f [email protected]\r\nfrom: [email protected]\r\nreply-to: [email protected]');
i there.
I'm creating a newsletter for my company - the receivers will most likely be other companys employees using their company email adress.
The problem is, when I send mails using mail()
, it most will often be catched by the firewall marking it as spam, at it was sent by a webserver.
How can I optimize my function, so the amount of rejected mails will somehow reduce. I'm sure I can't reach the 100% but at least most of the receivers should get their mail.
Currently, this is how the function looks:
mail($email, $subject, $message, '-f [email protected]\r\nfrom: [email protected]\r\nreply-to: [email protected]');
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我见过的关于该主题的最好读物是:
http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html
希望对你也有帮助
The best read on that topic i have ever seen is that one:
http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html
Hope it helps you too
您可能会更幸运地尝试找出导致您的电子邮件被困为垃圾邮件的原因,而不是坐在随机更改的标题/内容上。如果您有权(或能够)访问垃圾邮件过滤器的日志,请准确查看导致邮件被屏蔽的原因。
可能是来自您发送的主机的任何内容、主题行、列入黑名单的单词、格式错误的标头以及其他数不清的原因。
You might have better luck trying to figure out what's causing your email to be trapped as spam rather than sitting around randomly changing headers/content. If you have (or can get) access to the spam filter's logs, see exactly what's causing your message to get canned.
Could be anything from the host you're sending from, subject line, black listed words, malformed headers, and a few other bajillion reasons as well.
当然应该是这样的:
如果不是,难怪你的垃圾邮件过滤器不喜欢它。
逆向工程/绕过垃圾邮件过滤器并不容易 - 但您可能会首先仔细研究 spamassassin 如何确定哪些是垃圾邮件,哪些不是垃圾邮件。当然,垃圾邮件过滤器不实现贝叶斯过滤是不寻常的 - 请查看手册以了解如何正确训练它。
Surely that should read:
If not, it's little wonder your spam filters don't like it.
Reverse engineering/bypassing spam filters is not supposed to be easy - but you might start by having a long hard look at how spamassassin decides what's spam and what isn't. Certainly its unusual to have a spam filter which does not implement Bayesian filtering - go check the manual on how to train it properly.