how to send email from using outlook using a java api
<p>I am using the below code to send email from outlook using java. But getting the error.</p>

<p>CODE:</p>

<pre><code>    public static void mail (){
        // TODO Auto-generated method stub
        //String host="POKCPEX07.corp.absc.local";
        String host="POKCPEX07.corp.absc.local";
        final String user="satpal.gupta@accenture.com";  
        String to="satpal.gupta@accenture.com";  

        //Get the session object  
        Properties props = new Properties();  
        props.put("mail.smtp.host",host);  
        props.put("mail.smtp.auth", "false");
        props.put("mail.smtp.port", "587");


        Session session=Session.getInstance(props,
          new javax.mail.Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication("SGupta@amerisourcebergen.com","******");
            }
          });
        session.setDebug(true);

        try {
            MimeMessage message = new MimeMessage(session);
            message.saveChanges();
            message.setFrom(new InternetAddress(user));  
            message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));  
            message.setSubject("Test mail");  
            message.setText("This is test mail.");  

            //send the message
            Transport.send(message);

            System.out.println("message sent successfully...");
        }
        catch (MessagingException e) {e.printStackTrace();}

    }
}
</code></pre>

<p>ERROR:</p>

<pre>
javax.mail.MessagingException: Could not connect to SMTP host: POKCPEX07.corp.absc.local, port: 587;
  nested exception is:
    java.net.SocketException: Permission denied: connect
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1227)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:322)
    at javax.mail.Service.connect(Service.java:258)
    at javax.mail.Service.connect(Service.java:137)
    at javax.mail.Service.connect(Service.java:86)
    at javax.mail.Transport.send0(Transport.java:150)
    at javax.mail.Transport.send(Transport.java:80)
    at TestEmail.mail(TestEmail.java:50)
    at TestEmail.main(TestEmail.java:16)
</pre>