Jump to content

preset mail headers by host


alpine

Recommended Posts

Hi,
this afternoon i found all emails sendt from my website to be completely blanc - not good!
So i did some investigation since i havent recieved any answer from my web host yet, and i found that they have set header info to go along with all php mail, possibly making a conflict with my own header info.
previously i had this that worked just great:
[code]
<?
function usermail($reciever,$subject,$message)
{
global $systememail;
global $systemname;

$time = date("d-m-Y H:i:s");

$eol="\r\n";
$headers = "From: $systemname <$systemail>".$eol;
$headers .= "Reply-To: $systemname <$systemail>".$eol;
$headers .= "Return-Path: $systemname <$systemail>".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;
$headers .= "Date: ".date("r").$eol;
$headers .= "Message-ID: <".date("YmdHis")."xxxxxxxxx@".$_SERVER['SERVER_NAME'].">".$eol;
$mime_boundary=md5(time());
$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol;
$msg = "";
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$message .= "\n\n\n-------------------------------------\nSendt: $time\nEMAIL FOOTER INFO";
$msg .= $eol.$eol.$message.$eol.$eol;

$msg = wordwrap($msg, 70);

if(ini_get('safe_mode'))
{
mail($reciever, $subject, $msg, $headers);
}
else
{
mail($reciever, $subject, $msg, $headers, "-f" . $systememail);
}
return true;
}
?>
[/code]

Now i had to remove som header info to make it work
[code]
<?
function usermail($reciever,$subject,$message)
{
global $systememail;
global $systemname;

$time = date("d-m-Y H:i:s");

$eol="\r\n";
$headers = "From: $systemname <$systemail>".$eol;
$headers .= "Reply-To: $systemname <$systemail>".$eol;
$headers .= "Return-Path: $systemname <$systemail>".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;
$headers .= "Date: ".date("r").$eol;
$headers .= "Message-ID: <".date("YmdHis")."xxxxxxxxx@".$_SERVER['SERVER_NAME'].">".$eol;
// $mime_boundary=md5(time());
// $headers .= 'MIME-Version: 1.0'.$eol;
// $headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol;
$msg = "";
// $msg .= "--".$mime_boundary.$eol;
// $msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
// $msg .= "Content-Transfer-Encoding: 8bit".$eol;
$message .= "\n\n\n-------------------------------------\nSendt: $time\nEMAIL FOOTER INFO";
$msg .= $eol.$eol.$message.$eol.$eol;

$msg = wordwrap($msg, 70);

if(ini_get('safe_mode'))
{
mail($reciever, $subject, $msg, $headers);
}
else
{
mail($reciever, $subject, $msg, $headers, "-f" . $systememail);
}
return true;
}
?>
[/code]
..... and i got my email up and running again.

When checking the emails sendt now i find this info added from the host in the headers, and this was not present before i got problems:
[code]
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Spam-Status: No, hits=-0.0 required=4.0
X-Spam-Report: -0.0 hits, 4.0 required;
    * -0.0 NO_RELAYS              Informational: message was not relayed via SMTP
    *  0.0 UPPERCASE_25_50        message body is 25-50% uppercase
X-Virus-Scanned: by moam (http://www.moam.net/)
X-Moam-Version: 0.92
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from BASE64 to 8bit by mx02.HOSTNAME REMOVED id k36IuTfJXXXXXXX
[/code]

In my own headers before this problem i had this in the email headers on my tekst emails:
[code]
MIME-Version: 1.0
Content-Type: multipart/related; boundary="b232cf5dae5155130e18d3848578c7e7"
X-Spam-Status: No, hits=-0.0 required=4.0
X-Spam-Report: -0.0 hits, 4.0 required;
    * -0.0 NO_RELAYS              Informational: message was not relayed via SMTP
X-Virus-Scanned: by moam (http://www.moam.net/)
X-Moam-Version: 0.92


--b232cf5dae5155130e18d3848578c7e7
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

ALL EMAIL CONTENT HERE

--b232cf5dae5155130e18d3848578c7e7--
[/code]

This new and unexpected issue has now prevented me from using my html newsmail function aswell since i cannot set my own header info anymore.

So, question to you server freaks - any way to go by this if my host wont reverse it ???

??
Link to comment
https://forums.phpfreaks.com/topic/6756-preset-mail-headers-by-host/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.