gpt4 book ai didi

imap - Limilabs IMAP 异常

转载 作者:行者123 更新时间:2023-12-01 02:14:06 29 4
gpt4 key购买 nike

我正在尝试使用 Limilabs imap 库连接到电子邮件;

  tcpc = new System.Net.Sockets.TcpClient("imap.gmail.com", 993);

工作正常 ;而 limilabs imap 没有
using (Imap imap = new Imap())
{
imap.Connect("imap.gmail.com", 993);

给出异常(exception):
Limilabs.Client.ServerException was unhandled
HResult=-2146233088
Message=Tried to read a line. No data received. Please make sure that antivirus and firewall software are disabled or configured correctly.
Source=Mail
StackTrace:
at   .()
at   .(MemoryStream )
at   .()
at Limilabs.Client.IMAP.ImapResponse.(Stream )
at Limilabs.Client.IMAP.Imap.(ImapResponse )
at Limilabs.Client.IMAP.Imap.(String , Boolean )
at Limilabs.Client.IMAP.Imap.ReceiveResponse(String tag)
at Limilabs.Client.IMAP.Imap.wqf45mzzsju7786nbrb2h8aclqm8jmnx    ()
at Limilabs.Client.ClientBase.Connect(String host, Int32 port, Boolean useSSL)
at Limilabs.Client.ClientBase.Connect(String host, Int32 port)
at ConsoleIMAP.Program.Main(String[] args) in c:\users\hmohamed\WcfServiceLibrary1\ConsoleIMP\Program.cs:line 136
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
HResult=-2146233088
Message=Tried to read a line. No data received.
Source=Mail
StackTrace:
at   .()
InnerException:

最佳答案

Limilabs imap.Connect 有一个重载来指定是否使用 SSL。它不会从您指定的端口推断它。您还可以使用 imap.ConnectSSL 方法。

有关更多信息,请参阅:
http://www.limilabs.com/blog/use-ssl-with-imap

关于imap - Limilabs IMAP 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26452999/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com