I am trying to user spring java mail with theses properties :
mail:
host: smtp.mail.yahoo.com
port: 587
username: xxx
password: xxx
protocol: smtp
properties.mail.smtp:
auth: true
starttls.enable: true
Code :
@Inject
private JavaMailSenderImpl javaMailSender;
...
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
message.setTo(to);
message.setFrom(fromEmail);
message.setSubject(subject);
message.setText(content, isHtml);
javaMailSender.send(mimeMessage);
But I am getting this error when I send the mail :
E-mail could not be sent to user 'xxx@yahoo.fr', exception is: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 535 5.7.0 (#MBR1212) Incorrect username or password.
I am sure my login/pwd are correct. Are my properties incorrect?