当前位置:   article > 正文

java使用springboot实现多个企业邮箱账号发送邮件,亲测有效_spring.mail 配置多个账号

spring.mail 配置多个账号

2.mail配置如下

@Data

@Component

@ConfigurationProperties(prefix = “sender-email”, ignoreUnknownFields = false)

public class EmailConfig {

private Map<String,MailProperties> configs;

public Map<String, MailProperties> getConfigs() {

return configs;

}

public void setConfigs(Map<String, MailProperties> configs) {

this.configs = configs;

}

@Data

public static class MailProperties {

private String host;

private String username;

private String password;

private String senderName;

public String getHost() {

return host;

}

public void setHost(String host) {

this.host = host;

}

public String getUsername() {

return username;

}

public void setUsername(String username) {

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/967626
推荐阅读
相关标签
  

闽ICP备14008679号