Solved

Date problems in email

Posted on 2002-05-17
2
266 Views
Last Modified: 2008-03-06
I have a client with a PHP form that uses the sendmail function.  The date reported on the sent email is 13 hours prior to the actual date, which can be seen since the text of the email contains the date and time.
  They are using their internal Exchange Server.
  The date / time and locale is correct on the web server and Exchange Server.
  Email sent via Outlook from the web server is dated correctly, which is why I am posting this in the PHP directory.
0
Comment
Question by:rscaiefe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
vmv earned 100 total points
ID: 7017955
Try creating the date header yourself:

mail($to,$subj,$text,'Date: '.date('r').'\r\n')

Warning: this won't work in PHP earlier than 4.0.4.
0
 
LVL 1

Author Comment

by:rscaiefe
ID: 7029567
I am awarding 50 points since the solution did not exactly fit.  However, vmv was definitely on the right track.  The final solution was:
  mail($to,$subj,%text,'Date: '.gmdate('r').\r\n
The date function in vmv's suggestion brought the time to within 5 hours (CST time offset).  Seems that storing the GMT date is what NT needs as its UCT date.
Thanks for the help.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question