Exchange transport agent to check senders of email message

556 Views Asked by At

I would like to write an Exchange transport agent to check email message senders against a text file and based on that change email subject line. What would be C# code to check email senders? Should it be something like this?

List<RoutingAddress> emails = new List<RoutingAddress>();
RoutingAddress john = new RoutingAddress("[email protected]");
emails.Add(john);
     if (emails.Contains(e.MailItem.FromAddress))
         e.MailItem.Message.Subject = "EmailGroup1";
1

There are 1 best solutions below

0
On

You're probably going to want to use a HashSet instead for this to work...