Spring boot admin监控邮件发送

1.pom.xml

<dependencies>
    <dependency>
        <groupId>de.codecentric</groupId>
        <artifactId>spring-boot-admin-server</artifactId>
        <version>1.5.6</version>
    </dependency>
    <dependency>
        <groupId>de.codecentric</groupId>
        <artifactId>spring-boot-admin-server-ui</artifactId>
        <version>1.5.6</version>
    </dependency>
    <dependency> 
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
        <version>1.5.9.RELEASE</version>
    </dependency> 
  </dependencies>@Configuration
@EnableAutoConfiguration
@EnableAdminServer
public class SpringBootAdminApplication {

  public static void main(String[] args) {
    SpringApplication.run(SpringBootAdminApplication.class, args);
  }
}

2.启动类

@Configuration
@EnableAutoConfiguration
@EnableAdminServer
public class SpringBootAdminApplication {

  public static void main(String[] args) {
    SpringApplication.run(SpringBootAdminApplication.class, args);
  }
}

3.配置文件

server:
  port: 9999 
spring:  
  application:  
    name: service-admin  
  mail:  
    host: smtp.163.com  
    username: aaronrao2018@163.com
    password: 2018shijiebei  
    properties:  
      mail.debug: false  
      mail.smtp.auth: true  
  boot:  
    admin:  
      notify:  
        mail:  
          to: 3376224996@qq.com  
          from: aaronrao2018@163.com  
# ignore-changes: UNKNOWN:UP 
      routes:  
        endpoints: env,metrics,dump,jolokia,info,configprops,trace,
logfile,refresh,flyway,liquibase,heapdump,loggers,auditevents,hystrix.stream 

    原文作者:Spring Boot
    原文地址: https://blog.csdn.net/qyj19920704/article/details/81230042
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞