KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jodd > mail > SmtpSimpleAuthenticator


1 // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
2

3 package jodd.mail;
4
5 import javax.mail.Authenticator JavaDoc;
6 import javax.mail.PasswordAuthentication JavaDoc;
7
8 /**
9  * Performs simple authentication when the SMTP server requires it.
10  */

11 public class SmtpSimpleAuthenticator extends Authenticator JavaDoc {
12
13     private String JavaDoc username;
14     private String JavaDoc password;
15
16     public SmtpSimpleAuthenticator(String JavaDoc username, String JavaDoc password) {
17         super();
18         this.username = username;
19         this.password = password;
20     }
21
22     public PasswordAuthentication JavaDoc getPasswordAuthentication() {
23         return new PasswordAuthentication JavaDoc(username, password);
24     }
25 }
26
27
Popular Tags