public class JavaSendMailer extends JavaMailer2
Crude extension of JavaMailer
TODO: Improve class hierarchy
TODO: Needs testing
JavaMailer2.LoggingByteArrayOutputStream, JavaMailer2.LoggingTransportListener| Constructor and Description |
|---|
JavaSendMailer(SendmailConfig config)
Instantiates a new java send mailer.
|
JavaSendMailer(SendmailConfig config,
boolean useJmProps)
Instantiates a new java send mailer.
|
| Modifier and Type | Method and Description |
|---|---|
javax.mail.internet.MimeMessage |
buildMimeMessage(SendmailMessage msg)
Builds the mime message.
|
javax.mail.Authenticator |
createAuthenticator()
Creates the authenticator.
|
SendmailConfig |
getConfig()
Gets the sendmail configuration.
|
javax.mail.internet.MimeMessage |
getMessage()
Gets the message.
|
Properties |
getProperties()
Gets the properties.
|
void |
send()
Send.
|
void |
send(javax.mail.internet.MimeMessage message)
Send.
|
void |
setConfig(SendmailConfig config)
Sets the sendmail configuration.
|
void |
setMessage(javax.mail.internet.MimeMessage message)
Sets the message.
|
void |
setProperties(Properties properties)
Sets the properties.
|
createAuthenticator, createFileAttachment, getMailProps, getSession, setDebug, setSessionpublic JavaSendMailer(SendmailConfig config, boolean useJmProps) throws JavaMailerException
Constructs everything required to call send().
config - the sendmail configurationuseJmProps - a boolean representing the handling of the deprecated javamail-configuration.properties file.JavaMailerException - the java mailer exceptionpublic JavaSendMailer(SendmailConfig config) throws JavaMailerException
Using this constructor implies overriding sendmail configuration with properties from the deprecated javamail-configuration.properties file.
config - the sendmail configurationJavaMailerException - the java mailer exceptionpublic javax.mail.internet.MimeMessage buildMimeMessage(SendmailMessage msg)
msg - the sendmail messagepublic javax.mail.Authenticator createAuthenticator()
public void send()
throws JavaMailerException
JavaMailerException - the java mailer exceptionpublic void send(javax.mail.internet.MimeMessage message)
throws JavaMailerException
message - the messageJavaMailerException - the java mailer exceptionpublic void setConfig(SendmailConfig config)
config - the new sendmail configurationpublic SendmailConfig getConfig()
public void setMessage(javax.mail.internet.MimeMessage message)
message - the new messagepublic javax.mail.internet.MimeMessage getMessage()
public void setProperties(Properties properties)
properties - the new propertiespublic Properties getProperties()
Copyright © 2020. All rights reserved.