PHP4 Mail Function: Sent Time is 1 Hour Ahead

I have been messing around with this all morning and I can’t figure it out. Is there something wrong with the mail() function in PHP4? No matter what I do, all the emails sent by my PHP scripts appear to be generated 1 hour in the future.

This doesn’t seem to be directly related to the DST change, because it is doing the opposite of what you would expect. A system which didn’t properly switch the DST should be lagging an hour behind…

I checked the following:

  • The time on the server is correct
  • The PHP date() function returns the correct time
  • The MySQL NOW() function also returns the correct time
  • All emails manually sent via our SMTP server have the correct time
  • All emails received by our POP3 server seem to have the correct time
  • WTF?

I strolled through the PHP bug report system, and I noticed that people have been complaining about similar behavior since 2002 or earlier. This of course might be unrelated to what is happening to me. Anyone knows where mail() gets it’s timestamp or how to change it?

I’m running PHP 4.3.8 and IIS 6.0.

This entry was posted in programming and tagged . Bookmark the permalink.



Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>