jimmykd Posted October 18, 2017 Posted October 18, 2017 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 reportmessage 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 causejavax.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 causejava.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.....
Krydos Posted October 18, 2017 Posted October 18, 2017 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?
jimmykd Posted October 18, 2017 Author Posted October 18, 2017 I don't know...Please tell me what to do.....
Krydos Posted October 18, 2017 Posted October 18, 2017 Replace smtp.gmail.com with 173.194.202.108 or 173.194.202.109? 1
jimmykd Posted October 18, 2017 Author Posted October 18, 2017 It is Working in my pc...does it work on my tommy server???
Krydos Posted October 18, 2017 Posted October 18, 2017 Yes, you can connect from Tommy to smtp.gmail.com:587. I'm not sure if your code connects though.
miwilc Posted October 18, 2017 Posted October 18, 2017 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.
jimmykd Posted October 20, 2017 Author Posted October 20, 2017 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 reportmessage 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 causejavax.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 causejava.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.....
jimmykd Posted October 20, 2017 Author Posted October 20, 2017 Dear Admin, Ip :173.194.202.108 or 173.194.202.109 are also not working in my heliohost tommy server, but it works in my pc's localhost server.Please help....
wolstech Posted October 20, 2017 Posted October 20, 2017 I wonder if it being a Java application has something to do with it. I know theres a way to do this since Ive seen it done with non-Java software. Escalating so Krydos can take a deeper look.
miwilc Posted October 21, 2017 Posted October 21, 2017 Link: https://support.google.com/accounts/answer/6010255?hl=en
jimmykd Posted October 24, 2017 Author Posted October 24, 2017 I turned it on when I start using googe SMTP.
Recommended Posts