cURL / Mailing Lists / curl-library / Single Mail


RE: SMTP with TLS error handling

From: Jamie Gordon <>
Date: Fri, 5 Jun 2015 09:38:45 +0000

I checked with a separate simpler test program using the sample code as an example.

It seems the problem is caused because I called CURLOPT_CONNECTTIMEOUT, and I was using 5 seconds. What threw me was that if the host is unreachable you get the correct error "Operation timed out after 5000 milliseconds", so it was the "...timed out after 0 milliseconds..." that threw me and I figured it wasn't related to that setting.

I suppose what is happening is when invalid credentials are supplied to Office365, it must take more than 5 seconds to return that the credentials were invalid, whereas the Google servers must be slightly faster. If I increase the timeout then I also get CURLE_LOGIN_DENIED with Office365.

So I guess it's just a quirk of timing out whilst it's still attempting to login.


List admin:
Received on 2015-06-05