EAGetMail:无法与Gmail POP3连接 [英] EAGetMail : Unable to connect with Gmail POP3

查看:125
本文介绍了EAGetMail:无法与Gmail POP3连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码使用POP3协议与GMAIL连接,但每次我收到的错误都被解读为:现有连接被远程主机强行关闭。



注意:我正在使用EAGetMail程序集



我在IndependentSoft上尝试了这个并且我能够连接,但它总是向我抛出异常使用EAGetMail。



请帮助........





I am using the below code to connect with GMAIL using POP3 protocol but everytime I am getting an error which is read as : "An existing connection was forcibly closed by the remote host."

NOTE : I am using EAGetMail assembly

I have tried this with IndependentSoft and I was able to connect, but it always throw exception to me using EAGetMail.

Please help ........


MailServer oServer = new MailServer("pop.gmail.com", "username@gmail.com", "pwd1234", ServerProtocol.Pop3);
MailClient oClient = new MailClient("TryIt");
oServer.SSLConnection = true;
oServer.Port = 995;
try
{
    oClient.Connect(oServer);
    MailInfo[] infos = oClient.GetMailInfos();
    Console.WriteLine(infos.Length);
    for (int i = 0; i < infos.Length; i++)
    {
        MailInfo info = infos[i];
        Mail oMail = oClient.GetMail(info);
         
        Console.WriteLine("From: {0}", oMail.From.ToString());
        //oClient.Delete(info);
    }
    oClient.Quit();
}
catch (Exception ep)
{
    Console.WriteLine(ep.Message);
}

推荐答案

这篇关于EAGetMail:无法与Gmail POP3连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆