PHP邮件()无法工作
我正在我的网站上使用mail(),函数正在运行,但发件人地址没有显示我的电子邮件地址,而是显示name@mailchannels.netPHP邮件()无法工作,php,email,Php,Email,我正在我的网站上使用mail(),函数正在运行,但发件人地址没有显示我的电子邮件地址,而是显示name@mailchannels.net $ito_email = "$inameuser"; $ifrom_email = "info@mywebsite.co.za"; $isubject = "My subject"; $icomment = "Hello $inameuser,\r\n\r\n" . " \r\n" . "Subject: $isubjectnote" . " \r\n" .
$ito_email = "$inameuser";
$ifrom_email = "info@mywebsite.co.za";
$isubject = "My subject";
$icomment = "Hello $inameuser,\r\n\r\n"
. " \r\n"
. "Subject: $isubjectnote"
. " \r\n"
. "Notice: $inote"
. " \r\n"
. "\r\n"
. "Many thanks";
//send email
mail($ito_email, "$isubject", $icomment, "From: Support " . $ifrom_email);
例如:
$email = "emailfrom@anything.com";
$headers = 'From: ' . $email . '' . "\r\n" . "Content-type: text/html;charset = windows-1250";
$subject = $email . ' - New message';
mail("your email", $subject, "email message", $headers);
改变
mail($ito_email, "$isubject", $icomment, "From: Support " . $ifrom_email);
到
mail($itou email,$isubject,$icomment,$From:Support);
应允许您包括可读的名称以及发件人电子邮件地址。RTM Try
“发件人:支持”
谢谢用户2959229。工作。
$to = 'abc@xyz.com'; $subject = 'the subject';
$message = 'Message';
$headers = 'From: xyz@xyz.com' . "\r\n" .'Reply-To: xyz1@xyz.com' . "\r\n";
mail($to, $subject, $message, $headers);
OR
$headers .= $headers; Concat
$to = 'abc@xyz.com'; $subject = 'the subject';
$message = 'Message';
$headers = 'From: xyz@xyz.com' . "\r\n" .'Reply-To: xyz1@xyz.com' . "\r\n";
mail($to, $subject, $message, $headers);
OR
$headers .= $headers; Concat