package com.elab.alert.model.mail;


import javax.mail.PasswordAuthentication;

/**
 * 邮件的帐号密码存储对象
 *
 * @author : liukx
 * @create : 2018/11/19 10:02
 * @email : liukx@elab-plus.com
 */
public class MailAuthenticator extends javax.mail.Authenticator {
    String userName = null;
    String password = null;

    public MailAuthenticator() {
    }

    public MailAuthenticator(String username, String password) {
        this.userName = username;
        this.password = password;
    }

    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(userName, password);
    }
}
