C# ASP.NET 通过 TLS 发送电子邮件
为了遵守 HIPAA 法规,我们需要从外部站点(防火墙之外)发送电子邮件) 到内部 Exchange 服务器(在防火墙内)。我们的 Exchange 管理员告诉我们,我们需要使用 TLS 加密将邮件从 Web 服务器发送到电子邮件服务器。
我以前从未使用过 TLS,对它也不是很熟悉。在 Google 上搜索会出现许多付费使用的库。 .NET 是否有任何原生工具可以实现此目的?如果是这样,我该如何配置它?如果没有,有免费或开源的东西吗?
当前配置:
- ASP.NET C# Web 应用程序
- 2.0 框架
- 使用 System.Net.Mail 通过 SMTP 发送电子邮件和附件
- IIS 6.0
In order to comply with HIPAA regulations, we need to send email from an external site (outside the firewall) to an internal Exchange server (inside the firewall). Our Exchange admins tell us we need to use TLS encryption to send mail from the web server to the email server.
I've never used TLS before and I'm not very familiar with it. Searching on Google as brought up numerous paid-for-use libraries. Is there anything native to .NET that will accomplish this? If so, how do I configure it? If not, is there something free or open source?
Current Configuration:
- ASP.NET C# Web Application
- 2.0 Framework
- Using System.Net.Mail to send email and attachments via SMTP
- IIS 6.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
TLS(传输层安全性)是一个稍微宽泛的术语,它在保护 HTTP 通信方面取代了 SSL(安全套接字层)。因此,您需要做的是启用 SSL。
TLS (Transport Level Security) is the slightly broader term that has replaced SSL (Secure Sockets Layer) in securing HTTP communications. So what you are being asked to do is enable SSL.
在 SmtpClient 上,您可以设置一个 EnableSsl 属性。
IE
On SmtpClient there is an EnableSsl property that you would set.
i.e.
我几乎使用了与您相同的技术,但是我使用我的应用程序通过 WinForms 上的 Office 365 平台连接 Exchange Server。我也遇到了与您相同的问题,但能够通过使用对其他人上面给出的内容进行轻微修改的代码来完成。
我必须使用端口 587,这当然是 TSL 上的默认端口,并且进行了身份验证。
I was almost using the same technology as you did, however I was using my app to connect an Exchange Server via Office 365 platform on WinForms. I too had the same issue as you did, but was able to accomplish by using code which has slight modification of what others have given above.
I had to use the Port 587, which is of course the default port over TSL and the did the authentication.