Read Email body of all the unread email

email
activities

#1

Hi all,

I am using “Get outlook mail message” activity to read mails. I want to read mail body of all the mail one by one present in my inbox.

Currently to achieve this I am using “For Each” loop and to get the body I am using mailmessages.FirstOrDefault().Body

But in this case i am always getting only the top most mail body.

Please help me to achieve this for all the emails in “Inbox” folder.


#2

you can access those like in this picture above.


Is it possible to copy the body of the unread mails using for each loop in outlook?
#3

what is “mail collection” here?


#4

it is an variable type like array of mails or List of mails.


#5

I am taking output of the activity in a variable “ListGetMail” but when am trying to fetch body or subject line I am getting validation error.


#6

Argument type of ‘for each’ activity should not be what I see in Screen shot. instead use System.Net.Mail.MailMessage

refer:

Regards,
Vikas Reddy


#7

Hi @akhi_s27 @ranjith @manasa @

image

can anyone get the solution for this issues !!!

while i am using Get Outlook mail Message Activity in that property Mail Folder i have gave command as “Sent Items”
Error : The specified folder not exists.
But in My outlook folder are available : image

Regards
RaviDevaraj


#8

@RaviDevaraj Are you sure it is connecting to your correct mail account (if you have multiple in the same outlook)? If not, have you tried specifying the account anyways to see if that corrects the issue? I could only get this to occur by putting an invalid account name into the “account” input property of the Get outlook mail messages activity which gave me an error “specified folder does not exist”.


#9

i didnot gave an account id in that field


#10

Does it work on other folders without the account property supplied? Try setting the property to the email account you wish to pull sent items from, do you get the same result?


#11

Yes, image

please find the WF : OutlookSample_v2.xaml (8.1 KB)


#12

There is nothing in the “Account” property in either the attached workflow or your screenshot. Are you sure you’ve tried putting your email address (or the one you want sent items retrieved from) in the “Account” property of the Get outlook mail messages activity?

Your workflow works fine for me (accept the Connect activity which I wouldn’t expect to work) even allowing me to pull sent items from any of the accounts I have setup in my outlook client (upon switching the account named in said property).


#13

Hi @Tyler_Williams
i have given my account id with and without its not working for me
Throws an error only : an error “specified folder does not exist”.


#14

Hi @Tyler_Williams
Any possible there to overcome this problem ?


#15

When you say account id are you meaning your email address similar to, yourname@domain.com? I’ve only ever supplied an email address or left the property blank. Are you able to access the inbox folder or any other folder successfully?

I can also generate this error by supplying a dummy email to this property so I suspect UiPath is not properly connecting to Outlook (I believe these activities require it to be installed an configured). Have you tried exchange or any other mail activities besides outlook as a workaround perhaps?


#16

yes

No

No.
so there possible to get any solution for these !!!


#17

I want to read my mail all inbox mails one by one. And while selecting one mail we have to read the mail and extract some data& do the processing of that mail.
And after that read the second mail from inbox and do the processing as mentioned above.

Continue the same task for all unread mails.

We already tried GetOutLook activity also.It is taking all the unread mails simultaneously. But i want to read and process one by one.
How can i do this?


#18

Hi Ajisha,

GetOutlook activity will give you all mail that true but it is up to u how to process.

Use for-each loop to read mail one by one and process it.

Thanks
Vivek S.


#19

Can you please add your worksheet it will better to provide exact solution