2017-04-20 103 views
8

几天前我访问了blog,表示System.Net.Mail.SmtpClient已过时,开放源代码库MailKitMimeKit正在取代它。System.Net.Mail.SmtpClient在4.7中已经过时了吗?

我可以看到docs,但在reference code和库中找不到。它是否过时?

[System.Obsolete("SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead")] public class SmtpClient : IDisposable

+6

[System.Net.Mail.SmtpClient在文档中被标记为废弃,但在源代码中不存在](https://github.com/dotnet/docs/issues/1876) – stuartd

+0

似乎很可能(请参阅以前的评论)这是一个文档错误。 – Richard

+0

它不是“MSDN”文档,而是新的Microsoft Docs。这足以说明大多数情况下是否有任何东西过时,因为文档与源文件是分开的,并且可以更新以更新以反映最新的更改。微软计划将文档恢复到源文件,但进展并不像所有人希望的那么快。 –

回答

7

我们推荐使用开源解决方案,如MailKit代替SmtpClient,是的。它在库中没有被标记为过时的原因是.NET框架本身没有替代品。

+0

**所有我可以使用**'SmtpClient',***我可以使用MailKit - MimeKit *** – Kiquenet

相关问题