How can I get the Receive time from mail

(Fri, 11 Jan 2019 16:33:46 +0800
Received)

Hi @cinochen,

Refer this post

Regards,
Arivu :slight_smile:

1 Like

mail.Headers(“date”).ToString
Gets the time when the build time is not the receive time
I want to have receive time

Thanks
But it not the receive time

Hi…

I know this is quite a late response but I think it will serve some purpose for others.

The answer is to first extract the date from the email as a DateTime variable type with EmailReceiveTime = CDate(mail.Headers(“Date”)), and then simply covert that received date into the time format you need, like this: EmailTime = TimeEmailReceived.ToString(“HH:mm”) … Please note that the variable “EmailTime” is a string, not a date.

This will give it to you as displayed on the email, e.g 10:30

It also gives 24 hour time.

That should help you !!

3 Likes

mail.Headers(“Date”) is no longer working in UiPath.Mail.Activities v. 1.15.2

Same problem , did you manage to find any solution?

It works with 1.12.3 and below versions

1 Like

It works with v1.18.0 package as well. It will not work only with 1.15.2

1 Like

Convert.ToDateTime(mail.Headers(“DateReceived”)).Tostring(“dd/mm/yyyy HH:mm”)
works fo me