Can't send command to SMTP host; nested exception is: java.net.SocketException: Connection closed by remote host

Can't send command to SMTP host; nested exception is: java.net.SocketException: Connection closed by remote host

In my web app trying to send email using SMTP zoho Server.


Properties props = new Properties();
props.put("mail.smtp.host", host); //SMTP Host
props.put("mail.smtp.port", "465"); //SMTP Port
props.setProperty("mail.pop3.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.setProperty("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory"); 
props.setProperty("mail.smtp.socketFactory.fallback", "false");
props.setProperty("mail.smtp.socketFactory.port", "465"); 
props.put("mail.smtp.startssl.enable", "true");
props.put("mail.smtp.auth", "true"); //Enabling SMTP Authentication

Authenticator auth = new Authenticator() {
//override the getPasswordAuthentication method
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(userId, password);
}
};
Session session = Session.getDefaultInstance(props, auth);      try {
         Message message = new MimeMessage(session);
         message.setFrom(new InternetAddress("from-email@gmail.com"));
         message.setRecipients(Message.RecipientType.TO,
         InternetAddress.parse(userId));
         message.setSubject("from-email@gmail.com");
         message.setText(emailMessage);

         Transport.send(message);