smtp.explore人工智能网
smtp.explore ai.net (2024-04-19, Others, 0KB, 下载0次)
The .NET Framework does not offer POP3 or MIME support. For those of you who need it, this article provides support for both POP3 and MIME. This article s intent is not to get into the details of POP3 or MIME. Instead the article focuses on how to use the classes I ve provided and finally the internals of the classes in case you d like to do some tweaking. I ve successfully tested the classes on both Yahoo and Gmail throughout development.
The .NET Framework does not offer POP3 or MIME support. For those of you who need it, this article provides support for both POP3 and MIME. This article s intent is not to get into the details of POP3 or MIME. Instead the article focuses on how to use the classes I ve provided and finally the internals of the classes in case you d like to do some tweaking. I ve successfully tested the classes on both Yahoo and Gmail throughout development. (2011-01-17, Others, 335KB, 下载3次)
收邮件的协议有两种,一种是POP3,另外一种较为高级的协议是IMAP4,有的邮箱使用的是POP3协议,比如网易163免费邮箱、新浪免费邮箱、搜狐免费邮箱,有的邮箱使用的是IMAP4协议,比如Gmail免费邮箱,有的两种都可以,比如QQ邮箱。这些免费邮箱都需要做一些设置(例如选择开启 POP3)才能开启从客户端(比如自己做的接收邮件的程序)接收邮件的功能
private Pop3ConnectionState Connect(string host, int port, SslHandShake sslHandShake, bool ssl)
{
OnConnecting()
this._host = host
this._port = port
this._ssl = ssl
this._tcpClient = this.GetTcpClient(host, port)
if (this._tcpClient == null)
{
return Pop3ConnectionState.DISCONNECTED
}
this._stream = _tcpClient.GetStream()
if (ssl)
{
//do ssl handshake
if (sslHandShake == null) sslHandShake = new SslHandShake(host)
DoSslHandShake(sslHandShake)
if (_sslStream == null || _sslStream.IsAuthenticated == false)
{
this._connectionState = Pop3ConnectionState.DISCONNECTED
this._tcpClient = null
return this._connectionState
}
this._st (2010-06-25, Others, 532KB, 下载9次)