I'm having problems with the from line in the mail header. When I include a time stamp in in the subject line I get the following From: root@tcrop.net - NOT what I want...
====
Delivered-To: tcropper@tcrop.net
Date: 5 Feb 2002 18:46:29 -0600
From: root@tcrop.net
To: tcropper@tcrop.net
Subject: Test: 1012956389.7027
From: registrar@unity.apfa.org
This is a test.
If I don't include the timestamp in the subject line things are great! (registrar needs to be the sender)
===Delivered-To: tcropper@tcrop.net
Date: 5 Feb 2002 18:46:57 -0600
To: tcropper@tcrop.net
Subject: Test
From: registrar@tcrop.net
This is a test.
===
Anyone have a clue why including a timestamp in the subject would cause mail from root??
Any help appreciated
Thanks
<?
$email="tcropper@tcrop.net";
$refno = utime();
$refno=sprintf("%10.4f\n",$refno);
sendmail($refno, $email);
function sendmail($refno, $email) {
$to = $email;
$header = "From: registrar@tcrop.net";
$subj = "Test: $refno";
// $subj = "Test";
$body = "This is a test.";
if( mail ($to, $subj, $body, $header)){
echo "Mail Successfully Sent!\n<br>";
}else{
echo ("Error Sending Mail");
}
}
function utime()
{
$t=microtime();
$t=((double)strstr($t, ' ')+
(double)substr($t,0,strpos($t,' ')));
return $t;
}
?>