Email (SMTP) TLS failures

I'm trying to set up Email notifications for builds. I currently have a hosted Exchange Server which has IMAP/SMTP functionality enabled.

The hosted Exchange server requires TSL (SSL) SMTP authentication and uses a non-standard port. When I set these values in Administration->Server Configuration->Edit Email Notifier Settings, and test the connection, I get an error:

"Connection Failed!

javax.mail.MessagingException: Could not connect to SMTP host: mail.******.com, port: ***;
nested exception is: Couldn't connect using "" socket factory to host, port: mail.*******.com, ***; Exception: java.lang.reflect.InvocationTargetException"


Comment actions Permalink

Can you please try, whether other java-based mail clients can work with your server?
I.e Columba ( or Pooka (
Both can be launched via java web start.

Comment actions Permalink

I'm seeing the same issues. Sending emails directly to the hosted Exchange server is failing.

- If I turn off TLS (SSL) I get an error "javax.mail.MessagingException: 530 5.7.1 Client was not authenticated"
- If I turn on TLS (SSL) I get an error "javax.mail.MessagingException: Could not connect to SMTP host: <host>, port: 25

I did two tests on my system:

Test 1 - Local SMTP Server

- If I configure a local SMTP server that does not require TLS (SSL) then I can send emails OK. However, my company exchange server rejects my emails due to unknown IP address. Also, I prefer not to run an ad-hoc SMTP server on the machine.

This indicates to me that basic email sending can work.

Test 2 - Open SSL

I used OpenSSL to test the connection to my exchange server.
I connected, from the same machine using the following command:

  • openssl s_client -starttls smtp -crlf -connect
  • I then followed normal STMP commands to send an email.
  • User name (in 64-bit encoding)
  • Password (in 64-bit encoding)
  • Email body
  • the character '.'

The test was successful and I received an email.


I saw a posting here: that recommended changing bean configuration values. However the posting does not match the installation directory I see with my TeamCity version 5.0

I'll be very happy for any help on this issue.


Comment actions Permalink

Further discussion of the last post can be found in the issue tracker:


Please sign in to leave a comment.