0 votes

I just downloaded limilabs mail to try out to use imap to connect to outlook 365. It seems not getting any response. When I ping the outlook.office365.com from command prompt, it got response. Not sure what goes wrong. Please help if you have any idea. Thanks!

Sub Main()
    Console.WriteLine("Starting...")

    Using imap As New Imap
        Console.WriteLine("Connecting...")
        imap.ConnectSSL("outlook.office365.com", 993)
        Console.WriteLine("Connected...")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Limilabs.Client.ServerException was unhandled
HResult=-2146233088
Message=A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 40.100.2.114:993
Source=Mail
StackTrace:
at Limilabs.Client.ClientBase.Connect(String host, Int32 port, Boolean useSSL)
at Limilabs.Client.ClientBase.ConnectSSL(String host, Int32 port)
at ConsoleApplication5.Module1.Main() in C:\Users\erickwong\documents\visual studio 2010\Projects\ConsoleApplication5\ConsoleApplication5\Module1.vb:line 17
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: System.Net.Sockets.SocketException
ErrorCode=10060
HResult=-2147467259
Message=A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 40.100.2.114:993
NativeErrorCode=10060
Source=System
StackTrace:
at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port)
at System.Net.Sockets.Socket.Connect(String host, Int32 port)
at Limilabs.Client.ClientBase.Connect(String host, Int32 port, Boolean useSSL)
InnerException:

by

1 Answer

0 votes

I just checked, and I have no problems connecting. Please check your firewall settings.

Here's my code:

using (Imap imap = new Imap())
{
    imap.ConnectSSL("outlook.office365.com");

    imap.Close();
}

....and the logs:

Connecting to 'outlook.office365.com:993', SSL/TLS: True.
S: * OK The Microsoft Exchange IMAP4 service is ready. [QQ...A==]
C: 72570000 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
S: 72570000 OK CAPABILITY completed.
C: 72570001 ID ("name" "Mail.dll" "version" "3.0.19239.1745" "vendor" "www.limilabs.com" "contact" "support@limilabs.com")
S: * ID ("name" "Microsoft.Exchange.Imap4.Imap4Server" "version" "15.20")
S: 72570001 OK ID completed
C: 72570002 LOGOUT
S: * BYE Microsoft Exchange Server IMAP4 server signing off.
S: 72570002 OK LOGOUT completed.

I also tried using this IP address - no problems (apart from an obvious certificate error, as the connection was done using IP address and not DNS name).

by (297k points)
...