如何删除" Via"邮件发送邮件

时间:2014-03-08 09:10:47

标签: php email sendmail

我在Hostgator和PHP中使用Cpanel发送邮件。当我使用这个代码时,我总是通过邮件收到邮件“birkin.websitewelcome.com”。当我通过joomla发送邮件“通过”邮件ID没有添加。我不想在邮件中显示“birkin.websitewelcome.com”。

是否有任何代码要添加到mail.php

enter image description here

mail.php

$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> ";
}

1 个答案:

答案 0 :(得分:0)

您可以使用此代码。

$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);