Jump to content

[Solved] Could Not Connect To Smtp Host Smtp.google.com, Port:587


jimmykd

Recommended Posts

I am creating a mailing system in java web application, using google SMTP .

 

but it shows this:

 

HTTP Status 500 - javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

type Exception report

message javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.RuntimeException: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
nested exception is:
java.net.ConnectException: Connection refused (Connection refused)
com.SendVerification.SendMail(SendVerification.java:50)
com.Register.doPost(Register.java:72)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
nested exception is:
java.net.ConnectException: Connection refused (Connection refused)
com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961)
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
javax.mail.Service.connect(Service.java:317)
javax.mail.Service.connect(Service.java:176)
javax.mail.Service.connect(Service.java:125)
javax.mail.Transport.send0(Transport.java:253)
javax.mail.Transport.send(Transport.java:124)
com.SendVerification.SendMail(SendVerification.java:45)
com.Register.doPost(Register.java:72)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.net.ConnectException: Connection refused (Connection refused)
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
java.net.Socket.connect(Socket.java:589)
java.net.Socket.connect(Socket.java:538)
com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:299)
com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:234)
com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
javax.mail.Service.connect(Service.java:317)
javax.mail.Service.connect(Service.java:176)
javax.mail.Service.connect(Service.java:125)
javax.mail.Transport.send0(Transport.java:253)
javax.mail.Transport.send(Transport.java:124)
com.SendVerification.SendMail(SendVerification.java:45)
com.Register.doPost(Register.java:72)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note The full stack trace of the root cause is available in the Apache Tomcat/8.5.4 logs.

please help.....

 

 

Link to comment
Share on other sites

I just tested the outbound port 587 connection to 173.194.202.108 and 173.194.202.109 from Tommy and they both work. Does it help if you specify the IP directly?

He needs to enable unsecure application logins in his security settings. This is not a problem with heliohost or Google domains.

Link to comment
Share on other sites

I am creating a mailing system in java web application, using google SMTP .

 

I also tried ip : 173.194.202.108 and 173.194.202.109.

This two are also not working...

Showing same problem...

 

But all this are working in my pc localhost

 

but it shows this:

 

HTTP Status 500 - javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

 

type Exception report

message javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

description The server encountered an internal error that prevented it from fulfilling this request.

exception

 

java.lang.RuntimeException: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

nested exception is:

java.net.ConnectException: Connection refused (Connection refused)

com.SendVerification.SendMail(SendVerification.java:50)

com.Register.doPost(Register.java:72)

javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

nested exception is:

java.net.ConnectException: Connection refused (Connection refused)

com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961)

com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)

javax.mail.Service.connect(Service.java:317)

javax.mail.Service.connect(Service.java:176)

javax.mail.Service.connect(Service.java:125)

javax.mail.Transport.send0(Transport.java:253)

javax.mail.Transport.send(Transport.java:124)

com.SendVerification.SendMail(SendVerification.java:45)

com.Register.doPost(Register.java:72)

javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.net.ConnectException: Connection refused (Connection refused)

java.net.PlainSocketImpl.socketConnect(Native Method)

java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

java.net.Socket.connect(Socket.java:589)

java.net.Socket.connect(Socket.java:538)

com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:299)

com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:234)

com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)

com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)

javax.mail.Service.connect(Service.java:317)

javax.mail.Service.connect(Service.java:176)

javax.mail.Service.connect(Service.java:125)

javax.mail.Transport.send0(Transport.java:253)

javax.mail.Transport.send(Transport.java:124)

com.SendVerification.SendMail(SendVerification.java:45)

com.Register.doPost(Register.java:72)

javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note The full stack trace of the root cause is available in the Apache Tomcat/8.5.4 logs.

 

 

please help.....

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...