What is the difference between System.Web.Mail
and System.Net.Mail
?
Allows applications to send email by using the Simple Mail Transfer Protocol (SMTP). The SmtpClient type is obsolete on some platforms and not recommended on others; for more information, see the Remarks section.
The System. Net.Mail classes are contained in the "System. dll" file. Make sure you have a reference to System listed under References in your project.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With