javax.mail.SendFailedException: Sending failed;
<p>I also tried implementing solutions given earlier, but it din't help
me out. This code is not working on my pc, but the same code is
working on others pc. I just don't know what to do now.</p>

<pre><code>private void sendEmail(StringBuffer msg,String file) throws Exception
{
     StringBuffer textmessage;
     Calendar calendar = Calendar.getInstance();
     String date= calendar.get(Calendar.DAY_OF_MONTH) + "-" + (calendar.get(Calendar.MONTH) + 1)
                + "-" + calendar.get(Calendar.YEAR);

     System.out.println(date);
     textmessage=msg;
     String f=file;
     String host = "10.21.2.231";
     String from = "System_alert@accelyakale.com";
     //String to = "nfpops@accelyakale.com";
     //String cc = "nfptech@accelyakale.com";
     String to = "harshal.gad@accelyakale.com";
     String cc = "harshal.gad@accelyakale.com";
     Properties props = System.getProperties();
     props.put("mail.smtp.host",host);
     //props.put("mail.smtp.starttls.enable", "true");
     //props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
     /*props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
     props.put("mail.smtp.debug", "true");*/
     Session session = Session.getDefaultInstance(props,null);
     //final javax.mail.Session session = javax.mail.Session.getInstance(props);
     MimeMessage message = new MimeMessage(session);
     message.setFrom( new InternetAddress(from));
     message.addRecipient(Message.RecipientType.TO,  new InternetAddress(to));
     message.addRecipient(Message.RecipientType.CC,  new InternetAddress(cc));
     message.setSubject("FOK and ZO_PROD_TAX File has been received : "+f);
     //message.setSubject("UA Private File Alert: File Received "+date);
     message.setText("\n\n"+msg+"\n\nRegards,\nHarshal Gad");
     Transport.send(message);
}
</code></pre>

<p><strong>CONSOLE</strong></p>

<pre><code>javax.mail.SendFailedException: Sending failed;
  nested exception is:
    class javax.mail.MessagingException: Could not connect to SMTP host: 10.21.2.231, port: 25;
  nested exception is:
    java.net.SocketException: Permission denied: connect
    at javax.mail.Transport.send0(Transport.java:218)
    at javax.mail.Transport.send(Transport.java:80)
    at com.taxalert.Check_File.sendEmail(Check_File.java:313)
    at com.taxalert.Check_File.checkAndCopy(Check_File.java:272)
    at com.taxalert.Check_File.Check_pvt_files(Check_File.java:82)
    at com.taxalert.Check_File.main(Check_File.java:324)
</code></pre>
