feat(mail): 集成邮件发送功能并配置SMTP服务

- 添加 spring-boot-starter-mail依赖
- 在 application.yml 中配置 SMTP 服务器信息
- 注入 JavaMailSender 并实现消息监听器中的邮件发送逻辑- 设置邮件发送者、接收者、主题及内容
- 使用 RabbitMQ 消息队列触发邮件通知机制
This commit is contained in:
2025-10-27 21:25:45 +08:00
parent 501980046b
commit 29be26207f
3 changed files with 31 additions and 0 deletions

View File

@@ -12,6 +12,15 @@ spring:
jackson:
serialization:
write-dates-as-timestamps: false
mail:
host: ${MAIL_HOST:smtp.qq.com}
port: ${MAIL_PORT:587}
username: ${MAIL_USERNAME:2628273921@qq.com}
password: ENC(ARrAyZNZhbaG6tebogv6WSQbtCO+Vq93NfSA6tMAiD0tTogujERVwEGBECakH0LUhYq9oTaXgfw7tonxNAFEwg==)
properties:
mail.smtp.auth: true
mail.smtp.starttls.enable: true
mail.smtp.starttls.required: true
data:
redis:
host: localhost