1 /* 2 * 3 * 4 */ 5 package smtphandler; 6 7 import javax.mail.Authenticator; 8 import javax.mail.PasswordAuthentication; 9 10 class UsernamePasswordAuthenticator extends Authenticator 11 { 12 private PasswordAuthentication auth = null; 13 14 public UsernamePasswordAuthenticator(String user, String password) 15 { 16 auth = new PasswordAuthentication(user, password); 17 } 18 19 public PasswordAuthentication getPasswordAuthentication() 20 { 21 return auth; 22 } 23 24 25 }