Email - GetOutlookMailMessage - How to retrieve Received Date, Modified Date and Message ID from each email

email
activities

#1

Hi,

I am looking to retrieve a number of properties from each email after executing the ‘GetOutlookMailMessage’ step.

I am able to pull out the From, To, Subject, Body and Attachments.

I need to be able to pull out the Received Date, Modified Date and Message ID (this is a unique identifier for each email).

I believe the problem is that the MailMessage class does not contain these properties on their own (perhaps they exist in the headers).

Any suggestions or solutions would be most welcome.


Unable to extract DATE information from mails received through Outlook
Mark mail as unread
Mail structure in Outlook
#2

Hello!

Follow a example to get all of this properties.

getMailProperties_Example.xaml (10.1 KB)

Hope It Helps!

Regards,


How to read a mail id from another mail
#3

Hi @Marshall_Belknap,

You can access headers of the email object like this : myMailVar.Headers("property").

To have an exhausted list of the properties you can get from the headers, you can get them from this link https://msdn.microsoft.com/fr-fr/library/system.net.mail.mailmessage.headers(v=vs.110).aspx.

Hope that helps.

Regards,

Masiré


#4

Masire, thank you so much,

When I try this in UiPath, I get the following error:

It seems as if it doesn’t recognize the single quote at the end of the property name. Any thoughts?


#5

Ok, so I figured it out.

In UiPath, it needs to be written like this:

mailVar.Headers(“Date”)

Thanks again


How to get delivery time of the mail
#6

Ok! I edited my answer :wink:


#7

i am trying to use Gteoutlookmail message to pick one oldest unread mail and mark it as read.using headers will happen only after getting a group of messages… i want to mark only one mail as read.


#8

Hi,

Is it possible to insert your solutions? :slight_smile:


#9

@Marshall_Belknap

How can I get message ID? I tried “mail.Header(“Id”)” . It is giving nothing.

Regards,
Krishnakanth


#10

I got the solution for that. I’ve used “mail.Header(“Message-ID”)” and it’s working fine.


#11

Hello Lucas.Pimenta
As you provided the solution, it no containe about the Date.Please once check above question