+1 vote

I am trying to create an email client using Mail.dll for multiple Smtp and Imap providers. Gmail takes about 2 seconds atleast to login to its Smtp and Imap server which I already assume is slow.

I am trying to setup smtp.office365.com on port 587 by setting StartTLS to true.
But the logging into Office365 servers is way slower and takes atleast 10 to 20 seconds.

I am sure there is no issue with my internet connection.
Is there anything i can do to accelerate the login process?
I hope to get a solution that works effectively(with gmail and other smtp/imap servers too).

Thanks.

by (1.2k points)

1 Answer

0 votes

I don't think this is Mail.dll problem, especially if Gmail is several times faster.

On my machine (located in Europe) whole sequence:

  • Connect using SSL/TLS,
  • Login,
  • Close and disconnect

takes 1.3 - 2.1 seconds for Gmail,
and 1.5 - 2.8 seconds for Outlook.com.
and 1.6 - 2.8 seconds for Office365 (pod51009).

My question is what takes most time: ConnectSSL or UseBestLogin?

There is also a good chance that email provider is slowing you down on purpose (you send too many emails for example).

by (297k points)
ConnectSSL takes about a second.
Its UseBestLogin which is taking so much time.
I tried using just the Login method. It takes same amount of time still. Also I do not send too many emails either.

Thank you for the response.
When SSL is on UseBestLogin performs same IMAP command sequence that Login does.

Both don't download anything from the server.

My opinion is you should prepare a log (each entry has time noted): https://www.limilabs.com/blog/logging-in-mail-dll and contact Office365 support.
...