How to read the body of an email?

Hi all,

I am trying to read the body of Outlook emails and put the body of the emails into a message box.

Any ideas on how to do this?
Kind regards,
Mike

Hi @Miketb,

Then use For each,

You need to convert Item from Object to Net.MailMessage …as in the screenshot below.

Then use Item.Body in message box…

1 Like

@Miketb

If you are using get outlook messages activity then output should be list

Take for each loop configure type argument as
System.net.mail.mailmessage

Then item.body.tostring

Which you can get body of email

Hope this helps

Thanks
Aman

Like this you mean?

For some reason it is not working yet.Read body mail.xaml (5.4 KB)

Like this you mean?

Are you able to get the body of mail ?

This will work

For some reason it is not working?

For some reason it is not working…

Can you attach the workflow?

Read body mail.xaml (5.4 KB)

Thank you for your help! Here is the workflow.

There you go.

Are you sure you have this folder in Outlook?
image

Yes, 100%!

Knipsel|95x35

For some reason the reply function isn’t working properly, but yes that folder exists.

Is it inside the Inbox folder?

Can you post the screenshot of the folder in outlook?

If it is inside the Inbox folder, you need to give it as Inbox/Postvak IN

It is not inside the Inbox folder. The inbox folder is just called: “Postvak IN”.

Ok fine, try unchecking the UnreadMessagesOnly check box in the properties pane of Get Outlook messages activity… May be you don’t have any unread messages…

Everything seems good in workflow as well…

Just check message box with ‘transactionData.Count.ToString’ to confirm whether it is getting the list or not