Outlook - System.Net.Mail vs System.Web.Mail

Hi, I am retrieving a List of email messages from Outlook using Get Outlook Mail Messages. Next I want to iterate through the List.

I see here there are two object types for MailMessage. One is System.Net.Mail and the other is System.Web.Mail.

Which one should I use and when should I use each variation of MailMessage?


The type of output of Get Outlook Mail Messages is System.Net.Mail list.


System.Web.Mail was in .NET Framework v1.1 - Older Version
System.Net.Mail is in .NET Framework v2.0 onwards - New Version

They both serves same purpose. For System.Web.Mail you will receive warning, saying this is deprecated.

We are using greater version than 2.0 - .NET framework, So suggest you to use System.Net.Mail.