Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 address
        mailMessage - Mail message
        subject - 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 address
        mailMessage - Mail message
        subject - 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 address
        attachments - The attachments to be sent.
        mailMessage - Mail message
        subject - 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 address
        attachments - The attachments to be sent.
        mailMessage - Mail message
        subject - Mail subject
        Throws:
        javax.mail.MessagingException - Mail exception