com.netscape.cms.notification
Class MailNotification

java.lang.Object
  extended by com.netscape.cms.notification.MailNotification
All Implemented Interfaces:
IMailNotification

public class MailNotification
extends java.lang.Object
implements IMailNotification

This class handles mail notification via SMTP. This class uses smtp.host in the configuration for smtp host. The port default (25) is used. If no smtp specified, local host is used

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Field Summary
protected static java.lang.String PROP_HOST
           
protected static java.lang.String PROP_SMTP_SUBSTORE
           
 
Constructor Summary
MailNotification()
           
 
Method Summary
 void sendNotification()
          send one message to one or more addressees
 void setContent(java.lang.String content)
          sets the content of the email
 void setContentType(java.lang.String contentType)
          sets the "Content-Type" field
 void setFrom(java.lang.String from)
          sets the "From" field
 void setSubject(java.lang.String subject)
          sets the "Subject" field
 void setTo(java.lang.String to)
          sets the recipient's email address
 void setTo(java.util.Vector addresses)
          sets the recipients' email addresses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_SMTP_SUBSTORE

protected static final java.lang.String PROP_SMTP_SUBSTORE
See Also:
Constant Field Values

PROP_HOST

protected static final java.lang.String PROP_HOST
See Also:
Constant Field Values
Constructor Detail

MailNotification

public MailNotification()
Method Detail

sendNotification

public void sendNotification()
                      throws java.io.IOException,
                             ENotificationException
send one message to one or more addressees

Specified by:
sendNotification in interface IMailNotification
Throws:
java.io.IOException
ENotificationException

setFrom

public void setFrom(java.lang.String from)
sets the "From" field

Specified by:
setFrom in interface IMailNotification
Parameters:
from - email address of the sender

setSubject

public void setSubject(java.lang.String subject)
sets the "Subject" field

Specified by:
setSubject in interface IMailNotification
Parameters:
subject - subject of the email

setContentType

public void setContentType(java.lang.String contentType)
sets the "Content-Type" field

Specified by:
setContentType in interface IMailNotification
Parameters:
contentType - content type of the email

setContent

public void setContent(java.lang.String content)
sets the content of the email

Specified by:
setContent in interface IMailNotification
Parameters:
content - the message content

setTo

public void setTo(java.util.Vector addresses)
sets the recipients' email addresses

Specified by:
setTo in interface IMailNotification
Parameters:
addresses - a list of email addresses of the recipients

setTo

public void setTo(java.lang.String to)
sets the recipient's email address

Specified by:
setTo in interface IMailNotification
Parameters:
to - address of the recipient email address