I have an email address in a mail message and in a datatable I have a list of ‘safe sender email addresses’. I need to loop through this datatable and if one of the email addresses matches the email address in mail message I need to break the for each loop. If at the end of looping through the whole data table, the email from the mail message isn’t found, then I need to create a business exception.
I can’t quite figure out the logic to do this. I guess I use a for each activity for each row in the datatable and then an IF statement in the for each loop with does the row contain the email address from the mail message. If it does then go to a ‘Break’ - I don’t know how to raise a business exception if loops through the whole data table and doesn’t find the email address?
Or any other way that you can think of that may be better?