Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Using springBoot to realize the function of simple sending email

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "using springBoot to achieve simple email sending function". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "using springBoot to achieve a simple e-mail function"!

1 introduction of starter

Dependency > org.springframework.boot spring-boot-starter-mail

2 application.properties configuration

Spring.mail.username=116062807@qq.com

Spring.mail.password= authorization code (activate to QQ Mail by yourself)

Reference document address that you do not understand under spring.mail.host=smtp.qq.com: https://docs.spring.io/spring/docs/5.1.8.RELEASE/spring-framework-reference/integration.html#mail public class DemoApplicationTests {

@ AutowiredJavaMailSenderImpl mailSender; [@ Test] (https://cache.yisu.com/upload/information/20210524/347/782341.jpg",new File ("e:/tu/1.jpg")); helper.setTo ("1160628027@qq.com"); helper.setFrom ("1160628027@qq.com"); mailSender.send (mimeMessage);}

}

At this point, I believe you have a deeper understanding of "using springBoot to achieve simple email sending function". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report