I am using javax mail to send mail from my activity. Here is my properties
Properties properties = new Properties();
properties.setProperty("mail.transport.protocol", "smtp");
properties.setProperty("mail.host", mailhost);
properties.put("mail.smtp.auth", "true");
properties.put("mail.smtp.port", "995");
properties.put("mail.smtp.socketFactory.port", "465");
properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
properties.put("mail.smtp.socketFactory.fallback", "false");
properties.setProperty("mail.smtp.quitwait", "false");
While using this settings javax gives that error "javax.mail.AuthenticationFailedException".
And i must turn off the google security from this link!
But i dont want to turn off security service. Is there any way to use? I think problem is my properties, but i cant figure out.