PHP Classes

Wrong time when replying e-mail

Recommend this page to a friend!

      MIME E-mail message sending  >  All threads  >  Wrong time when replying e-mail  >  (Un) Subscribe thread alerts  
Subject:Wrong time when replying e-mail
Summary:When replying an e-mail, the wrong time is shown
Messages:8
Author:Sjake It
Date:2020-09-15 12:11:58
 

  1. Wrong time when replying e-mail   Reply   Report abuse  
Picture of Sjake It Sjake It - 2020-09-15 12:11:58
When replying a message, the e-mailclient generates a message:

On 15 sept. 2020 at 21.42 .... wrote:

While the e-mail was sent at 13.42 hours.
This goes only wrong when replying the e-mail. Not when forwaring.

When comparing the code from 1.38 with 1.37, i see something changed in the function SendMessageHeaders() in smtp_message.php
-$date = date("r");
+$date=date("D, d M Y H:i:s T");
When using version 1.37 the problem was solved!

How to fix this issue with te new version?

  2. Re: Wrong time when replying e-mail   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2020-09-16 12:47:35 - In reply to message 1 from Sjake It
Hello Sjake,

It seems your email client is interpreting the time zone information in an unexpected way.

Can you tell what is the email client that you use?

  3. Re: Wrong time when replying e-mail   Reply   Report abuse  
Picture of Sjake It Sjake It - 2020-09-21 18:39:18 - In reply to message 2 from Manuel Lemos
Apple Mail and Microsot Outlook give the wrong dates. Gmail webclient has the correct date.

  4. Re: Wrong time when replying e-mail   Reply   Report abuse  
Picture of Sjake It Sjake It - 2020-09-21 18:41:38 - In reply to message 3 from Sjake It
I have an e-mail message which you can use to see the issue. I could e-mail it you as an attachment.

  5. Re: Wrong time when replying e-mail   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2020-09-21 23:06:51 - In reply to message 4 from Sjake It
Hello Sjake,

I tracked down the changes done to the smtp_message_class and the format used to set the Date: header was something that was changed in 2006.

So I wonder if the issues is due to the timezone not be correctly set in your server on which you run PHP.

Can you please send me a message to mlemos at acm dot org (replace the at and dot words by @ and .), so I can analyse what the headers show?

If you can set the body with the following PHP code it would be even better.

$body = "Date() time: ".date("D, d M Y H:i:s T")." strftime("%a, %d %b %Y %H:%M:%S %Z") time: ".strftime("%Z");

  6. Re: Wrong time when replying e-mail   Reply   Report abuse  
Picture of Sjake It Sjake It - 2020-09-22 07:16:51 - In reply to message 5 from Manuel Lemos
I e-mailed you the message.

  7. Re: Wrong time when replying e-mail   Reply   Report abuse  
Picture of Sjake It Sjake It - 2020-09-30 06:51:20 - In reply to message 5 from Manuel Lemos
This seems to solve the probleem:

$email_message=new \smtp_message_class;
$email_message->SetHeader('date',date("r"));

  8. Re: Wrong time when replying e-mail   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2020-10-04 00:16:00 - In reply to message 7 from Sjake It
Hello Sjake,

I just updated the make to the default date header value be compliant with RFC 2822 like it was suggested by your fix.

Thank you for your collaboration.