01: /*
02: * Copyright (C) 2005 Erik Swenson - erik@oreports.com
03: *
04: * This program is free software; you can redistribute it and/or modify it under the terms of the
05: * GNU General Public License as published by the Free Software Foundation; either version 2 of the
06: * License, or (at your option) any later version.
07: *
08: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
09: * 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;
20:
21: public class SMTPAuthenticator extends javax.mail.Authenticator {
22: private String userName;
23: private String password;
24:
25: public SMTPAuthenticator(String userName, String password) {
26: this .userName = userName;
27: this .password = password;
28: }
29:
30: public PasswordAuthentication getPasswordAuthentication() {
31: return new PasswordAuthentication(userName, password);
32: }
33: }
|