Package com.netscape.cms.notification
Class MailNotification
- java.lang.Object
-
- 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$, $Date$
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Loggerloggerprotected static java.lang.StringPROP_HOSTprotected static java.lang.StringPROP_SMTP_SUBSTORE
-
Constructor Summary
Constructors Constructor Description MailNotification()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsendNotification()send one message to one or more addresseesvoidsetContent(java.lang.String content)sets the content of the emailvoidsetContentType(java.lang.String contentType)sets the "Content-Type" fieldvoidsetFrom(java.lang.String from)sets the "From" fieldvoidsetSubject(java.lang.String subject)sets the "Subject" fieldvoidsetTo(java.lang.String to)sets the recipient's email addressvoidsetTo(java.util.Vector<java.lang.String> addresses)sets the recipients' email addresses
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
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
-
-
Method Detail
-
sendNotification
public void sendNotification() throws java.io.IOException, ENotificationExceptionsend one message to one or more addressees- Specified by:
sendNotificationin interfaceIMailNotification- Throws:
java.io.IOExceptionENotificationException
-
setFrom
public void setFrom(java.lang.String from)
sets the "From" field- Specified by:
setFromin interfaceIMailNotification- Parameters:
from- email address of the sender
-
setSubject
public void setSubject(java.lang.String subject)
sets the "Subject" field- Specified by:
setSubjectin interfaceIMailNotification- Parameters:
subject- subject of the email
-
setContentType
public void setContentType(java.lang.String contentType)
sets the "Content-Type" field- Specified by:
setContentTypein interfaceIMailNotification- Parameters:
contentType- content type of the email
-
setContent
public void setContent(java.lang.String content)
sets the content of the email- Specified by:
setContentin interfaceIMailNotification- Parameters:
content- the message content
-
setTo
public void setTo(java.util.Vector<java.lang.String> addresses)
sets the recipients' email addresses- Specified by:
setToin interfaceIMailNotification- 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:
setToin interfaceIMailNotification- Parameters:
to- address of the recipient email address
-
-