Not able to retrieve time from the mail<Urgent>

Hi All,

I need one help. I am not able to retrieve mail time from the mail.
Here is the code I am using

As you can see in Logs Mail Date is blank:

I have also used cDate(item.Headers(“Date”)) as well but not able to resolve this.

Log

I am using IMAP activity to get the mails because my organization is using corporate Gmail and I can’t use outlook due to some restrictions.
Please help me on this. I am kind of stuck.

Thanks!
Anmol

I don’t know the definite answer to this, but what you can do is output all the headers values to see if the date is there.

String.Join("|",item.Headers.Cast(Of String()).Select(Function(x) x.ToString) )

and place this in a Write Line or Message Box, which will show all items in the mail. If there is no date still after looking at all headers, then I am not sure off the top of my head. Also, apologies if I made a mistake with the code I suggested.

By the way, you can also run the Headers through a ForEach.
If you see a value that’s a date, then just use the index to it, like
item.Headers(0).ToString

Regards.

1 Like