Skip to content

yookue/multiple-mail-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multiple Mail Spring Boot Starter

Spring Boot application integrates multiple mail quickly.

Quickstart

  • Import dependencies
    <dependency>
        <groupId>com.yookue.springstarter</groupId>
        <artifactId>multiple-mail-spring-boot-starter</artifactId>
        <version>LATEST</version>
    </dependency>

By default, this starter will auto take effect, you can turn it off by spring.multiple-mail.enabled = false

  • Configure Spring Boot application.yml with prefix spring.multiple-mail
spring:
    multiple-mail:
        primary:
            host: '192.168.0.1'
            port: 25
            username: 'foo1'
            password: 'bar1'
            properties:
        secondary:
            host: '192.168.0.2'
            port: 25
            username: 'foo2'
            password: 'bar2'
            properties:
        tertiary:
        quaternary:
        quinary:
        senary:

This starter supports 6 JavaMailSenderImpl at most.

  • Configure your beans with the following bean by @Autowired/@Resource annotation, combined with @Qualifier annotation (take primary as an example)
Bean Type Qualifier
JavaMailSenderImpl PrimaryMailSenderConfiguration.MAIL_SENDER

Document

Requirement

  • jdk 17+

License

This project is under the Apache License 2.0

See the NOTICE.txt file for required notices and attributions.

Donation

You like this package? Then donate to Yookue to support the development.

Website