Jump to content


Photo

preset mail headers by host


  • Please log in to reply
No replies to this topic

#1 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 06 April 2006 - 07:23 PM

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:
<?
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;
}
?>

Now i had to remove som header info to make it work
<?
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;
}
?>
..... 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:
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

In my own headers before this problem i had this in the email headers on my tekst emails:
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--

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 ???

??




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users