在对电子邮件主机的联系表单进行故障排除时,他们告诉我在php邮件功能的发件人地址中使用"-f"."-f"标志的作用是什么?为什么这将是允许发送电子邮件的修复程序?我读了一些文档,但我不是很清楚.
示例代码:
mail($emailAddress, $mailSubject, $mailBody, $headers, '-f ' . $mailFrom);
Run Code Online (Sandbox Code Playgroud)
PS:没有"-f"它适用于大型电子邮件主机(hotmail,gmail等),但出于任何原因不适合我正在使用的较小主机
谢谢
nic*_*ckb 10
-f是邮件程序的参数(通常是sendmail).来自文档:
additional_parameters参数可用于将其他标志作为命令行选项传递给配置为在发送邮件时使用的程序,如sendmail_path配置设置所定义.例如,当使用带有-f sendmail选项的sendmail时,可以使用此选项设置信封发件人地址.
-fname Sets the name of the ``from'' person (i.e., the sender of the
mail). -f can only be used by ``trusted'' users (normally
root, daemon, and network) or if the person you are trying to
become is the same as the person you are.
Run Code Online (Sandbox Code Playgroud)
-f选项用于设置退回邮件地址。在没有邮件的情况下发送邮件可能会对针对该邮件计算的垃圾邮件分数产生负面影响。有时,某些主机会过滤掉分数较低的邮件。
您可以使用https://www.mail-tester.com/来测试您的邮件的分数。您可以使用或不使用 -f 标志来过期并查看分数变化。
| 归档时间: |
|
| 查看次数: |
10129 次 |
| 最近记录: |