Php 如何在发送邮件时删除“Via”邮件
我在Hostgator和PHP中使用Cpanel发送邮件。当我使用此代码时,我总是通过邮箱birkin.websitewelcome.com接收邮件。当我通过joomla发送邮件时,未添加邮件id。我不想在邮件中显示birkin.websitewalcome.com 在mail.php中是否要添加任何代码 mail.phpPhp 如何在发送邮件时删除“Via”邮件,php,email,sendmail,Php,Email,Sendmail,我在Hostgator和PHP中使用Cpanel发送邮件。当我使用此代码时,我总是通过邮箱birkin.websitewelcome.com接收邮件。当我通过joomla发送邮件时,未添加邮件id。我不想在邮件中显示birkin.websitewalcome.com 在mail.php中是否要添加任何代码 mail.php $guest_ip = $visitor_location['IP']; $guest_country = $visitor_location['CountryName
$guest_ip = $visitor_location['IP'];
$guest_country = $visitor_location['CountryName'];
$guest_city = $visitor_location['CityName'];
$guest_state = $visitor_location['RegionName'];
$name=mysql_real_escape_string($_GET['name']);
$email=mysql_real_escape_string($_GET['email']);
$subject1=mysql_real_escape_string($_GET['subject']);
$messag=mysql_real_escape_string($_GET['message']);
$to = "id@mydomain.com";
$subject = 'Mail From Contact Page - Surabi Institutions';
$headers = "From: info@mydomain.org \r\n";
$headers .= "Reply-To:info@mydomain.org \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = '<html><body>';
$message .= '<div style="border: 1px solid #292929; margin:0 auto; height:auto;
width:70%; color:#808080; padding: 0% 10%;">';
$message .= '<h3>Mail From Contact Page</h3>';
$message .= '<strong>Name</strong>:'.$name.'<br>';
$message .= '<strong>Email</strong>:'.$email.'<br>';
$message .= '<strong>Subject</strong>:'.$subject1.'<br>';
$message .= '<strong>Message</strong><br>'.$messag.'<br><br /><br /><br /> </div>';
$message .= '<div style="border-top:1px solid #cacaca; margin-top:50px; height:auto; color:#faa;">';
$message .= '<b>Visitor IP</b> -'.$guest_ip.'<br>';
$message .='<b>Visitor City</b> -'.$guest_city.'<br>';
$message .='</div> ';
$message .= '</body></html>';
if(mail($to, $subject, $message, $headers))
{
echo "<script type='text/javascript'> alert('Thank you. We will be in touch with you very soon.'); window.location='index.php';</script>";
}
else
{
echo "<script type='text/javascript'> alert('Mail Sending Failed Please Try Again'); history.back();</script> ";
}
您可以使用此代码
$to = ""test@gmail.com;
$from = "info@test.com";
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
// now lets send the email.
mail($to, $subject, $message, $headers);
参考