1

我有一个带有 php 的 HTML 注册表单。成功提交后,它会向用户电子邮件地址发送一封确认电子邮件。

好吧,当用户看到他/她的电子邮件时,它显示为:

Yoursite.comr@mediaplan.ovh.net

但是我没有将@mediaplan.ovh.net部分添加到电子邮件地址中。为什么它显示在此地址中。@mediaplan.ovh.net?以及如何删除它?

php邮箱代码:

$to = "$email";                     
$subject = "Signup | Verification";
$message = "Congratulation $f_name $l_name you have been successfully registered. 
Please click the link to active your account.\r\n";
$message .= "http://www.maaks.fr/hotel/verify.php?email=$email&hash=$hash\r\n";

$from = "Yoursite.com";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-rype: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding; 7bit\r\n";
$headers = "From:" . $from . "r\n";

$mailsent = mail($to,$subject,$message,$headers); 
4

2 回答 2

3

首先,您在from标头部分缺少斜线。

$headers = "From:" . $from . "r\n";
                          //  ^ Here

发送邮件时更改From标题

$from = "WebsiteName <Your@mail.com>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-rype: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding; 7bit\r\n";
$headers = "From: " . $from . "\r\n";
于 2012-11-06T08:28:46.493 回答
1

尝试将 $from 更改为电子邮件地址。

$from = "noreply@yoursite.com";
于 2012-11-06T08:26:43.637 回答