1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.ruoyi.framework.config.properties;
 
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
/**
 * JavaMail 配置属性
 *
 * @author Michelle.Chung
 */
@Data
@Component
@ConfigurationProperties(prefix = "spring.mail")
public class MailProperties {
 
    /**
     * 过滤开关
     */
    private String enabled;
 
    /**
     * 邮件服务地址
     */
    private String host;
 
    /**
     * 用户名
     */
    private String username;
 
    /**
     * 授权码 (设置 - 账户 - POP3/SMTP服务)
     */
    private String password;
 
    /**
     * 邮箱加密端口,不同邮箱的端口不一样
     */
    private Integer port;
 
    /**
     * 是否需要用户认证
     */
    @Value("${spring.mail.properties.mail.smtp.auth}")
    private Boolean auth;
 
    /**
     * 是否启用TLS加密
     */
    @Value("${spring.mail.properties.mail.smtp.starttls.enable}")
    private Boolean starttlsEnable;
 
    @Value("${spring.mail.properties.mail.smtp.ssl.trust}")
    private String sslTrust;
 
    private Boolean debug;
 
    /**
     * 传输协议 starttls.enable = true 时为 smtps
     */
    private String protocol;
 
}