Reputation: 31
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";
Upvotes: 1
Views: 567
Reputation: 4503
You're probably going to want to use a HashSet instead for this to work...
Upvotes: 1