在.NET Core中使用SMTP服务器发送电子邮件?

7
我想通过.net Core使用SMTP服务器发送电子邮件。
请解释一下。

1
https://www.stevejgordon.co.uk/how-to-send-emails-in-asp-net-core-1-0 - teo van kot
1个回答

19

通过 .net core 框架,目前还无法实现。

截至编写本文时,.net core 版本 1.1 实现了 .net standard 1.6。在那个时间点上,System.Net.Mail 还没有被移植。但正如您可以从此 pull request(https://github.com/dotnet/corefx/pull/12416)看到的那样,它似乎将会进入 .net Standard 2.0(很可能随后实现在 .net core 的下一个版本中)。

与此同时,似乎每个人都在使用 MailKit 库(https://github.com/jstedfast/MailKit),它运行得非常好!


1
记录一下:即使此 PR 已合并,官方 API 文档仍建议使用 MailKit 和 MimeKit 而非 SMTPClient API。 - Vogel612

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接