This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Unable to send email from gmail ...Could not connect to SMTP host: smtp.gmail.com, port: 465; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unable to send email from gmail ...Could not connect to SMTP host: smtp.gmail.com, port: 465;" Watch "Unable to send email from gmail ...Could not connect to SMTP host: smtp.gmail.com, port: 465;" New topic
Author

Unable to send email from gmail ...Could not connect to SMTP host: smtp.gmail.com, port: 465;

Vinod Vinu
Ranch Hand

Joined: Aug 30, 2009
Posts: 217
Hi, i'm unable to send emails to various receipents from the gmail id.




Error:-
DEBUG: setDebug: JavaMail version 1.4.3
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
host: smtp.gmail.com
username: vinod827@gmail.com
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL false
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1706)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:525)
at javax.mail.Service.connect(Service.java:291)
at javax.mail.Service.connect(Service.java:172)
at sample.SendMail.sendMail(SendMail.java:76)
at sample.SendMail.main(SendMail.java:24)
Caused by: java.net.ConnectException: Connection timed out: 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 com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:284)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:201)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1672)
... 5 more


I have no idea where i'm doing the mistake, i tried alot. please tell me to rectify it.
thanks in advance

Vinod Kumar Nair
"Any fool can write code that a computer can understan. Good programmers write code that humans can understand."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to send email from gmail ...Could not connect to SMTP host: smtp.gmail.com, port: 465;
 
Similar Threads
problem in mailing with smtp server
Unknown SMTP host for gmail
send email using gmail account
Error in sending mail using ssl server
Java Mail