diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/notification/MailNotification.java')
-rw-r--r-- | pki/base/common/src/com/netscape/cms/notification/MailNotification.java | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/pki/base/common/src/com/netscape/cms/notification/MailNotification.java b/pki/base/common/src/com/netscape/cms/notification/MailNotification.java index af6515843..ef09d8f71 100644 --- a/pki/base/common/src/com/netscape/cms/notification/MailNotification.java +++ b/pki/base/common/src/com/netscape/cms/notification/MailNotification.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.cms.notification; - import java.io.IOException; import java.io.PrintStream; import java.util.Vector; @@ -30,13 +29,12 @@ import com.netscape.certsrv.logging.ILogger; import com.netscape.certsrv.notification.ENotificationException; import com.netscape.certsrv.notification.IMailNotification; - /** * This class handles mail notification via SMTP. * This class uses <b>smtp.host</b> in the configuration for smtp - * host. The port default (25) is used. If no smtp specified, local + * host. The port default (25) is used. If no smtp specified, local * host is used - * + * * @version $Revision$, $Date$ */ public class MailNotification implements IMailNotification { @@ -56,10 +54,10 @@ public class MailNotification implements IMailNotification { if (mHost == null) { try { IConfigStore mConfig = - CMS.getConfigStore(); + CMS.getConfigStore(); IConfigStore c = - mConfig.getSubStore(PROP_SMTP_SUBSTORE); + mConfig.getSubStore(PROP_SMTP_SUBSTORE); if (c == null) { return; @@ -94,7 +92,7 @@ public class MailNotification implements IMailNotification { if ((mFrom != null) && (!mFrom.equals(""))) sc.from(mFrom); else { - throw new ENotificationException ( + throw new ENotificationException( CMS.getUserMessage("CMS_NOTIFICATION_NO_SMTP_SENDER")); } @@ -103,7 +101,7 @@ public class MailNotification implements IMailNotification { log(ILogger.LL_INFO, "mail to be sent to " + mTo); sc.to(mTo); } else { - throw new ENotificationException ( + throw new ENotificationException( CMS.getUserMessage("CMS_NOTIFICATION_NO_SMTP_RECEIVER")); } @@ -129,13 +127,14 @@ public class MailNotification implements IMailNotification { sc.closeServer(); } catch (IOException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("OPERATION_ERROR", e.toString())); - throw new ENotificationException ( + throw new ENotificationException( CMS.getUserMessage("CMS_NOTIFICATION_SMTP_SEND_FAILED", mTo)); } } /** * sets the "From" field + * * @param from email address of the sender */ public void setFrom(String from) { @@ -144,6 +143,7 @@ public class MailNotification implements IMailNotification { /** * sets the "Subject" field + * * @param subject subject of the email */ public void setSubject(String subject) { @@ -152,6 +152,7 @@ public class MailNotification implements IMailNotification { /** * sets the "Content-Type" field + * * @param contentType content type of the email */ public void setContentType(String contentType) { @@ -160,6 +161,7 @@ public class MailNotification implements IMailNotification { /** * sets the content of the email + * * @param content the message content */ public void setContent(String content) { @@ -168,6 +170,7 @@ public class MailNotification implements IMailNotification { /** * sets the recipients' email addresses + * * @param addresses a list of email addresses of the recipients */ public void setTo(Vector<String> addresses) { @@ -177,6 +180,7 @@ public class MailNotification implements IMailNotification { /** * sets the recipient's email address + * * @param to address of the recipient email address */ public void setTo(String to) { @@ -187,7 +191,7 @@ public class MailNotification implements IMailNotification { if (mLogger == null) return; mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_OTHER, - level, "MailNotification: " + msg); + level, "MailNotification: " + msg); } } |