After spending more time on this, I think all my comments are crap, and do not help to solve the issue at all. There is no way to understand what's happening without any debug info. When I use sendmail (as shown in http://forum.osticket.com/d/discussion//smtp-errors-when-using-authentication), I can enable debugging, and this is what I get:14/12/02 01 ** Connecting to smtp.server.com14/12/02 01 ** Connected.14/12/02 01 << 220 smtp.server.com Microsoft ESMTP MAIL Service ready at Tue, 2 Dec 2014 01 +0000<EOL>14/12/02 01 >> EHLO localhost.domain.com<EOL>14/12/02 01 << 250-smtp.server.com Hello <EOL>250-SIZE 52428800<EOL>250-PIPELINING<EOL>250-DSN<EOL>250-ENHANCEDSTATUSCODES<EOL>250-STARTTLS<EOL>250-AUTH GSSAPI NTLM<EOL>250-8BITMIME<EOL>250-BINARYMIME<EOL>250 CHUNKING<EOL>14/12/02 01 ** Authenticating as user@domain.com14/12/02 01 >> STARTTLS<EOL>14/12/02 01 << 220 2.0.0 SMTP server ready<EOL>14/12/02 01 >> EHLO localhost.domain.com<EOL>14/12/02 01 << 250-smtp.server.com Hello <EOL>250-SIZE 52428800<EOL>250-PIPELINING<EOL>250-DSN<EOL>250-ENHANCEDSTATUSCODES<EOL>250-AUTH GSSAPI NTLM LOGIN<EOL>250-8BITMIME<EOL>250-BINARYMIME<EOL>250 CHUNKING<EOL>14/12/02 01 >> AUTH LOGIN<EOL>14/12/02 01 << 334 some base-64 data<EOL>14/12/02 01 >> more data<EOL>14/12/02 01 << 334 data<EOL>14/12/02 01 >> data<EOL>14/12/02 01 << 235 2.7.0 Authentication successful<EOL>14/12/02 01 >> MAIL FROM: <user@domain.com><EOL>14/12/02 01 << 250 2.1.0 Sender OK<EOL>14/12/02 01 >> RCPT TO: <maya.vybornykh@gmail.com><EOL>14/12/02 01 << 250 2.1.5 Recipient OK<EOL>The code in the SMTP.php seems to be doing the same, except that I am not quite sure why enableCrypto() fails, and what sendmail does to enable encryption, and whether it is needed at all.What I am trying to say is that the SMTP server is configured all right and works if sending e-mails using sendmail, and does not if using Net_SMTP. I am back to using sendmail :(