I am using Javamail api and gmail smtp server to send mail in java without giving password. I have using the below code. here i am using javax.mail jar file
Properties props= new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", 587);
props.put("mail.transport.protocal", "smtps");
//Put below to false, if no https is needed
props.put("mail.smtp.STARTTLS.enable", "false");
props.put("mail.smtp.auth", "false");
Session session = Session.getInstance(props);
I am getting the below error
Must issue a STARTTLS command first. b4sm3005855pdh.2 - gsmtp
Is there any wrong in implementing the code? is it posssible to implement without password ? pls any one help me on this