planetj.common
Class CMMailer

java.lang.Object
  |
  +--planetj.common.CMMailer
All Implemented Interfaces:
Serializable

public class CMMailer
extends Object
implements Serializable

Author:
PlanetJ Corporation
See Also:
Serialized Form

Constructor Summary
CMMailer()
          No-arg Constructor Creation date: (9/26/2001 3:52:52 PM)
CMMailer(boolean debug)
          Constructor Creation date: (9/26/2001 3:56:44 PM)
CMMailer(String popHost, String sMTPHost)
          Constructor Creation date: (9/26/2001 3:53:34 PM)
CMMailer(String popHost, String sMTPHost, boolean debug)
          Constructor Creation date: (9/26/2001 3:55:57 PM)
 
Method Summary
static CMMailer createMailer(String user, String password, String smtpHost)
          Convience method to create a new CMMailer from a given user password and SMTP host.
 String getPassword()
           
 String getPopHost()
          Creation date: (8/20/01 12:46:57 PM)
 int getPort()
           
 String getSMTPHost()
          Creation date: (8/20/01 12:46:37 PM)
 String getUserID()
           
 boolean isDebugEnabled()
          Creation date: (9/26/2001 3:07:53 PM)
 void popAuthenticate(String popHost, String userid, String password)
          Pop authenticates the specified POP3 server, userid, and password Creation date: (10/16/2001 9:50:25 AM)
static boolean sendMessage(CMMailer mailer, CMMailMessage message)
          Convience method to sends the given mail message using the given mailer.
 void sendMessage(CMMailMessage mailMessage)
           
 void sendSMTPMessage(CMMailMessage mailMessage)
          Send a SMTP message.
 void setDebugEnabled(boolean newDebugEnabled)
          Creation date: (9/26/2001 3:07:53 PM)
 void setPassword(String password)
           
 void setPopHost(String newPopHost)
          Creation date: (8/20/01 12:46:57 PM)
 void setPort(int port)
           
 void setSMTPHost(String newSMTPHost)
          Creation date: (8/20/01 12:46:37 PM)
 void setUserID(String userID)
           
static CMMailer singleton()
          Returns a singleton instance of the CMMailer Creation date: (10/16/2001 9:47:17 AM)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMMailer

public CMMailer()
No-arg Constructor Creation date: (9/26/2001 3:52:52 PM)


CMMailer

public CMMailer(String popHost,
                String sMTPHost)
Constructor Creation date: (9/26/2001 3:53:34 PM)

Parameters:
popHost - java.lang.String
sMTPHost - java.lang.String

CMMailer

public CMMailer(String popHost,
                String sMTPHost,
                boolean debug)
Constructor Creation date: (9/26/2001 3:55:57 PM)

Parameters:
popHost - java.lang.String
sMTPHost - java.lang.String
debug - boolean

CMMailer

public CMMailer(boolean debug)
Constructor Creation date: (9/26/2001 3:56:44 PM)

Parameters:
debug - boolean
Method Detail

createMailer

public static CMMailer createMailer(String user,
                                    String password,
                                    String smtpHost)
Convience method to create a new CMMailer from a given user password and SMTP host.

Parameters:
user - user name to connect to server with
password - password of user connecting to server with
smtpHost - host SMTP server address
Returns:
CMMailer for given SMTP connection information

getPassword

public String getPassword()

getPopHost

public String getPopHost()
Creation date: (8/20/01 12:46:57 PM)

Returns:
java.lang.String

getPort

public int getPort()

getSMTPHost

public String getSMTPHost()
Creation date: (8/20/01 12:46:37 PM)

Returns:
java.lang.String

getUserID

public String getUserID()

isDebugEnabled

public boolean isDebugEnabled()
Creation date: (9/26/2001 3:07:53 PM)

Returns:
boolean

popAuthenticate

public void popAuthenticate(String popHost,
                            String userid,
                            String password)
                     throws CMException
Pop authenticates the specified POP3 server, userid, and password Creation date: (10/16/2001 9:50:25 AM)

Parameters:
popHost - java.lang.String
userid - java.lang.String
password - java.lang.String
Returns:
boolean
Throws:
CMException

sendMessage

public static boolean sendMessage(CMMailer mailer,
                                  CMMailMessage message)
Convience method to sends the given mail message using the given mailer.

Parameters:
mailer - mailer to send given message with
message - message to send using given mailer
Returns:
true if message sends successful

sendMessage

public void sendMessage(CMMailMessage mailMessage)
                 throws CMException
CMException

sendSMTPMessage

public void sendSMTPMessage(CMMailMessage mailMessage)
                     throws CMException
Send a SMTP message.

CMException

setDebugEnabled

public void setDebugEnabled(boolean newDebugEnabled)
Creation date: (9/26/2001 3:07:53 PM)

Parameters:
newDebugEnabled - boolean

setPassword

public void setPassword(String password)

setPopHost

public void setPopHost(String newPopHost)
Creation date: (8/20/01 12:46:57 PM)

Parameters:
newPopHost - java.lang.String

setPort

public void setPort(int port)

setSMTPHost

public void setSMTPHost(String newSMTPHost)
Creation date: (8/20/01 12:46:37 PM)

Parameters:
newSMTPHost - java.lang.String

setUserID

public void setUserID(String userID)

singleton

public static CMMailer singleton()
Returns a singleton instance of the CMMailer Creation date: (10/16/2001 9:47:17 AM)

Returns:
planetj.common.CMMailer