引用文章
https://blog.csdn.net/lingfeian/article/details/96731620
問題描述
2019-07-21 16:14:00.449 ERROR 9668 — [pool-1-thread-1] c.w.i.c.m.s.i.EmailMessageServiceImpl : Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 503 Error: need EHLO and AUTH first ! ; nested exception is: com.sun.mail.smtp.SMTPSenderFailedException: 503 Error: need EHLO and AUTH first ! org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 503 Error: need EHLO and AUTH first ! ; nested exception is: com.sun.mail.smtp.SMTPSenderFailedException: 503 Error: need EHLO and AUTH first ! at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:490) ~[spring-context-support-5.1.6.RELEASE.jar:5.1.6.RELEASE] at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:360) ~[spring-context-support-5.1.6.RELEASE.jar:5.1.6.RELEASE] at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:355) ~[spring-context-support-5.1.6.RELEASE.jar:5.1.6.RELEASE]
問題原因
報這個錯的原因是郵箱登錄需要設置安全碼,切記安全碼不是郵箱密碼。
解決方案
將原來設計的密碼改成獲取到的安全碼,
由於每種郵箱的安全碼獲取方式不一樣,這里就不在詳細說明了