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

前端 未结 8 754
时光取名叫无心
时光取名叫无心 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:08

    to create Bean don't forgot to specify mail properties, with Java class or in application.properties file, exemple

    # configuration email
    spring.mail.host=smtp.gmail.com
    spring.mail.port=587
    spring.mail.username=email
    spring.mail.password=password
    spring.mail.properties.mail.smtp.auth=true
    spring.mail.properties.mail.smtp.starttls.enable=true
    spring.mail.properties.mail.smtp.starttls.required=true
    

提交回复
热议问题