加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > PHP > 正文

PHP邮件: – 做什么?

发布时间:2020-05-25 08:30:36 所属栏目:PHP 来源:互联网
导读:在使用电子邮件主机排除联系表单时,他们告诉我在php邮件功能的地址中使用“-f”. “-f”标志的作用是什么?为什么这样做可以让电子邮件发送?我读了一些文档,但我不清楚. 示例代码: mail($emailAddress, $mailSubject, $mailBody, $headers, -f . $mailFrom)

在使用电子邮件主机排除联系表单时,他们告诉我在php邮件功能的地址中使用“-f”. “-f”标志的作用是什么?为什么这样做可以让电子邮件发送?我读了一些文档,但我不清楚.

示例代码:

mail($emailAddress,$mailSubject,$mailBody,$headers,'-f ' . $mailFrom);

PS:没有“-f”,它对于大型电子邮件主机(hotmail,gmail等,但无论什么原因都不适用于我正在使用的较小的主机)工作正常

谢谢

-f是邮件程序的一个参数(通常是sendmail).从 the docs:

The additional_parameters parameter can be used to pass additional
flags as command line options to the program configured to be used
when sending mail,as defined by the sendmail_path configuration
setting. For example,this can be used to set the envelope sender
address when using sendmail with the -f sendmail option.

这是man page for sendmail,你可以看到-f选项是什么:

-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.

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读