title: Could not connect to SMTP host: smtp.live.com, port: 25
body: <p>I've created ContactUs form through which users can enter the following values:  </p>
  
  <pre><code>    Email  
      Name  
      Subject  
      Message  
  </code></pre>
  
  <p>Using the following code:<br>
          <a href="http://www.roseindia.net/mail/sending-an-email-in-jsp.shtml" rel="nofollow">http://www.roseindia.net/mail/sending-an-email-in-jsp.shtml</a>  </p>
  
  <p>On clicking the submit button the mail should get send to 1-2 email ids of my company's domain. Users can enter any email-d from any domain and send it to my company's domain email-ids(1-2).  </p>
  
  <pre><code>    I'm using the following 2 libraries, activation.jar and mail.jar  
  </code></pre>
  
  <p>In This case the server connection should be created under port 25?<br>
  For this I'm providing the "stacktrace" here. It is showing the following error:  </p>
  
  <pre><code>    Could not connect to SMTP host: smtp.live.com, port: 25  
  </code></pre>
  
  <p>What is the error, should I write something else in place of live.com?<br>
  The name of domain should be written here like emailid=abc@xyz.edu.in, so the host should be smtp.xyz.edu.in?<br>
  Please explain me that what is the error?  </p>
  
  <p>STACKTRACE:  </p>
  
  <pre><code>    org.apache.catalina.util.LifecycleBase start  
      INFO: The start() method was called on component  
            [StandardEngine[Catalina].StandardHost
      [localhost].StandardContext[/WebApplicationAskAQuestion6]] after start() had  
      already been called. The second call will be ignored.
      javax.mail.MessagingException: Could not connect to SMTP host: 10.10.10.34, port:    465;
       nested exception is:
  java.net.ConnectException: Connection timed out: connect
  at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961)
  at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
  at javax.mail.Service.connect(Service.java:295)
  at org.apache.jsp.mail_jsp._jspService(mail_jsp.java:81)
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
  at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:722)
      Caused by: java.net.ConnectException: Connection timed out: connect
  at java.net.DualStackPlainSocketImpl.connect0(Native Method)
  at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
  at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
  at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
  at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
  at java.net.Socket.connect(Socket.java:579)
  at java.net.Socket.connect(Socket.java:528)
  at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:321)
  at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:237)
  at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)
  ... 25 more
  </code></pre>