The moose likes Other JSE/JEE APIs and the fly likes About Port number in JavaMail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "About Port number in JavaMail " Watch "About Port number in JavaMail " New topic

About Port number in JavaMail

Chanakya Gupta
Ranch Hand

Joined: May 23, 2010
Posts: 37

Help us solve this.

We have a web application hosted on tomcat-7, say
this is Server-A. This web application is sending an
email from GMail SMTP host to the users email address.

The below code are the Properties settings.

Our doubt is, why this code works fine only when
the port 465 is open on Server-A. We understand
from the JavaMail docs that 465 pertains to the
port on Why 465 to be open on
Server-A when it is not sending any emails ?

Thank you in advance.

Chanakya Gupta
Ranch Hand

Joined: May 23, 2010
Posts: 37

After some search, got this satisfactory
answer from Wikipedia. Thank you all
for your patience. Quoting the answer
from Wikipedia.
...While electronic mail servers and other
mail transfer agents use SMTP to send
and receive mail messages, user-level
client mail applications
typically use SMTP
only for sending messages to a mail server
for relaying....

Since, our web application is user-level client
mail application
it uses SMTP and hence port
465 is to be opened.
I agree. Here's the link:
subject: About Port number in JavaMail
jQuery in Action, 3rd edition