文件名称:pop3
介绍说明--下载内容均来自于网络,请自行研究使用
收邮件的协议有两种,一种是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
{
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
(系统自动生成,下载前可以参看下载内容)
下载文件列表
pop3.docx