Package com.saperion.ngc.util
Class ZKMailSender
- java.lang.Object
-
- com.saperion.ngc.util.ZKMailSender
-
public final class ZKMailSender extends java.lang.Object
ZKMailSender to send emails. Configure this class in the web.xml. Following parameters are required: SMTPServer, SMTPUser and SMTPPass. Optional parameters are: SMTPPort, SMTPuseSSL, SMTPdebug
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ZKMailSender
getInstance()
Returns the instance of the mail sender object.void
sendAttachmentMessage(java.lang.String[] to, java.util.List<ZKMailAttachment> attachments, java.lang.String mailMessage, java.lang.String subject)
Sends a mail with the given attachment to a mail receiver.void
sendAttachmentMessage(java.util.List<java.lang.String> to, java.util.List<ZKMailAttachment> attachments, java.lang.String mailMessage, java.lang.String subject)
Sends a mail with the given attachment to a mail receiver.void
sendPlainMessage(java.lang.String[] to, java.lang.String mailMessage, java.lang.String subject)
Sends a plain message to the given address.void
sendPlainMessage(java.util.List<java.lang.String> to, java.lang.String mailMessage, java.lang.String subject)
Sends a plain message to the given address.
-
-
-
Method Detail
-
getInstance
public static ZKMailSender getInstance()
Returns the instance of the mail sender object.- Returns:
- Singleton instance
-
sendPlainMessage
public void sendPlainMessage(java.lang.String[] to, java.lang.String mailMessage, java.lang.String subject) throws javax.mail.MessagingException
Sends a plain message to the given address.- Parameters:
to
- To mail addressmailMessage
- Mail messagesubject
- Mail subject- Throws:
javax.mail.MessagingException
- Mail exception
-
sendPlainMessage
public void sendPlainMessage(java.util.List<java.lang.String> to, java.lang.String mailMessage, java.lang.String subject) throws javax.mail.MessagingException
Sends a plain message to the given address.- Parameters:
to
- To mail addressmailMessage
- Mail messagesubject
- Mail subject- Throws:
javax.mail.MessagingException
- Mail exception
-
sendAttachmentMessage
public void sendAttachmentMessage(java.util.List<java.lang.String> to, java.util.List<ZKMailAttachment> attachments, java.lang.String mailMessage, java.lang.String subject) throws javax.mail.MessagingException
Sends a mail with the given attachment to a mail receiver.- Parameters:
to
- To mail addressattachments
- The attachments to be sent.mailMessage
- Mail messagesubject
- Mail subject- Throws:
javax.mail.MessagingException
- Mail exception
-
sendAttachmentMessage
public void sendAttachmentMessage(java.lang.String[] to, java.util.List<ZKMailAttachment> attachments, java.lang.String mailMessage, java.lang.String subject) throws javax.mail.MessagingException
Sends a mail with the given attachment to a mail receiver.- Parameters:
to
- To mail addressattachments
- The attachments to be sent.mailMessage
- Mail messagesubject
- Mail subject- Throws:
javax.mail.MessagingException
- Mail exception
-
-