1 3 package jodd.mail; 4 5 import javax.mail.Authenticator ; 6 import javax.mail.PasswordAuthentication ; 7 8 11 public class SmtpSimpleAuthenticator extends Authenticator { 12 13 private String username; 14 private String password; 15 16 public SmtpSimpleAuthenticator(String username, String password) { 17 super(); 18 this.username = username; 19 this.password = password; 20 } 21 22 public PasswordAuthentication getPasswordAuthentication() { 23 return new PasswordAuthentication (username, password); 24 } 25 } 26 27 | Popular Tags |