Spring boot admin监控邮件发送

扫码关注公众号:Java 技术驿站

发送:vip
将链接复制到本浏览器,永久解锁本站全部文章

【公众号:Java 技术驿站】 【加作者微信交流技术,拉技术群】

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 

来源:[]()

赞(0) 打赏
版权归原创作者所有,任何形式的转载请联系博主:daming_90:Java 技术驿站 » Spring boot admin监控邮件发送

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏