需要驗證Jmail發送時的驗證類

package com.sidiw.util.jmail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

public class Auth extends Authenticator {
    private String user, pwd;

    public Auth(String user, String pwd) {
        this.user = user;
        this.pwd = pwd;
    }

    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(this.user, this.pwd);
    }
}

發佈了20 篇原創文章 · 獲贊 3 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章