将"SmtpClient.EnableSsl"设置为true的"System.Net.Mail.SmtpClient"需要哪些端口? [英] What ports does a 'System.Net.Mail.SmtpClient' need with 'SmtpClient.EnableSsl' set to true?
问题描述
如标题所示,将"SmtpClient :: EnableSsl"设置为true的"System :: Net :: Mail :: SmtpClient"需要哪些端口?
As the title says, what ports does an 'System::Net::Mail::SmtpClient' need with 'SmtpClient::EnableSsl' set to true?
EnableSsl属性上的文档说,替代连接方法的默认端口为465,但未提及支持支持的连接类型所使用的端口.
The documentation on the EnableSsl
property says the default port for an alternative connection method is 465 but doesn't mention what's used for the connection type it does support.
编辑-如果有所作为,则在这种情况下我将连接到Gmail,但欢迎使用通用答案.
Edit - If it makes a difference, I'm connecting to Gmail in this instance but generic answers would be welcome.
推荐答案
对Wireshark的快速测试表明,答案默认为端口25
A quick test with Wireshark suggested that the answer is port 25 by default
客户端使用STARTTLS重新使用最初未加密的链接以随后发送加密的数据.
The client uses STARTTLS to re-use an initially unencrypted link to subsequently send encrypted data.
这篇关于将"SmtpClient.EnableSsl"设置为true的"System.Net.Mail.SmtpClient"需要哪些端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!