地质所 沉降监测网建设项目
zmk
2024-10-23 3f47c88e7cb4e53b3637620794420181f47b5a5e
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
package com.javaweb.cms.util.email;
 
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
 
/**
 * 邮箱帐号验证类
 * @author Administrator
 *
 */
public class MyAuthenticator extends Authenticator {
    private String userName;
    private String password;
    public MyAuthenticator() {
    
    }
    public MyAuthenticator(String userName, String password) {
        super();
        this.userName = userName;
        this.password = password;
    }
    /**
     * 重写验证方法
     */
    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        
        return new PasswordAuthentication(userName,password);
    }
    
    
}