difference between System.Web.Mail and System.Net.Mail

  • What is difference between System.Web.Mail and System.Net.Mail  namespace?
  • What is use of both ?
10/9/2007 4:59:21 AM
asp.net.getting-started 91979 articles. 4 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 52
Get it on Google Play
Get it on Apple App Store

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

System.Net.Mail is in .NET Framework v2.0 and greater

Same use, although there is more functionality in System.Net.Mail since it is a later version of the framework. 

Darrell Norton, MVP
Darrell Norton's Blog

Please mark this post as answered if it helped you!
10/9/2007 1:19:57 PM

 What All-Star said.

I assume the reason it was moved to a different namespace is because the internet is actually a suite of technologies: e-mail, ftp, http (web), etc. E-mail and the world wide web are two completely different technologies, so e-mail should not be filed under "Web." (E-mail was around way before the world wide web was!)

 If you try to use System.Web.Mail in ASP.NET 2.0 (or later) you'll get a warning telling you that the items in that namespace have been depreciated and to use System.Net.Mail instead. However, the last time I checked System.Web.Mail still "works."

Justin Holton
10/9/2007 2:10:56 PM

From the System.Net.Mail FAQ - http://www.systemnetmail.com/faq/1.1.aspx
"Unlike System.Web.Mail, which was introduced in the 1.0 Framework, it is not built upon the CDO/CDOSYS libraries. Instead it is written from the ground up without any interop. Thus, it is not dependant upon other COM libraries.  System.Net.Mail introduces brand new classes for creating and sending email.

Although some functionality has been removed, the new System.Net.Mail namespace is much more versatile than the older CDO dependant System.Web.Mail

M.V. 'Anil' Radhakrishna
Web Development Tips, Tricks & Trivia | My Code Gallery

Recent article - How To Create a Custom IE8 Accelerator

10/10/2007 12:06:23 PM


 Sorry, I'm having a prob..... 

why i'm getting an error ( Access denied ) when i was using net.mail instead of web.mail for my mail attachments, which are being gathered from listbox as listitems (Path). In web.mail this is working fine.......plz help me........Thanks in advance.


10/22/2007 12:54:34 PM