Archived Forum Post

Index of archived forum posts

Question:

how do I access the "Received Date" for an email (CkEmail)?

Nov 20 '12 at 21:37

In reviewing the documentation for CkEmail, I can not find any reference to retrieving the "Received Date" of an Email, but I have a requirement to collect this data. How would I go about doing this?

This is an imap data source.

Thanks in advance for any help.

Cheers,

Stewart


Answer

The CkEmail class has methods for getting the values of any header field. For example, GetHeaderField can be called to get the value of any header field by name. You would pass "Received" to get the contents of the 1st "Received" header field.

However, given that an email may have multiple "Received" header fields, you may iterate from 0 to CkEmail::get_NumHeaderFields() calling GetHeaderFieldName(index) for each, and then if the name equals "Received", call GetHeaderFieldValue(index) to get the contents.