c# - 无法从传输连接 IMAP 读取数据

标签 c# sockets ssl tcp imap

我在 C# 中使用 IMap 从 gmail 中读取邮件。我在同一个邮箱上创建了多个(五个)TCP 连接以加快数据读取速度。 Google 允许 15 个邮箱同时存在

https://support.google.com/mail/answer/97150?hl=en

但是我在读取数据时遇到了错误

SslStream.Read(byte[] buffer, int offset, int count);

说“无法从传输连接读取数据:现有连接被远程主机强行关闭。”。

我使用以下设置供您引用

imap.gmail.com 端口:993

完整的堆栈跟踪如下

: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.

错误2015-07-10

05:46:43 – Stack Strace :: at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Security._SslStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count) at CDT.WebMailReader.CloudMailReader.receiveResponse(ReceiveResponseParams responseParams)

我在很多论坛上检查了解决方案,但没有得到任何解决方案。有人可以为它提出解决方案吗。

提前致谢

马尤什

最佳答案

尝试使用143端口连接。 如果问题依旧,请检查您的网络环境

关于c# - 无法从传输连接 IMAP 读取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31342786/

相关文章:

c# - 循环中的匿名 c# 委托(delegate)

c# - Xamarin 表单 HttpClient GetAsync

c# - 如何从 DataTemplate 获取 XAML 控件的值

c++ - 在完成端口调用 WSASend()?

java - Tomcat 6.0 应用程序中的内存泄漏

c# - VSTO word 加载项获取 docx 作为字节数组

python - 通过python中的原始套接字发送scapy数据包

javax.net.ssl.SSLHandshakeException :PKIX path building failed: sun. security.provider.certpath.SunCertPathBuilderException:

python - 使用 pip3 安装软件包时出现 "ssl module in Python is not available"

ruby-on-rails - ruby on rails 中的 Options 指令禁止目录索引