Springboot admin邮件报警

springboot admin(sba)监管eureka注册中心的各个服务,服务启动或down时,给制定人员发送报警邮件

1.引入依赖

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-mail</artifactId>

</dependency>

2.登录邮箱->设置->账户->开启IMAP/SMTP服务

 springboot admin邮件报警

springboot admin邮件报警

 

3.配置yaml文件

Spring

  boot:  

admin:  

      notify:  

        mail:  

          to: [email protected]  #收件人邮箱

          from: [email protected]  #发件人邮箱

  mail:  

    host: smtp.XX.com  #(私人邮箱测试,企业邮箱和私人邮箱配置不同)

    username: [email protected] #登录账号

    password: xxxxxxxxxxxx  #密码(开启IMAP/SMTP服务颁发的授权码)

    properties:  

      mail.debug: false  

      mail.smtp.auth: true   #安全认证(默认是true)

      mail.smtp.port: 465     

      mail.smtp.ssl.enable: true  #开启ssl加密 否则项目启动时报530error

      mail.smtp.ssl.socketFactory: sf       

4.启动项目

登录邮箱->自助查询

 

 springboot admin邮件报警

 springboot admin邮件报警springboot admin邮件报警

相关文章:

  • 2021-04-24
  • 2021-07-08
  • 2021-06-27
  • 2021-06-20
  • 2021-07-27
  • 2021-09-05
猜你喜欢
  • 2022-12-23
  • 2021-10-25
  • 2021-10-06
  • 2021-11-25
  • 2021-05-03
  • 2021-12-24
相关资源
相似解决方案