Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Date problems in email

Posted on 2002-05-17
2
Medium Priority
?
288 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
2 Comments
 
LVL 2

Accepted Solution

by:
vmv earned 400 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

885 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