dcsimg
unable to send java message
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ANKIT_singhal
Posted On:   Wednesday, September 9, 2009 09:17 AM

i m unable to send messages i m getting error could not connect to host. i also tried code given at your site as it is without any change but still the problem is same please check the problem C:Documents and SettingsANKITDesktop>java -cp "C:Program Filesglassfish-v2. 1lib";"C:java prgsjava-mailjavamail-1.4.1mail.jar";"C:documents and settin gsankitdesktop" MailExample smtp.gmail.com singhal.ankit9@gmail.com ankitsingh al89@yahoo.co.in Exception in thread "main" javax.mail.MessagingException: Could not connect to S MTP host: smtp.gmail.com, port: 25; nested exception is: java.net.SocketExceptio   More>>

i m unable to send messages


i m getting error could not connect to host.


i also tried code given at your site as it is without any change
but still the problem is same



please check the problem


C:Documents and SettingsANKITDesktop>java -cp "C:Program Filesglassfish-v2.
1lib";"C:java prgsjava-mailjavamail-1.4.1mail.jar";"C:documents and settin
gsankitdesktop" MailExample smtp.gmail.com singhal.ankit9@gmail.com ankitsingh
al89@yahoo.co.in


Exception in thread "main" javax.mail.MessagingException: Could not connect to S
MTP host: smtp.gmail.com, port: 25;
nested exception is:
java.net.SocketException: Invalid argument: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:41
2)
at javax.mail.Service.connect(Service.java:288)
at javax.mail.Service.connect(Service.java:169)
at javax.mail.Service.connect(Service.java:118)
at javax.mail.Transport.send0(Transport.java:188)
at javax.mail.Transport.send(Transport.java:118)
at MailExample.main(MailExample.java:37)
Caused by: java.net.SocketException: Invalid argument: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
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:233)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1359)
... 7 more

C:Documents and SettingsANKITDesktop>    <<Less
About | Sitemap | Contact