Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有带有 Network Solutions 虚拟服务器的 Plesk。当我的网站使用 PHP 发送电子邮件时,电子邮件标头表明邮件来自以下地址:
匿名@002a1c9.netsolvps.com
如何更改此地址?
使用 PHP mail() 命令,您可以使用 -f 命令设置信封发件人地址,也可以在邮件标题中包含发件人地址,如下所示:
$to = "to@to.com"; $from = "from@from.com"; $subject = "subject"; $message = "this is the message body"; $headers = "From: $from"; $ok = @mail($to, $subject, $message, $headers, "-f " . $from);