Unknown SMTP host exception...

Hi all...

am a newbie in j2ee...i have to send mails from my application...

have written the code...but it gives an error like the smtp host specified, is

unknown...

can anyone pleaz tell me what r the things to be set up or what r the configurations to be done to send a mail using program...am using Transport.send(message) function to do it...plz help me...

thanx and regards,

sand...

[430 byte] By [sandy@worka] at [2007-11-27 1:49:50]
# 1
See the JavaMail FAQ for tips on debugging connection problems.You might also want to try some of the simple demo programs thatcome with JavaMail to make sure you can get the basic configurationcorrect before moving on to your J2EE program.
bshannona at 2007-7-12 1:15:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Hi,

I am also getting the same error. I have gone through the FAQs and followed the same steps as they have mentioned there, but I still get the same error, I have tried with different smtp servers like gmail and yahoo but without any success..Someone please help.

Thanks in advance

asmita2005a at 2007-7-12 1:15:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Did you try the connection debugging tips? What did you try and what werethe results?
bshannona at 2007-7-12 1:15:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

Hi,

As mentioned in the debugging steps, I turned the debugging session on by "session.setDebug(true);".I got the following printed on my console:

DEBUG: setDebug: JavaMail version 1.4ea

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]

DEBUG SMTP: useEhlo true, useAuth false

DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 25, isSSL false

MessagingException

javax.mail.MessagingException: Unknown SMTP host: smtp.gmail.com;

nested exception is:

java.net.UnknownHostException: smtp.gmail.com

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1280)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)

at javax.mail.Service.connect(Service.java:275)

at javax.mail.Service.connect(Service.java:156)

at javax.mail.Service.connect(Service.java:105)

at javax.mail.Transport.send0(Transport.java:168)

at javax.mail.Transport.send(Transport.java:98)

at sendMail.main(sendMail.java:28)

Caused by: java.net.UnknownHostException: smtp.gmail.com

at java.net.PlainSocketImpl.connect(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)

at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)

... 7 more

I also tried to use telnet to connect as

telnet smtp.gmail.com 25

Here I got an output like

Connecting To smtp.gmsil.com...Could not open connection to the host, on port 25

: Connect failed

so now I donot understand wher the problem lies actually.

Can you please suggest anything?

Thanks

asmita2005a at 2007-7-12 1:15:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
The problem has nothing to do with JavaMail.Most likely you have a firewall on your machine or on your networkthat is preventing you from connecting. Talk to your networkadministrator.
bshannona at 2007-7-12 1:15:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6
can u explain pls how can i do in the network administrationRegardsMuthu
muthu2007a at 2007-7-12 1:15:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 7
Sorry, I know nothing about your environment so I can't tell youwho to talk to in your company or what software to modify orhow to modify it.
bshannona at 2007-7-12 1:15:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 8

m also gettin g the same error...

if neone can throw some light on it ..den it will of gr8 help !!

m workin on local dev environment and from here m trin to connect to the custiomer zone of ma client ofr a testing ...

but while submitting the form on the application site ...i got the following msgs on the ATG console ...

Exception while sending the mailcom.jnj.indp.site.common.exception.IndpException: Exception in sending e-mail, msg= Sending fai

nested exception is:

javax.mail.MessagingException: Unknown SMTP host: smtp.na.jnj.com;

nested exception is:

java.net.UnknownHostException: smtp.na.jnj.com, javax.mail.SendFailedException: Sending failed;

nested exception is:

javax.mail.MessagingException: Unknown SMTP host: smtp.na.jnj.com;

nested exception is:

java.net.UnknownHostException: smtp.na.jnj.com

hw can it b rectified ?

pashi_talrejaa at 2007-7-12 1:15:42 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 9
There is no host named "smtp.na.jnj.com".Have you typed the name incorrectly?Based on the number of typing errors in yourpost, I would say that's most likely.
bshannona at 2007-7-12 1:15:42 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...