public class Emailer
extends java.lang.Object
Constructor and Description |
---|
Emailer() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Command line interface for sending emails.
|
static void |
processHtml(org.apache.commons.mail.HtmlEmail email,
EmailDefinition def)
Process embedded images and modify the
|
static void |
send(EmailDefinition def)
Constructs and sends an email using the given data and configuration.
|
static void |
setupEmail(org.apache.commons.mail.HtmlEmail email,
EmailDefinition def)
Configure the email instance for the FROM, TO, CC, BCC addresses, the subject and the
content.
|
static void |
setupSession(org.apache.commons.mail.HtmlEmail email,
EmailDefinition def)
Configure the email instance for the correct connection security type, host, port and
authentication needed.
|
public static void send(EmailDefinition def) throws org.apache.commons.mail.EmailException, java.net.MalformedURLException
def
- The configuration and data needed to send the email.org.apache.commons.mail.EmailException
java.net.MalformedURLException
public static void setupSession(org.apache.commons.mail.HtmlEmail email, EmailDefinition def) throws org.apache.commons.mail.EmailException
def
- The configuration and data needed to send the email.org.apache.commons.mail.EmailException
public static void setupEmail(org.apache.commons.mail.HtmlEmail email, EmailDefinition def) throws org.apache.commons.mail.EmailException, java.net.MalformedURLException
def
- The configuration and data needed to send the email.org.apache.commons.mail.EmailException
java.net.MalformedURLException
public static void processHtml(org.apache.commons.mail.HtmlEmail email, EmailDefinition def) throws org.apache.commons.mail.EmailException, java.net.MalformedURLException
org.apache.commons.mail.EmailException
java.net.MalformedURLException
public static void main(java.lang.String[] args)
Syntax:
java -classpath p2j.jar com.goldencode.email.Emailermode = UNENCRYPTED, STARTTLS_WHEN_AVAILABLE, STARTTLS_REQUIRED or SSL host = IP address or hostname of the SMTP server port = port of the SMTP server userid = user for SMTP authentication or the text "null" for no userid password = password for SMTP authentication or the text "null" for no password from = FROM email address to = TO email address subject = SUBJECT line text = text content of the message
args
- Command line arguments.