基本邮件功能(PHP)附加的“-f”参数问题 [英] Basic mail function (PHP) additional "-f" parameter question

查看:161
本文介绍了基本邮件功能(PHP)附加的“-f”参数问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否在此邮件功能中正确设置 -f 附加参数。

Is the -f additional parameter correctly set in this mail function.

@mail("example@exmaple.com.uy",$title,$body,$headers,"-f");

我从某些地方获取 X警告服务器。

I am Getting the X Warning from some servers.

对于基本问题抱歉,文档让我感到困惑(特别是一些用户评论)。

Sorry for the basic question but some parts of the documentation got me confused (specially some user comments).

提前感谢

推荐答案

从手册中


additional_parameters参数
可以用于将
作为命令行选项传递给程序
,配置为在发送
邮件时使用,由sendmail_path
配置设置定义。例如,
这可以用于在使用sendmail
和-f sendmail选项时设置信封
发件人地址。

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.

Web服务器运行为
的用户应作为受信任的用户添加到
的sendmail配置中,以防止
a'X-Warning'头文件添加
信封
发送者(-f)是使用此方法设置的。
对于sendmail用户,此文件为
/ etc / mail / trusted-users。

The user that the webserver runs as should be added as a trusted user to the sendmail configuration to prevent a 'X-Warning' header from being added to the message when the envelope sender (-f) is set using this method. For sendmail users, this file is /etc/mail/trusted-users.

source: a href =http://www.astahost.com/info.php/Sending-Mail-Php39s-Mail-Function_t2728.html =nofollow> http://www.astahost.com/info.php/ Sending-Mail-Php39s-Mail-Function_t2728.html

source: http://www.astahost.com/info.php/Sending-Mail-Php39s-Mail-Function_t2728.html


additional_parameters参数
可用于传递额外的
参数,配置为
的程序使用
sendmail_path配置设置发送邮件时使用。
例如,当使用-f sendmail选项使用
sendmail时,这可以用于设置
信封发件人地址。
您可能需要添加
Web服务器运行的用户对您的sendmail
配置,以防止将'X-Warning'
标头添加到消息$ b当您使用
这个方法设置信封发件人时,$ b。示例3.使用额外的标头发送邮件
并设置
附加命令行参数。

The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using 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. You may need to add the user that your web server runs as to your sendmail configuration to prevent a 'X-Warning' header from being added to the message when you set the envelope sender using this method. Example 3. Sending mail with extra headers and setting an additional command line parameter.

ie: / p>

i.e:

<?php
mail("nobody@example.com", "the subject", $message,
"From: webmaster@{$_SERVER['SERVER_NAME']}", "-fwebmaster@{$_SERVER['SERVER_NAME']}");
?>

之后 - 您需要设置传出的电子邮件地址以防止警告(在本例中为其网站管理员@ -the域 -

After -f you need to set the outgoing email address to prevent the warning (in this case its webmaster@-the domain-

这篇关于基本邮件功能(PHP)附加的“-f”参数问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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