Class DefaultMailContext

    • Method Detail

      • setAddressFilter

        public void setAddressFilter​(Predicate<javax.mail.Address> addressFilter)
        Description copied from interface: IMailContext
        Sets an filter for excluding mail addresses during send
        Specified by:
        setAddressFilter in interface IMailContext
        Parameters:
        addressFilter - the address filter to set
      • buildAuthenticator

        protected javax.mail.Authenticator buildAuthenticator()
      • buildProperties

        protected Properties buildProperties()
      • send

        public void send​(IBaseMailData mail,
                         Mandant client)
                  throws Exception
        Description copied from interface: IMailContext
        Sends an mail based on the given data
        Specified by:
        send in interface IMailContext
        Parameters:
        mail - Data of the email to send.
        client - the client to use for placeholder replacements
        Throws:
        Exception - on errors while sending the mail
      • archive

        public void archive​(IBaseMailData mail,
                            Mandant client,
                            File file)
                     throws Exception
        Description copied from interface: IMailContext
        Create an archived file of the mail.
        Specified by:
        archive in interface IMailContext
        Parameters:
        mail - Data of the email to send.
        client - The client to use for placeholder replacements.
        file - The file to write to.
        Throws:
        Exception - When the archive file could not be created.
      • createMimeMessage

        protected javax.mail.internet.MimeMessage createMimeMessage​(IBaseMailData mail,
                                                                    Mandant client)
                                                             throws javax.mail.MessagingException
        Throws:
        javax.mail.MessagingException
      • createMimeMessage

        protected javax.mail.internet.MimeMessage createMimeMessage​(javax.mail.Session session,
                                                                    IBaseMailData mail,
                                                                    Mandant client)
                                                             throws javax.mail.MessagingException
        Throws:
        javax.mail.MessagingException
      • filterAddresses

        protected javax.mail.Address[] filterAddresses​(javax.mail.Address[] addresses)
      • buildContent

        protected void buildContent​(IBaseMailData mail,
                                    javax.mail.internet.MimeMessage msg,
                                    Mandant client)
                             throws javax.mail.MessagingException
        Throws:
        javax.mail.MessagingException