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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package com.yeshi.buwan.util.email;
 
import java.util.Properties;
 
public class MailSendInfo {
    // 鍙戦?閭欢鐨勬湇鍔″櫒鐨処P(鎴栦富鏈哄湴鍧?
    private String mailServerHost;
    // 鍙戦?閭欢鐨勬湇鍔″櫒鐨勭鍙?
    private String mailServerPort = "25";
    // 鍙戜欢浜洪偖绠卞湴鍧?
    private String fromAddress;
    // 鏀朵欢浜洪偖绠卞湴鍧?
    private String toAddress;
    // 鐧婚檰閭欢鍙戦?鏈嶅姟鍣ㄧ殑鐢ㄦ埛鍚?
    private String userName;
    // 鐧婚檰閭欢鍙戦?鏈嶅姟鍣ㄧ殑瀵嗙爜
    private String password;
    // 鏄惁闇?韬唤楠岃瘉
    private boolean validate = false;
    // 閭欢涓婚
    private String subject;
    // 閭欢鐨勬枃鏈唴瀹?
    private String content;
    // 閭欢闄勪欢鐨勬枃浠跺悕
    private String[] attachFileNames;
 
    public Properties getProperties() {
        Properties p = new Properties();
        p.put("mail.smtp.host", this.mailServerHost);
        p.put("mail.smtp.port", this.mailServerPort);
        p.put("mail.smtp.auth", validate ? "true" : "false");
        return p;
    }
 
    public String getMailServerHost() {
        return mailServerHost;
    }
 
    public void setMailServerHost(String mailServerHost) {
        this.mailServerHost = mailServerHost;
    }
 
    public String getMailServerPort() {
        return mailServerPort;
    }
 
    public void setMailServerPort(String mailServerPort) {
        this.mailServerPort = mailServerPort;
    }
 
    public boolean isValidate() {
        return validate;
    }
 
    public void setValidate(boolean validate) {
        this.validate = validate;
    }
 
    public String[] getAttachFileNames() {
        return attachFileNames;
    }
 
    public void setAttachFileNames(String[] fileNames) {
        this.attachFileNames = fileNames;
    }
 
    public String getFromAddress() {
        return fromAddress;
    }
 
    public void setFromAddress(String fromAddress) {
        this.fromAddress = fromAddress;
    }
 
    public String getPassword() {
        return password;
    }
 
    public void setPassword(String password) {
        this.password = password;
    }
 
    public String getToAddress() {
        return toAddress;
    }
 
    public void setToAddress(String toAddress) {
        this.toAddress = toAddress;
    }
 
    public String getUserName() {
        return userName;
    }
 
    public void setUserName(String userName) {
        this.userName = userName;
    }
 
    public String getSubject() {
        return subject;
    }
 
    public void setSubject(String subject) {
        this.subject = subject;
    }
 
    public String getContent() {
        return content;
    }
 
    public void setContent(String textContent) {
        this.content = textContent;
    }
 
}