Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Sending email from my web application

  Asked By: Bryant    Date: Nov 05    Category: Java    Views: 1745

I want to tell you that maintain the session problem was a user
cache problem , and when i prevent the caching by HTML code the
problem is solved

I wish to know how to send an email to the user from a web

specifically , i got an example function but has a parameter:

"the name of a host that provide SMTP service for your network"

wut is that supposed to be!!??

and which port number i should use??

the error mesg I got:
"javax.mail.MessagingException: Could not connect to SMTP host:
localhost, port: 8080;"



4 Answers Found

Answer #1    Answered By: Jeanne Lawson     Answered On: Nov 05

You need to configure the Java mail to talk to a mail server. I doubt you have mail server on your local machine. Moreover, Mail servers usually accept SMTP connections through 25 port.

Answer #2    Answered By: Reamonn Fischer     Answered On: Nov 05

if you use Spring, you can send email  by it Classes.
Firstly, you must set some beans as you can see below:

<bean id="mailSender"
<property name="host" value="${hostname}"/>
<property name="username"
<property name="password"
<property name="port" value="25"/>

<bean id="mailMessage"
<property name="from"

after that, you must call them in your Service tier
and enjoy it. So easy

Answer #3    Answered By: Aaron Evans     Answered On: Nov 05

If u r using outlook in office to check mails......its easy to find this.

open outlook... goto Tools...account
here in properties..check server IP..its ur smtp  server.
and port is 25 for smtp..!!

Answer #4    Answered By: Salvatore Kelly     Answered On: Nov 05

u can use google smtp  server for test. it's free.
set host  = smtp.gmail.com and port = 465.
make a new account in gmail and set username and
password to it.
set auth = true.
set sslsocketfatory = true.
u can find samples about it in internet.

Didn't find what you were looking for? Find more on Sending email from my web application Or get search suggestion and latest updates.