// Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
package jodd.mail;
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
/**
* Performs simple authentication when the SMTP server requires it.
*/
public class SmtpSimpleAuthenticator extends Authenticator {
private String username;
private String password;
public SmtpSimpleAuthenticator(String username, String password) {
super();
this.username = username;
this.password = password;
}
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
}
|