SeanZhang2012
SeanZhang2012

Reputation: 31

Exchange transport agent to check senders of email message

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

Answers (1)

Brian Desmond
Brian Desmond

Reputation: 4503

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

Upvotes: 1

Related Questions