Package com.saperion.ngc.util
Class ZKMailSender
java.lang.Object
com.saperion.ngc.util.ZKMailSender
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
Modifier and TypeMethodDescriptionstatic ZKMailSender
Returns the instance of the mail sender object.void
sendAttachmentMessage
(String[] to, List<ZKMailAttachment> attachments, String mailMessage, String subject) Sends a mail with the given attachment to a mail receiver.void
sendAttachmentMessage
(List<String> to, List<ZKMailAttachment> attachments, String mailMessage, String subject) Sends a mail with the given attachment to a mail receiver.void
sendPlainMessage
(String[] to, String mailMessage, String subject) Sends a plain message to the given address.void
sendPlainMessage
(List<String> to, String mailMessage, String subject) Sends a plain message to the given address.
-
Method Details
-
getInstance
Returns the instance of the mail sender object.- Returns:
- Singleton instance
-
sendPlainMessage
public void sendPlainMessage(String[] to, String mailMessage, 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(List<String> to, String mailMessage, 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(List<String> to, List<ZKMailAttachment> attachments, String mailMessage, 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(String[] to, List<ZKMailAttachment> attachments, String mailMessage, 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
-