Class EMailSender


  • public class EMailSender
    extends Object
    SMTP E-Mail sender service
    Author:
    Michael Scholz, Matteo Caruso - LogicalDOC
    • Constructor Detail

      • EMailSender

        public EMailSender​(long tenant)
      • EMailSender

        public EMailSender​(String tenant)
      • EMailSender

        public EMailSender()
    • Method Detail

      • getSender

        public String getSender()
      • setSender

        public void setSender​(String sender)
      • getHost

        public String getHost()
      • setHost

        public void setHost​(String host)
      • getPassword

        public String getPassword()
      • setPassword

        public void setPassword​(String password)
      • getPort

        public int getPort()
      • setPort

        public void setPort​(int port)
      • getUsername

        public String getUsername()
      • setUsername

        public void setUsername​(String username)
      • sendAsync

        public void sendAsync​(EMail email,
                              String templateName,
                              Map<String,​Object> dictionary)
        Same as send(EMail, String, Map) but executes in another thread
        Parameters:
        email - the email to send
        templateName - the template to use to render the body of the message using the automation engine
        dictionary - map of variable to pass to the automation
      • send

        public void send​(EMail email,
                         String templateName,
                         Map<String,​Object> dictionary)
                  throws Exception
        Sends an email by using a given template
        Parameters:
        email - The email to send
        templateName - Name of the template to be applied
        dictionary - The dictionary to be used in the template
        Throws:
        Exception - raised if the message cannot be sent
      • sendAsync

        public void sendAsync​(EMail email)
        Same as send(EMail) but executes in another thread
        Parameters:
        email - the email to send
      • send

        public void send​(EMail email)
                  throws Exception
        This method sends an email using the smtp-protocol. The email can be a simple mail or a multipart mail containing up to 5 attachments.
        Parameters:
        email - E-Mail which should be sent.
        Throws:
        Exception - raised if the email cannot be sent
      • isAuthEncripted

        public boolean isAuthEncripted()
      • setAuthEncripted

        public void setAuthEncripted​(boolean authEncripted)
      • getConnectionSecurity

        public int getConnectionSecurity()
      • setConnectionSecurity

        public void setConnectionSecurity​(int connectionSecurity)