Class JavaMailer2

    • Method Detail

      • createAuthenticator

        public javax.mail.Authenticator createAuthenticator​(String user,
                                                            String password)
        Helper method to create an Authenticator based on Password Authentication
        Parameters:
        user - a String object.
        password - a String object.
        Returns:
        a Authenticator object.
      • createFileAttachment

        public javax.mail.internet.MimeBodyPart createFileAttachment​(File file)
                                                              throws javax.mail.MessagingException,
                                                                     JavaMailerException
        Create a file attachment as a MimeBodyPart, checking to see if the file exists before we create the attachment.
        Parameters:
        file - file to attach
        Returns:
        attachment body part
        Throws:
        javax.mail.MessagingException - if we can't set the data handler or the file name on the MimeBodyPart
        JavaMailerException - if the file does not exist or is not readable
      • setDebug

        public void setDebug​(boolean debug)

        setDebug

        Parameters:
        debug - a boolean.
      • getSession

        public javax.mail.Session getSession()

        getSession

        Returns:
        the session
      • setSession

        public void setSession​(javax.mail.Session session)

        setSession

        Parameters:
        session - the session to set
      • getMailProps

        public Properties getMailProps()
        This returns the properties configured in the javamail-configuration.properties file.
        Returns:
        a Properties object.