Java_nuB
Java_nuB

Reputation: 39

Connection to MS Exchange server using JavaMail hangs

(If this is a duplicate question, please send me a link to the appropriate thread.)

I wrote a Java program using JavaMail API to send an email to several users through Gmail and it worked perfectly. However, when I tried to use the same code (with slight modification) to use MS Exchange Server to send emails, the program hangs.

It did not throw any exceptions, so I am assuming that it is able to make the connection. (I had tried using other ports or wrong SMTP address and it gave me a 'Connection refused' exception.)

This was the last statement and the program does not terminate after that:

[DEBUG SMTP: trying to connect to host "[xxx.yyy.com]", port 135, isSSL false]

Please understand that I do not need help with the code, but I just want to understand what's going on.

I appreciate your time.

Upvotes: 0

Views: 1253

Answers (1)

dkarp
dkarp

Reputation: 14763

You need to connect to port 25 for SMTP, not port 135. (SMTPs is port 465.)

Upvotes: 1

Related Questions