|
EmailTask (Apache Ant API)
org.apache.tools.ant.taskdefs.email
|
Nested Class Summary | |
static class |
EmailTask.Encoding
Enumerates the encoding constants |
Field Summary | |
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 |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
EmailTask()
|
Method Summary | |
void |
addBcc(EmailAddress address)
Adds "bcc" address elements |
void |
addCc(EmailAddress address)
Adds "cc" address element |
void |
addFileset(FileSet fs)
Adds a set of files (nested fileset attribute). |
void |
addFrom(EmailAddress address)
Adds a from address element |
void |
addMessage(Message message)
Add a message elemnt |
void |
addTo(EmailAddress address)
Adds a to address element |
void |
execute()
Sends an email |
boolean |
getIncludeFileNames()
Identifies whether file names should be included |
void |
setBccList(java.lang.String list)
Adds "bcc" address elements |
void |
setCcList(java.lang.String list)
Adds "cc" address elements |
void |
setEncoding(EmailTask.Encoding encoding)
Allows the build writer to choose the preferred encoding method |
void |
setFailOnError(boolean failOnError)
Indicates whether BuildExceptions should be passed back to the core |
void |
setFiles(java.lang.String filenames)
Adds a list of files to be attached |
void |
setFrom(java.lang.String address)
Shorthand to set the from address element |
void |
setIncludefilenames(boolean includeFileNames)
Sets Includefilenames attribute |
void |
setMailhost(java.lang.String host)
Sets the host |
void |
setMailport(int port)
Sets 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 |
void |
setSubject(java.lang.String subject)
Sets the subject line of the email |
void |
setToList(java.lang.String list)
Adds "to" address elements |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
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
Constructor Detail |
public EmailTask()
Method Detail |
public void setEncoding(EmailTask.Encoding encoding)
encoding
- The encoding (one of AUTO,MIME,UU,PLAIN)public void setMailport(int port)
port
- The port to usepublic void setMailhost(java.lang.String host)
host
- The host to connect topublic 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 messagepublic void setMessageMimeType(java.lang.String type)
type
- The new MessageMimeType valuepublic void addMessage(Message message) throws BuildException
message
- The message object
BuildException
- if a message has already been addedpublic void addFrom(EmailAddress address)
address
- The address to send frompublic void setFrom(java.lang.String address)
address
- The address to send mail frompublic void addTo(EmailAddress address)
address
- An email addresspublic void setToList(java.lang.String list)
list
- Comma separated list of addressespublic void addCc(EmailAddress address)
address
- The email addresspublic void setCcList(java.lang.String list)
list
- Comma separated list of addressespublic void addBcc(EmailAddress address)
address
- The email addresspublic void setBccList(java.lang.String list)
list
- comma separated list of addressespublic void setFailOnError(boolean failOnError)
failOnError
- The new FailOnError valuepublic void setFiles(java.lang.String filenames)
filenames
- Comma separated list of filespublic void addFileset(FileSet fs)
fs
- The filesetpublic void setIncludefilenames(boolean includeFileNames)
includeFileNames
- Whether to include filenames in the text of the
messagepublic boolean getIncludeFileNames()
public void execute()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |