public abstract class JavaMailer2 extends Object
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
JavaMailer2.LoggingByteArrayOutputStream
log 
 | 
static class  | 
JavaMailer2.LoggingTransportListener  | 
| Constructor and Description | 
|---|
JavaMailer2()
Default constructor. 
 | 
JavaMailer2(Properties javamailProps)
Constructor for JavaMailer2. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
javax.mail.Authenticator | 
createAuthenticator(String user,
                   String password)
Helper method to create an Authenticator based on Password Authentication 
 | 
javax.mail.internet.MimeBodyPart | 
createFileAttachment(File file)
Create a file attachment as a MimeBodyPart, checking to see if the file
 exists before we create the attachment. 
 | 
Properties | 
getMailProps()
This returns the properties configured in the javamail-configuration.properties file. 
 | 
javax.mail.Session | 
getSession()
getSession 
 | 
void | 
setDebug(boolean debug)
setDebug 
 | 
void | 
setSession(javax.mail.Session session)
setSession 
 | 
public JavaMailer2(Properties javamailProps) throws JavaMailerException
Constructor for JavaMailer2.
javamailProps - a Properties object.JavaMailerException - if any.public JavaMailer2()
            throws JavaMailerException
IOException - if any.JavaMailerException - if any.public javax.mail.Authenticator createAuthenticator(String user, String password)
public javax.mail.internet.MimeBodyPart createFileAttachment(File file) throws javax.mail.MessagingException, JavaMailerException
file - file to attachjavax.mail.MessagingException - if we can't set the data handler or
      the file name on the MimeBodyPartJavaMailerException - if the file does not exist or is not
      readablepublic void setDebug(boolean debug)
setDebug
debug - a boolean.public javax.mail.Session getSession()
getSession
public void setSession(javax.mail.Session session)
setSession
session - the session to setpublic Properties getMailProps()
Properties object.Copyright © 2020. All rights reserved.