田源
2024-08-02 7a61f5f2f29a069cd8947ea46b6b2329ac0f5d44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.vci.server.base.mail;
 
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
 
public class EmaiAuthenticator extends Authenticator {
 
    private static final String userName = EmailConfPropreties.getStringProperty("email.userName");
    private static final String passWord = EmailConfPropreties.getStringProperty("email.password");
    //* 密码和用户的验证
    public EmaiAuthenticator() {
        super();
    }
    
    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(userName, passWord);
    }
}