I dont understand why the error that show its referenced to GMAIL...
Zoho mail uses the same email smtp server?
My code:
- //Enviar el email
- Properties props = new Properties();
- props.setProperty( "mail.smtp.host" , "smtp.zoho.com" );
- props.setProperty( "mail.smtp.starttls.enable" , "true" );
- props.setProperty( "mail.smtp.port" , "587" );
- props.setProperty( "mail.smtp.user" , "myemail@zohomail.com" );
- props.setProperty( "mail.smtp.auth" , "true" );
- Session sesion = Session.getDefaultInstance(props);
- sesion.setDebug( true );
-
- CREATE THE MESSAGE and last:
-
- Transport t2 = sesion.getTransport( "smtp" );
- t2.connect( "rmyemail@zohomail.com" , "password" );
- t2.sendMessage(message2,message2.getAllRecipients());
- //Cerramos transporte
- t2.close();
ERROR:
javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 https://support.google.com/mail/answer/14257 r4sm2933832wia.19 - gsmtp
Any solution? Thanks in advance!