SpringBoot 发送邮件
Java
2025.09.24 10:18:17
阅读 1
安装依赖
---
------------------------------
------------------------------
---如果需要发送带.html模版的的邮件,还需要安装
---
------------------------------
-----------------------------------
---配置
-------
-----
----- ------------
----- ---
--------- ------------------
--------- -------------- - ------------
--------- ----
-----------
--------------------- ----普通的邮件
1、实现类
- ------------
- ----------
- ----------
- --------
- ------
- --------
- --------
- --------
-
- - - -
-
- - -----------
----
- - ---------
----
- - ---------
- - --- -- - -------- - -------- -
- ------- - ---------------
- -
- ------ - - ---------- ---- ---------
---------- ----------- -----------
------------
------------------
------------------
----------------------
- --
- - -- -- -
------
- --
-
-
-2、调用
----------------- -- ---模版邮件
1、模版 src/main/resources/templates/test.html
-- --
-- -------
---
-- ------
----------
---
---
-- --------------
---
---2、实现类
- ------------
- ----------
- ----------
- --------
- ------
- --------
- ------
- --------
- --------
- --------
-
- - - -
-
- - -----------
-
- - ---------------
----
- - ---------
----
- - ---------
- - --- -- - -------- - -------- - ------------- -
- ------- - ---------------
- -
- ------ - - ---------- ---- ---------
- ----------- - ------------------------------ ---------
---------- ----------- -----------
------------
------------------
--------------------- ---
----------------------
- --
- - -- -- -
------
- --
-
-
-3、调用
- ------- - - ----
------------ ---
----------------- -- -------- ---








