Everytime chilkat creates a MIME message, we save its value in a database table along with a TIMESTAMP field with value of current date and time. Before, the time difference of the MIME message LocalDate or EmailDate compare to the TIMESTAMP field is only in seconds or hours. But now, they're differ in months.
Actual record in the database TIMESTAMP Field: 06/07/2013 09:23 AM
Chilkat LocalDate or EmailDate value return: 05/18/2013 07:15 AM
Is there other property that returns the actual date when the MIME was created?
Make sure you're testing with the latest version. Also, if the latest version is a problem, make sure to post a code snippet that show exactly how to reproduce the problem.
When a new email object instance is created, it should by-default be initialized with a Date header that contains the current system date/time. I think it would be unlikely that it's in error, because if it was, Chilkat would be receiving hundreds of problem reports about it. (I'm not saying it's not possible -- any bug is possible -- just highly unlikely...)
This is a rare case I guess, but, I tried to extend my research and ended with this similar case in the FireMail component, which I believe is also a bug in the Chilkat component:
FireMail Wrong send date - http://www.dynamicpdf.com/Forums/DisplayThread.csp?FD=7&ThreadID=2801
Actually, our client is running the email program through a microsoft hosting from Illinois with timezone in CST. The hosted server time zone in another country is in (UTC -08:00) Pacific Time (US & Canada). I don't think this in an issue between time zones because the difference is in months. It might be related to the regional settings.
I think this problem is common in any email component when adapting to regional settings and timezone, and might also be a bug inside the chilkat component.
Below is the snippet of the code that we've used in our VB.Net application:
-- Creating MIME header --
Dim chilkatMHT As New Chilkat.Mht chilkatMHT.HtmlToMHT(htmlText)in some portion of the project we are also calling the GetMime function to generate the header
-- Reading MIME message (with header and body) --
Dim emailMessage As New Chilkat.Email emailMessage.SetFromMimeText(mimeMessage) <-- mimeMessage - saved mime message in the database-- TIMESTAMP fields:
emailMessage.LocalDate #5/18/2013 11:15:29 PM# Date
emailMessage.EmailDate #5/18/2013 3:15:29 PM# Date
datecreated : 2013-06-17 09:23:00.947
datemodified: 2013-06-17 09:23:00.947
-- This is what it looks in the MIME header --
MIME-Version: 1.0 Date: Sat, 18 May 2013 08:15:29 -0700
--We've used ChilkatDotNet4.dll version 220.127.116.11 for this
According to your information, the mimeMessage is a string that comes from the database. Therefore, the date/time for the email comes from the Date header in mimeMessage.
What originally created mimeMessage? You haven't shown me this.
Also, please show the actual header contained within mimeMessage that contains the Date header field. It's most likely that the date/time string found in the Date header is not formatted correct according to RFC822 standards.
To clarify my message above, the mime message with complete header and body is generated only by the code below:
Dim chilkatMHT As New Chilkat.Mht
And we access the "Date:" value inside of the mimeMessage by calling the LocalDate or EmailDate properties, and then compared those values to our OWN date fields in the table (datecreated or datemodified)
Below is a more detail mime message with a complete header and body. Note that I replaced the confidential info with ???:
Date: Sat, 18 May 2013 08:15:29 -0700
X-Priority: 3 (Normal)
This is a multi-part message in MIME format.