admin
2019-05-22 9b4bf99c1a30f3a7c2bdd6faba7589ff4f7e48e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.yeshi.fanli.util.email;
 
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
 
public class MyAuthenticator extends Authenticator {
    String userName = null;
    String password = null;
 
    public MyAuthenticator() {
    }
 
    public MyAuthenticator(String username, String password) {
        this.userName = username;
        this.password = password;
    }
 
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(userName, password);
    }
}