Comparing a List of mail messages with a data tabel

Hi all

In a data table I have just the one column which has a list of email addresses - ‘safe senders’

I use the Get Outlook mail messages to get the emails from a mailbox, in to a List of mail messages

How do I loop through the list of mail messages to check if the address of each mail message is contained in the data table and if that’s the case, move to it’s own list so I am left with a list of mail messages that are from a ‘safe sender’


If it’s possible, I’d like to then go through that new list of mail messages and this time, keep only the ones that have attachments.

Thanks in advance,


You could use the “Get Outlook Mail Messages” to get all your emails from a specific folder.

After that you could use a For each loop to go through the emails and get the sender email: item.sender and compare it with your save sender list using a dictionary, for example.

You could use the item.Attachments to check for email attachments, and if so, save them using the ‘Save Attachament activity’


Hi @jordrowley,

Create a for each loop and loop your mails that out from the Get outlook mail messages activity
and inside that loop create another loop and loop your data table contain mail addresses and now in the main loop you can get one mail at a time and iterate that mail with all mail addresses that come from Data table match with the sender

1 Like

Cool, thank you and if they match (the sender and safe sender list) do I put them in to their own list? If I do that, do I have to initialise a new list?

Thanks so much! :slight_smile:

Cool, thank you. I didn’t know the class .attachments existed either so that’s really good

1 Like