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

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值