我正在尝试创建一个简单的 php 电子邮件表单,将提交的内容发送到指定的地址,但我试图解决的问题是电子邮件发送的地址 — 目前,它发送自[电子邮件受保护] /cdn-cgi/l/email-protection,但我希望能够将其更改为简单的[电子邮件受保护] /cdn-cgi/l/email-protection或者是其他东西。
<?php
$message = $_POST['message'];
$formcontent="$message";
$recipient = "[email protected] /cdn-cgi/l/email-protection";
$subject = "question";
mail($recipient, $subject, $formcontent, $header, '[email protected] /cdn-cgi/l/email-protection') or die("Error!");
header("Location: webpage_user_is_redirected_to.html");
?>
您可以使用邮件函数的第5个参数:
mail($recipient, $subject, $formcontent, $header, '[email protected] /cdn-cgi/l/email-protection');
来自manual http://php.net/manual/en/function.mail.php:
extra_parameters 参数可用于传递附加参数
标志作为配置要使用的程序的命令行选项
发送邮件时,由 sendmail_path 配置定义
环境。例如,这可用于设置信封发送者
使用带有 -f sendmail 选项的 sendmail 时的地址。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)