Я пытаюсь отправить электронное письмо с помощью javaMail, spring-boot и yahoo. Я получил это SMTPSendFailedException, и я не знаю, почему.MailSendException: Неудачные сообщения: com.sun.mail.smtp.SMTPSendFailedException
Вот часть, за исключением:
ErrorPageFilter: Forwarding to error page from request [/registration] due to exception [Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 501 Syntax error in arguments
;
nested exception is:
com.sun.mail.smtp.SMTPSenderFailedException: 501 Syntax error in arguments
]
org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 501 Syntax error in arguments
;
nested exception is:
com.sun.mail.smtp.SMTPSenderFailedException: 501 Syntax error in arguments
; message exception details (1) are:
Failed message 1:
com.sun.mail.smtp.SMTPSendFailedException: 501 Syntax error in arguments
;
nested exception is:
com.sun.mail.smtp.SMTPSenderFailedException: 501 Syntax error in arguments
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2203)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1694)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1194)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:433)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:307)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:296)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.sun.mail.smtp.SMTPSenderFailedException: 501 Syntax error in arguments
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1703)
... 102 more
[2015-10-27 22:11:14.252] boot - 8407 DEBUG [http-nio-8080-exec-8] --- EndpointHandlerMapping: Looking up handler method for path /error
[2015-10-27 22:11:14.257] boot - 8407 DEBUG [http-nio-8080-exec-8] --- EndpointHandlerMapping: Did not find handler method for [/error]
сообщения электронной почты свойства конфигурации, я использую Yahoo в качестве хозяина:
spring.mail.host=smtp.mail.yahoo.com
spring.mail.port=465
spring.mail.username=*****@yahoo.com
spring.mail.password=*****
spring.mail.default-encoding=UTF-8
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.ssl.enable=true
Часть реализации которой отправить электронную почту;
@Autowired
JavaMailSender javaMailSender;
String recipientAddress = XXXX.getUser().getEmail();
String subject = "Bienvenue chez AAAA";
String message = "huhuu";
SimpleMailMessage email = new SimpleMailMessage();
email.setTo(recipientAddress);
email.setSubject(subject);
email.setText(message + "\n");
javaMailSender.send(email);
Может кто-нибудь мне помочь?
Я добавил отправителя, и он отлично работает. – emoleumassi