Example usage for Java org.apache.commons.mail Email fields, constructors, methods, implement or subclass
The text is from its open source code.
String | SENDER_EMAIL |
String | RECEIVER_EMAIL |
String | ISO_8859_1 |
String | MAIL_HOST |
String | MAIL_PORT |
String | MAIL_SMTP_FROM |
String | MAIL_SMTP_USER |
String | TEXT_HTML |
String | TEXT_PLAIN |
String | MAIL_TRANSPORT_TLS |
addBcc(final String email) Add a blind BCC recipient to the email. | |
addBcc(final String... emails) Add an array of blind BCC recipients to the email. | |
addBcc(final String email, final String name) Add a blind BCC recipient to the email using the specified address and the specified personal name. | |
addCc(final String email) Add a recipient CC to the email. | |
addCc(final String... emails) Add an array of CC recipients to the email. | |
addCc(final String email, final String name) Add a recipient CC to the email using the specified address and the specified personal name. | |
void | addHeader(final String name, final String value) Adds a header ( name, value ) to the headers Map. |
addReplyTo(final String email) Add a reply to address to the email. | |
addReplyTo(final String email, final String name) Add a reply to address to the email using the specified address and the specified personal name. | |
addTo(final String email) Add a recipient TO to the email. | |
addTo(final String... emails) Add a list of TO recipients to the email. | |
addTo(final String email, final String name) Add a recipient TO to the email using the specified address and the specified personal name. | |
void | buildMimeMessage() Does the work of actually building the MimeMessage. |
List | getCcAddresses() Get the list of "CC" addresses. |
InternetAddress | getFromAddress() Gets the sender of the email. |
String | getHostName() Gets the host name of the SMTP server, |
Session | getMailSession() Determines the mail session used when sending this Email, creating the Session if necessary. |
MimeMessage | getMimeMessage() Returns the internal MimeMessage. |
String | getSmtpPort() Gets the listening port of the SMTP server. |
String | getSubject() Gets the subject of the email. |
List | getToAddresses() Get the list of "To" addresses. |
boolean | isSSL() Returns whether SSL/TLS encryption for the transport is currently enabled (SMTPS/POPS). |
boolean | isSSLOnConnect() Returns whether SSL/TLS encryption for the transport is currently enabled (SMTPS/POPS). |
boolean | isStartTLSEnabled() Gets whether the client is configured to try to enable STARTTLS. |
boolean | isTLS() Gets whether the client is configured to try to enable STARTTLS. |
String | send() Sends the email. |
void | setAuthentication(final String userName, final String password) Sets the userName and password if authentication is needed. |
void | setAuthenticator(final Authenticator newAuthenticator) Sets the Authenticator to be used when authentication is requested from the mail server. |
setBcc(final Collection Set a list of "BCC" addresses. | |
setBounceAddress(final String email) Set the "bounce address" - the address to which undeliverable messages will be returned. | |
setCc(final Collection Set a list of "CC" addresses. | |
void | setCharset(final String newCharset) Set the charset of the message. |
void | setContent(final Object aObject, final String aContentType) Set the content and contentType. |
void | setDebug(final boolean d) Setting to true will enable the display of debug information. |
setFrom(final String email) Set the FROM field of the email to use the specified address. | |
setFrom(final String email, final String name) Set the FROM field of the email to use the specified address and the specified personal name. | |
void | setHostName(final String aHostName) Set the hostname of the outgoing mail server. |
void | setMailSession(final Session aSession) Supply a mail Session object to use. |
void | setMailSessionFromJNDI(final String jndiName) Supply a mail Session object from a JNDI directory. |
setMsg(String msg) Define the content of the mail. | |
void | setPopBeforeSmtp(final boolean newPopBeforeSmtp, final String newPopHost, final String newPopUsername, final String newPopPassword) Set details regarding "pop3 before smtp" authentication. |
setReplyTo(final Collection Set a list of reply to addresses. | |
void | setSentDate(final Date date) Sets the sent date for the email. |
void | setSmtpPort(final int aPortNumber) Set the port number of the outgoing mail server. |
void | setSocketConnectionTimeout(final int socketConnectionTimeout) Set the socket connection timeout value in milliseconds. |
void | setSocketTimeout(final int socketTimeout) Set the socket I/O timeout value in milliseconds. |
void | setSSL(final boolean ssl) Sets whether SSL/TLS encryption should be enabled for the SMTP transport upon connection (SMTPS/POPS). |
setSSLCheckServerIdentity(final boolean sslCheckServerIdentity) Sets whether the server identity is checked as specified by RFC 2595 | |
setSSLOnConnect(final boolean ssl) Sets whether SSL/TLS encryption should be enabled for the SMTP transport upon connection (SMTPS/POPS). | |
void | setSslSmtpPort(final String sslSmtpPort) Sets the SSL port to use for the SMTP transport. |
setStartTLSEnabled(final boolean startTlsEnabled) Set or disable the STARTTLS encryption. | |
setStartTLSRequired(final boolean startTlsRequired) Set or disable the required STARTTLS encryption. | |
setSubject(final String aSubject) Set the email subject. | |
void | setTLS(final boolean withTLS) Set or disable the STARTTLS encryption. |
setTo(final Collection Set a list of "TO" addresses. | |
String | toString() Returns a string representation of the object. |