通过IMAP访问Gmail [英] Accessing Gmail Via IMAP
本文介绍了通过IMAP访问Gmail的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Guys,
我试图通过imap阅读gmail电子邮件,但每当我连接到imap然后我都会收到此错误
现有连接被远程主机强行关闭
这里是我的代码
Imap4Client imap = new Imap4Client();
imap.Connecting + = new ConnectingEventHandler(imap_Connecting);
imap.Connected + = new ConnectedEventHandler(imap_Connected);
imap.ConnectSsl(imap.gmail.com,993);
imap.Login(xxxxx@gmail.com,xxxxxxx);
int mailboxCount = imap.Mailboxes.Count;
imap.Disconnect();
目前我正在使用codeplex的mailsystem.net API。你能告诉我我做错了吗。
谢谢
解决方案
这可能是防火墙问题,或者您与服务器连接太多。
查看以下链接一次
< a href =http://forums.asp.net/t/1440964.aspx> http://forums.asp.net/t/1440964.aspx [ ^ ]
您可以参考这篇文章。 使用IMAP附件下载邮件详细信息 [ ^ ]
您可以使用Imapx Libraries.Using这些库为我工作。我相信IMAP中最好的一个。
http://imapx.codeplex.com/ [ ^ ]
如果您使用这些类型的dll并连接到Gmail服务器,则可能是您的组织防火墙阻止了入站和出站呼叫。这也可能是因为您的代理设置。建议您在组织中发送网络支持服务单:)
Hello Guys,
I am trying to read gmail emails via imap but whenever I connect to imap then I will get this error
An existing connection was forcibly closed by the remote host
Here is my code
Imap4Client imap = new Imap4Client();
imap.Connecting += new ConnectingEventHandler(imap_Connecting);
imap.Connected += new ConnectedEventHandler(imap_Connected);
imap.ConnectSsl("imap.gmail.com", 993);
imap.Login("xxxxx@gmail.com", "xxxxxxx");
int mailboxCount = imap.Mailboxes.Count;
imap.Disconnect();
Currently I am using mailsystem.net API from codeplex. Can you guys tell me what i am doing wrong.
Thanks
解决方案
It could be firewall problem, or you have made too many connections to the server.
Check the below link once
http://forums.asp.net/t/1440964.aspx[^]
You can refer this article. Download Mail Details With attachment using IMAP[^]
You can use Imapx Libraries.Using these libraries worked for me.The best one in IMAP i believe.
http://imapx.codeplex.com/[^]
If you are using these type of dlls and connecting to Gmail server then may be your organization firewall is blocking the inbound and outbound calls.This might be also because of your proxy settings.Recommends you to send a network support ticket in your organization:)
这篇关于通过IMAP访问Gmail的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文