01: package org.claros.commons.mail.utility;
02:
03: import javax.mail.Authenticator;
04: import javax.mail.PasswordAuthentication;
05:
06: /**
07: * @author Umut Gokbayrak
08: */
09: public class SmtpAuthenticator extends Authenticator {
10: private String username;
11: private String password;
12:
13: public SmtpAuthenticator(String username, String password) {
14: this .username = username;
15: this .password = password;
16: }
17:
18: protected PasswordAuthentication getPasswordAuthentication() {
19: PasswordAuthentication pa = new PasswordAuthentication(
20: username, password);
21: return pa;
22: }
23:
24: }
|