KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > efs > openreports > util > SMTPAuthenticator


1 /*
2  * Copyright (C) 2005 Erik Swenson - eswenson@opensourcesoft.net
3  *
4  * This program is free software; you can redistribute it and/or modify it under the terms of the
5  * GNU General Public License as published by the Free Software Foundation; either version 2 of the
6  * License, or (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
10  * the GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License along with this program; if
13  * not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
14  * 02111-1307, USA.
15  *
16  */

17 package org.efs.openreports.util;
18
19 import javax.mail.PasswordAuthentication JavaDoc;
20
21 public class SMTPAuthenticator extends javax.mail.Authenticator JavaDoc
22 {
23     private String JavaDoc userName;
24     private String JavaDoc password;
25     
26     public SMTPAuthenticator(String JavaDoc userName, String JavaDoc password)
27     {
28         this.userName = userName;
29         this.password = password;
30     }
31
32     public PasswordAuthentication JavaDoc getPasswordAuthentication()
33     {
34         return new PasswordAuthentication JavaDoc(userName, password);
35     }
36 }
Popular Tags