|
Posted by Ramon on 08/18/06 17:20
Hello,
when I send an email using the mail() function, I get a Runtime Notice:
date() [function.date]: It is not safe to rely on the system's timezone
settings. Please use the date.timezone setting, the TZ environment variable
or the date_default_timezone_set() function. In case you used any of those
methods and you are still getting this warning, you most likely misspelled
the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead.
I found out that this is caused by the date-part in the header. But I can't
find what's wrong with it.
I hope you can help me out!
Thanks,
Ramon.
This is a snippet of my script:
$sBoundary = md5(mt_rand());
$sHeaders = "Date: $sTimestamp\n" .
"From: $sMailFrom\r\n" .
"Reply-To: " . $GLOBALS ["Email"]["ReplyToAddress"]
.. "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: multipart/alternative; ".
"boundary=$sBoundary\r\n\r\n" .
"This is a multi-part message in MIME
format.\r\n\r\n";
$sBody = "--$sBoundary\n" .
"Content-Type: text/plain;
charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$this->m_sTextBody . "\n\n" .
"--$sBoundary\n" .
"Content-Type: text/html; charset=\"iso-8859-1\"\n"
..
"Content-Transfer-Encoding: 7bit\n\n" .
$this->m_sHTMLBody . "\n\n" .
"--$sBoundary--";
$this->m_bSendResult = mail($this->m_sToMail, $this->m_sSubject,
$sBody, $sHeaders);
And this is the ouput:
Date: Fri, 18 Aug 2006 19:06:00 +0200
From: John Doe <john@doe.com>
Reply-To: john@doe.com
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary=4ecaa221dc319a2ce4905365efe5e550
This is a multi-part message in MIME format.
--4ecaa221dc319a2ce4905365efe5e550
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
This is some plain text.
--4ecaa221dc319a2ce4905365efe5e550
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
<html><body><b>This is some <i>HTML</i> text.</b></body></html>
--4ecaa221dc319a2ce4905365efe5e550--
[Back to original message]
|