Here i want to download the pdf from specific mail id

hello all, I have list of mail id …I want to download pdf from those mail ID. how can apply this in get outlook mail message activity. I have created array variable. In that i have stored multiple mail id… how can i use this array variable

1 Like

Hey @Bhargavi_Lokapur

The mails which you have in array is different outlook accounts from which you need to fetch PDFs ?

Thanks
#nK

In one outlook account…there are different mail id…From those mail id…the pdf is come. so how can I use this array variable in get outlook mail message… activity.

1 Like

Hey @Bhargavi_Lokapur

Perfect, Use that array in for-each and inside the for-each just use Get Outlook Mail Message

In the account prop of the Get Outlook Mail Message activity just pass the foreach item which is nothing but the mail account.

Hope this helps

Thanks
#nK

Hi

Hope the below steps would help you resolve this

  1. Let’s take like you have the input mail I’d in a array named arr_mailid

  2. Now use a GET OUTLOOK mail activity and get around 100 mails by mention as Top property = 100
    Change the value from 100 to the number of mails you want

This will fetch all the mails from all mail I’d

  1. Then let’s filter now the required mail I’d alone and it’s mail messages

Use a assign activity like this

mail_message = mail_message.Where(Function(x) arr_mailid.Contains(x.Sender.Address.ToString)).ToList

mail_message is the output variable we obtained from get outlook mail activity

  1. Now this variable will have only the mail message from the mailid we had in a array

  2. Use a for each activity and pass the above list variable mail_message as input and change the type argument as System.Net.Mail.Mailmessage

  3. Inside the loop use a SAVE MAIL ATTACHMENT activity to save the files to a folder you want

Cheers @Bhargavi_Lokapur

2 Likes

Its not work sir. The program execution is ended within 2 min without having any error

Fine

Can you run in debug mode once so that we can see where it is get faulted
Make sure you have some unread mails if only unread property is enabled in get outlook mail activity
@Bhargavi_Lokapur

hii…sir… I have one excel…from that …B2 cell contain Invoice no…If this inv no is match with pdf file name… then i want to capture this file name and write into excel…sheet in cell A6.
how we can do it