SpringBootAdmin设置邮件通知

如果你想要在Spring Boot Admin中配置邮件通知,可以按照以下步骤进行操作:

添加邮件通知的依赖

复制代码
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-mail</artifactId>
</dependency>

配置收件人

application.yml 文件

这些配置项包括邮件通知的启用状态 (enabled)、收件人 (to)、发件人 (from)、SMTP 服务器信息 (hostport)、认证信息 (usernamepassword),以及协议和其他 SMTP 属性。请替换示例中的占位符和值为你的实际信息。

复制代码
server:
  port: 8070
  servlet:
    context-path: /
# email
spring:
  mail:
    # 配置邮箱 smtp 地址(qq 发送邮箱的固定 host 是 smtp.qq.com)
    host: smtp.qq.com
    # 你的邮箱
    username: xxxxx@qq.com
    # 你的授权码
    password: kpddccybsvqfibbb
    default-encoding: UTF-8
  boot:
    admin:
      notify:
        mail:
          # 开启
          enabled: true
          # 接收人
          to: 872268102@qq.com, 563053676@qq.com, 354200205@qq.com
          # 发送人
          from: 1345592047@qq.com
          # ????????
          ignore-changes: {"UNKNOWN:UP"}
      #你的地址
      ui:
        public-url: http://xxx.xxx.com:80
application.properties
复制代码
# 邮件通知配置
spring.boot.admin.notify.mail.enabled=true
spring.boot.admin.notify.mail.to=recipient@example.com
spring.boot.admin.notify.mail.from=sender@example.com
spring.boot.admin.notify.mail.host=smtp.example.com
spring.boot.admin.notify.mail.port=587
spring.boot.admin.notify.mail.username=your_username
spring.boot.admin.notify.mail.password=your_password
spring.boot.admin.notify.mail.protocol=smtp
spring.boot.admin.notify.mail.properties.mail.smtp.auth=true
spring.boot.admin.notify.mail.properties.mail.smtp.starttls.enable=true
spring.boot.admin.notify.mail.properties.mail.smtp.starttls.required=true
相关推荐
云烟成雨TD12 小时前
Spring AI Alibaba 1.x 系列【6】ReactAgent 同步执行 & 流式执行
java·人工智能·spring
lwx91485212 小时前
Linux-Shell算术运算
linux·运维·服务器
于慨12 小时前
Lambda 表达式、方法引用(Method Reference)语法
java·前端·servlet
石小石Orz12 小时前
油猴脚本实现生产环境加载本地qiankun子应用
前端·架构
swg32132112 小时前
Spring Boot 3.X Oauth2 认证服务与资源服务
java·spring boot·后端
从前慢丶12 小时前
前端交互规范(Web 端)
前端
gelald13 小时前
SpringBoot - 自动配置原理
java·spring boot·后端
殷紫川13 小时前
深入理解 AQS:从架构到实现,解锁 Java 并发编程的核心密钥
java
一轮弯弯的明月13 小时前
贝尔数求集合划分方案总数
java·笔记·蓝桥杯·学习心得
CHU72903513 小时前
便捷约玩,沉浸推理:线上剧本杀APP功能版块设计详解
前端·小程序