How to configure a mail channel in Spring Boot?

こ雲淡風輕ζ 提交于 2019-12-11 21:06:22

问题


I've found Mail Integration in the Spring Docs, a mail channel example with XML configuration, a suggestion to use Jasypt to encrypt the userid/password in the XML config, and an XML-based config in the Spring Boot Samples repo, but I have not figured out how to securely configure and use an email channel in a Spring Boot web app that is using annotations.

I looked for ways to incorporate XML bean definitions, and how to convert XML to annotations, but came up empty.

How should I configure mail channels for sending and receiving email in a Spring Boot app?

Thanks!


回答1:


The spring boot integration starter doesn't include mail support; you simply need to add the spring-integration-mail artifact to your pom; you can then configure the mail channel adapters in XML as needed.

You can use @ImportResource to combine XML configuration with a @Configuration class.



来源:https://stackoverflow.com/questions/24872001/how-to-configure-a-mail-channel-in-spring-boot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!