Could not autowire org.springframework.mail.javamail.JavaMailSender

前端 未结 8 765
时光取名叫无心
时光取名叫无心 2021-02-11 22:18

I got the following problem when trying to run my application. Have debugged everything and still nothing.

The IDE is finding the bean without any issue so I\'m very con

8条回答
  •  庸人自扰
    2021-02-11 23:09

    1. check application.properties config, such as:

      spring.mail.host=smtp.xxx.com
      spring.mail.username=xxx@xxx.com
      spring.mail.password=xxxxx
      spring.mail.properties.mail.smtp.auth=true
      spring.mail.properties.mail.smtp.starttls.enable=true
      spring.mail.properties.mail.smtp.starttls.required=true
      
    2. if you use spring-boot,can check should use @EnableAutoConfiguration this annotation

提交回复
热议问题