PHP邮件()函数头 [英] PHP Mail() Function Headers
问题描述
任何建议都会很棒。
您应该始终使用FROM标头。
注意:
发送邮件时,邮件必须包含From头。这可以使用additional_headers参数设置
,或者可以在
php.ini中设置一个默认值。
如果不这样做,将导致类似于警告:
mail()的错误消息:sendmail_from未在php.ini或自定义From:标题
缺失中设置。 From头文件也设置Windows下的Return-Path。
这是直接从 mail()
OK, so I have a PHP mail function. It works fine when I put it on my server but when I put I mail it to my client so he can put it on his server it doesn't work. It doesn't give me any errors on their server and gets to the "Thanks" page just fine but never really sends the email. They say it's because PHP Mail does not have the right headers but I didn't think that it needed headers if it was just simply "mail(to, subject, message)" They say they have all PHP related functions set properly because I initially thought it was PHP Mail being turned off.
Any suggestions would be great.
You should always be using a "FROM" header.
Note:
When sending mail, the mail must contain a From header. This can be set with the additional_headers parameter, or a default can be set in php.ini.
Failing to do this will result in an error message similar to Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing. The From header sets also Return-Path under Windows.
This is straight from the documentation for mail()
这篇关于PHP邮件()函数头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!