Modifier and Type | Class and Description |
---|---|
static class |
EmailTask.Encoding
Enumerates the encoding constants.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTO
Constant to show that the best available mailer should be used.
|
static java.lang.String |
MIME
Constant to allow the Mime mailer to be requested
|
static java.lang.String |
PLAIN
Constant to allow the plaintext mailer to be requested
|
static java.lang.String |
UU
Constant to allow the UU mailer to be requested
|
description, location, project
Constructor and Description |
---|
EmailTask() |
Modifier and Type | Method and Description |
---|---|
void |
addBcc(EmailAddress address)
Add a "bcc" address element.
|
void |
addCc(EmailAddress address)
Add a "cc" address element.
|
void |
addFileset(FileSet fs)
Add a set of files (nested fileset attribute).
|
void |
addFrom(EmailAddress address)
Add a from address element.
|
void |
addMessage(Message message)
Add a message element.
|
void |
addReplyTo(EmailAddress address)
Add a replyto address element.
|
void |
addTo(EmailAddress address)
Add a to address element.
|
Path |
createAttachments()
Creates a Path as container for attachments.
|
Header |
createHeader()
Create a nested header element.
|
void |
execute()
Send an email.
|
java.lang.String |
getCharset()
Returns the character set of mail message.
|
boolean |
getIncludeFileNames()
Get whether file names should be included.
|
void |
setBccList(java.lang.String list)
Shorthand to set the "bcc" address element.
|
void |
setCcList(java.lang.String list)
Shorthand to set the "cc" address element.
|
void |
setCharset(java.lang.String charset)
Sets the character set of mail message.
|
void |
setEnableStartTLS(boolean b)
Set whether to allow authentication to switch to a TLS
connection via STARTTLS.
|
void |
setEncoding(EmailTask.Encoding encoding)
Set the preferred encoding method.
|
void |
setFailOnError(boolean failOnError)
Set whether BuildExceptions should be passed back to the core.
|
void |
setFiles(java.lang.String filenames)
Set the list of files to be attached.
|
void |
setFrom(java.lang.String address)
Shorthand to set the from address element.
|
void |
setIgnoreInvalidRecipients(boolean b)
Whether invalid recipients should be ignored (but a warning
will be logged) instead of making the task fail.
|
void |
setIncludefilenames(boolean includeFileNames)
Set whether to include filenames.
|
void |
setMailhost(java.lang.String host)
Set the host.
|
void |
setMailport(int port)
Set the mail server port.
|
void |
setMessage(java.lang.String message)
Shorthand method to set the message.
|
void |
setMessageFile(java.io.File file)
Shorthand method to set the message from a file.
|
void |
setMessageMimeType(java.lang.String type)
Shorthand method to set type of the text message, text/plain by default
but text/html or text/xml is quite feasible.
|
void |
setPassword(java.lang.String password)
Set the password for SMTP auth; this requires JavaMail.
|
void |
setReplyTo(java.lang.String address)
Shorthand to set the replyto address element.
|
void |
setSSL(boolean ssl)
Set whether to send data over SSL.
|
void |
setSubject(java.lang.String subject)
Set the subject line of the email.
|
void |
setToList(java.lang.String list)
Shorthand to set the "to" address element.
|
void |
setUser(java.lang.String user)
Set the user for SMTP auth; this requires JavaMail.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
public static final java.lang.String AUTO
public static final java.lang.String MIME
public static final java.lang.String UU
public static final java.lang.String PLAIN
public void setUser(java.lang.String user)
user
- the String username.public void setPassword(java.lang.String password)
password
- the String password.public void setSSL(boolean ssl)
ssl
- boolean; if true SSL will be used.public void setEnableStartTLS(boolean b)
b
- boolean; if true STARTTLS will be supported.public void setEncoding(EmailTask.Encoding encoding)
encoding
- The encoding (one of AUTO, MIME, UU, PLAIN).public void setMailport(int port)
port
- The port to use.public void setMailhost(java.lang.String host)
host
- The host to connect to.public void setSubject(java.lang.String subject)
subject
- Subject of this email.public void setMessage(java.lang.String message)
message
- Message body of this email.public void setMessageFile(java.io.File file)
file
- The file from which to take the message.public void setMessageMimeType(java.lang.String type)
type
- The new MessageMimeType value.public void addMessage(Message message) throws BuildException
message
- The message object.BuildException
- if a message has already been added.public void addFrom(EmailAddress address)
address
- The address to send from.public void setFrom(java.lang.String address)
address
- The address to send mail from.public void addReplyTo(EmailAddress address)
address
- The address to reply to.public void setReplyTo(java.lang.String address)
address
- The address to which replies should be directed.public void addTo(EmailAddress address)
address
- An email address.public void setToList(java.lang.String list)
list
- Comma-separated list of addresses.public void addCc(EmailAddress address)
address
- The email address.public void setCcList(java.lang.String list)
list
- Comma separated list of addresses.public void addBcc(EmailAddress address)
address
- The email address.public void setBccList(java.lang.String list)
list
- comma separated list of addresses.public void setFailOnError(boolean failOnError)
failOnError
- The new FailOnError value.public void setFiles(java.lang.String filenames)
filenames
- Comma-separated list of files.public void addFileset(FileSet fs)
fs
- The fileset.public Path createAttachments()
public Header createHeader()
public void setIncludefilenames(boolean includeFileNames)
includeFileNames
- Whether to include filenames in the text of the
message.public boolean getIncludeFileNames()
public void setIgnoreInvalidRecipients(boolean b)
Even with this property set to true the task will still fail if the mail couldn't be sent to any recipient at all.
public void setCharset(java.lang.String charset)
mime
.charset
- the character encoding to use.public java.lang.String getCharset()