1

I've a HTML signup form with php. After a successfully submit it sends a confirmation email to the user email address.

Well, when user see his/her email it's shown as:

Yoursite.comr@mediaplan.ovh.net

But I didn't add the @mediaplan.ovh.net part to the email address. Why it's showing in this address. @mediaplan.ovh.net? and how do i remove it?

php email code:

$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 に答える