8

What is the difference between System.Web.Mail and System.Net.Mail?

Martijn
  • 11,964
  • 12
  • 50
  • 96
Nithesh Narayanan
  • 11,481
  • 34
  • 98
  • 138
  • 2
    Did you read the documentation? Seriously. if you ask waht is better etc- that is worthy an answer. Going through the classes item by item to find the difference is your homework with your copy of the documentation. – TomTom Apr 11 '11 at 07:31
  • system.net.mail came in with 2.0, so system.web.mail is the only option if you are using less than 2.0 – V4Vendetta Apr 11 '11 at 07:42
  • this stack-overflow thread may helps: http://stackoverflow.com/questions/64599/net-system-web-mail-vs-system-net-mail – Mandoleen Nov 02 '11 at 11:35

2 Answers2

15
  • System.Web.Mail was in .NET Framework v1.1

  • System.Net.Mail is in .NET Framework v2.0 onwards

They are both used for the same purpose. If you use System.Web.Mail it only shows a warning, saying this is deprecated. It still works as supposed to.

If you are really using higher version (2.0 or later) of .NET framework, then use System.Net.Mail.

broadband
  • 3,266
  • 6
  • 43
  • 73
Nirmal
  • 1,223
  • 18
  • 32
12

First line in MSDN for the System.Web.Mail namespace:

The classes in this namespace have been deprecated. Use the System.Net.Mail namespace instead

Josh Darnell
  • 11,304
  • 9
  • 38
  • 66
jgauffin
  • 99,844
  • 45
  • 235
  • 372