How to save each mail as list of mail message

how to save each mail in gmail mail message in a list of mail message like outlook mail message activity…i am not able to use get outlook mail message activity as it giving error in 2007 ms office version.

2 Likes

Hello,

Have you tried using get IMAP mail messages activity?

Thanks!
Athira

No, but i wanted to use this activity only

i am getting error like:-

Get IMAP Mail Messages: Invalid credentials (Failure)

Hello,

Can you please follow these steps and try again?

Thanks!
Athira

Hi

Refer this thread for example of how to get list of mail messages from GET IMAP mail activity

And if you are facing any challenge with authentication then make sure you have enabled Imap in your gmail account

Here you go with the steps to do that

https://docs.uipath.com/studio/v2018.2/docs/enabling-gmail-for-email-activities

cheers @Debojyoti_chanda

is there anyway to save the messages in gmail activity as list of mailmessages
so that the get imap or get outlook activities can be replicated

1 Like

Ofcourse it gives output as a list of mail message

Output

  • Messages - The retrieved messages as a collection of MailMessage objects.

Cheers @Debojyoti_chanda

no iam asking about for each email activity inside the use gmail scope

Can u elaborate a bit more

@Debojyoti_chanda

i want to save each mail in here in a list of mail message like we get output when using get outlook mail message activity but here it is not available so can we assign each mail in a list using assign activity?

1 Like

Fine got it

  1. First in variable panel create a variable of this type

System.Collections.Generic.List(System.Net.Mail.MailMessage)

With variable name as list_mailmessage with default value as New List(of System.Net.Mail.Mailmessage)

  1. Now inside the Use Gmail activity use FOR EACH activity instead of FOR EACH MAIL activity

in that activity that pass the input as [selected Mails] and change the type argument as System.Net.Mail.MailMessage

  1. Inside the loop use a ADD TO COLLECTIONS Activity where in property panel mention as
    Collection - list_mailmessage
    Item - item
    Type argument - System.Net.Mail.MailMessage

This will create list of mail message as we get in get outlook mail activity

Cheers @Debojyoti_chanda

2 Likes

Thanks…this is exactly what i required

1 Like

Glad it got resolved

@Debojyoti_chanda

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.