system.web.mail vs system.net.mail [复制]

时间:2022-09-24 08:25:23

This question already has an answer here:

这个问题在这里已有答案:

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

System.Web.Mail和System.Net.Mail有什么区别?

2 个解决方案

#1


15  

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

    System.Web.Mail位于.NET Framework v1.1中

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

    System.Net.Mail在.NET Framework v2.0及更高版本中

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.

它们都用于相同的目的。如果你使用System.Web.Mail它只显示一个警告,说这是不推荐使用的。它仍然可以正常工作。

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

如果您确实使用的是更高版本(2.0或更高版本)的.NET框架,请使用System.Net.Mail。

#2


12  

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

MSDN中System.Web.Mail命名空间的第一行:

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

此名称空间中的类已被弃用。请改用System.Net.Mail名称空间

#1


15  

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

    System.Web.Mail位于.NET Framework v1.1中

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

    System.Net.Mail在.NET Framework v2.0及更高版本中

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.

它们都用于相同的目的。如果你使用System.Web.Mail它只显示一个警告,说这是不推荐使用的。它仍然可以正常工作。

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

如果您确实使用的是更高版本(2.0或更高版本)的.NET框架,请使用System.Net.Mail。

#2


12  

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

MSDN中System.Web.Mail命名空间的第一行:

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

此名称空间中的类已被弃用。请改用System.Net.Mail名称空间