Class MailTool


  • public class MailTool
    extends Object
    Utility functions to send Emails from within the Automation
    Since:
    7.5.1
    Author:
    Marco Meschieri - LogicalDOC
    • Constructor Detail

      • MailTool

        public MailTool()
    • Method Detail

      • sendDocuments

        public void sendDocuments​(Collection<Document> documents,
                                  String from,
                                  String to,
                                  String subject,
                                  String message)
                           throws Exception
        Sends some documents to a recipient
        Parameters:
        documents - collection of documents to send
        from - the email address to be used as From
        to - the email address of the recipient
        subject - subject of the email
        message - message printed in the body of the email
        Throws:
        Exception - error sending the email
      • sendDocuments

        public void sendDocuments​(Collection<Document> documents,
                                  String from,
                                  Collection<String> to,
                                  String subject,
                                  String message)
                           throws Exception
        Sends some documents to a selection of recipients
        Parameters:
        documents - collection of documents to send
        from - the email address to be used as From
        to - collection of email addresses to send the email to
        subject - subject of the email
        message - message printed in the body of the email
        Throws:
        Exception - error sending the email
      • sendDocument

        public void sendDocument​(Document document,
                                 String from,
                                 String to,
                                 String subject,
                                 String message)
                          throws Exception
        Sends a document by email to a recipient
        Parameters:
        document - the document to send
        from - the email address to be used as From
        to - email addresses of the recipient
        subject - subject of the email
        message - message printed in the body of the email
        Throws:
        Exception - error sending the email
      • sendDocument

        public void sendDocument​(Document document,
                                 String from,
                                 Collection<String> to,
                                 String subject,
                                 String message)
                          throws Exception
        Sends a document by email to a selection of recipients
        Parameters:
        document - the document to send
        from - the email address to be used as From
        to - collection of email addresses to send the email to
        subject - subject of the email
        message - message printed in the body of the email
        Throws:
        Exception - error sending the email
      • sendMessage

        public void sendMessage​(long tenantId,
                                String from,
                                Collection<String> to,
                                String subject,
                                String message)
                         throws Exception
        Sends a simple email to a selection of recipients
        Parameters:
        tenantId - identifier of the tenant
        from - the email address to be used as From
        to - collection of email addresses to send the email to
        subject - subject of the email
        message - message printed in the body of the email
        Throws:
        Exception - error sending the email
      • sendMessage

        public void sendMessage​(long tenantId,
                                String from,
                                String to,
                                String subject,
                                String message)
                         throws Exception
        Sends a simple email to a recipient
        Parameters:
        tenantId - identifier of the tenant
        from - the email address to be used as From
        to - email address of the recipient
        subject - subject of the email
        message - message printed in the body of the email
        Throws:
        Exception - error sending the email