1 14 package org.compiere.util; 15 16 import javax.mail.*; 17 import java.net.InetAddress ; 18 19 25 public class EMailAuthenticator extends Authenticator 26 { 27 32 public EMailAuthenticator (String username, String password) 33 { 34 m_pass = new PasswordAuthentication (username, password); 35 if (username == null || username.length() == 0) 36 { 37 System.err.println("EMailAuthenticator - Username is NULL"); 38 Thread.dumpStack(); 39 } 40 if (password == null || password.length() == 0) 41 { 42 System.err.println("EMailAuthenticator - Password is NULL"); 43 Thread.dumpStack(); 44 } 45 } 47 48 private PasswordAuthentication m_pass; 49 50 54 protected PasswordAuthentication getPasswordAuthentication() 55 { 56 return m_pass; 57 } 59 63 public String toString() 64 { 65 if (m_pass == null) 66 return "EMailAuthenticator[]"; 67 return "EMailAuthenticator[" + m_pass.getUserName() + "/" + m_pass.getPassword() + "]"; 68 } 70 } | Popular Tags |