Class ZKMailSender

java.lang.Object
com.saperion.ngc.util.ZKMailSender

public final class ZKMailSender extends 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 Details

    • getInstance

      public static ZKMailSender 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 address
      mailMessage - Mail message
      subject - 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 address
      mailMessage - Mail message
      subject - 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 address
      attachments - The attachments to be sent.
      mailMessage - Mail message
      subject - 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 address
      attachments - The attachments to be sent.
      mailMessage - Mail message
      subject - Mail subject
      Throws:
      javax.mail.MessagingException - Mail exception