OOP SmtpSender Version 1.4

com.bentofw.smtpsender
Class SmtpSender

java.lang.Object
  extended by com.bentofw.smtpsender.SmtpSender

public final class SmtpSender
extends java.lang.Object

Send the e-mail represented by MailToBeSent.

Author:
Jun Inamori
See Also:
MailToBeSent

Method Summary
static SmtpSender getInstance()
          Reads the property file and returns the instance of this class.
 void sendMail(MailToBeSent mail)
          Send the e-mail which is represented by MailToBeSent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SmtpSender getInstance()
                              throws SimpleException,
                                     NestedException,
                                     NoPropertyFileException
Reads the property file and returns the instance of this class.

This method is Thread Safe and the returned instance is always unique within the class-loader. Only at the first invocation, the property file is read. The subsequent call just returns the same instance, and that's all. So, even if we call this method multiple times from multiple places, (during the life time of class-loader) we can be sure that we always get the same instance. For example, multiple Servlets within the single web application can invoke this method and share the same instance of this class.
Before you start to build your Servlet by this class, we strongly recommend you to read:

Returns:
The instance of this class.
Throws:
SimpleException
NestedException
NoPropertyFileException

sendMail

public void sendMail(MailToBeSent mail)
              throws NestedException
Send the e-mail which is represented by MailToBeSent.

Parameters:
mail - The instance of MailToBeSent.
Throws:
NestedException
See Also:


OOP SmtpSender Version 1.4

ALL CONTENTS COPYRIGHT 2006, OOP-Research Corporation. All rights reserved.
Any questions and comments are welcome to OOP-Research Corporation.