All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ck.email.MailAuthenticator Maven / Gradle / Ivy

There is a newer version: 2.5.3.RELEASE
Show newest version
package com.ck.email;

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


public class MailAuthenticator extends Authenticator {
	// 用户名(登录邮箱)
	private String username;
	// 密码
	private String password;

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

	String getPassword() {
		return password;
	}

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

	String getUsername() {
		return username;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setUsername(String username) {
		this.username = username;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy