Save This Page
Home » apache-ant-1.8.1 » org.apache.tools » ant » taskdefs » email » [javadoc | source]
org.apache.tools.ant.taskdefs.email
public class: EmailTask [javadoc | source]
java.lang.Object
   org.apache.tools.ant.ProjectComponent
      org.apache.tools.ant.Task
         org.apache.tools.ant.taskdefs.email.EmailTask

All Implemented Interfaces:
    Cloneable

Direct Known Subclasses:
    SendEmail, MimeMail

A task to send SMTP email. This is a refactoring of the SendMail and MimeMail tasks such that both are within a single task.
Nested Class Summary:
public static class  EmailTask.Encoding  Enumerates the encoding constants. 
Field Summary
public static final  String AUTO    Constant to show that the best available mailer should be used. 
public static final  String MIME    Constant to allow the Mime mailer to be requested 
public static final  String UU    Constant to allow the UU mailer to be requested 
public static final  String PLAIN    Constant to allow the plaintext mailer to be requested 
Fields inherited from org.apache.tools.ant.Task:
target,  taskName,  taskType,  wrapper
Fields inherited from org.apache.tools.ant.ProjectComponent:
project,  location,  description
Method from org.apache.tools.ant.taskdefs.email.EmailTask Summary:
addBcc,   addCc,   addFileset,   addFrom,   addMessage,   addReplyTo,   addTo,   createAttachments,   createHeader,   execute,   getCharset,   getIncludeFileNames,   setBccList,   setCcList,   setCharset,   setEnableStartTLS,   setEncoding,   setFailOnError,   setFiles,   setFrom,   setIgnoreInvalidRecipients,   setIncludefilenames,   setMailhost,   setMailport,   setMessage,   setMessageFile,   setMessageMimeType,   setPassword,   setReplyTo,   setSSL,   setSubject,   setToList,   setUser
Methods from org.apache.tools.ant.Task:
bindToOwner,   execute,   getOwningTarget,   getRuntimeConfigurableWrapper,   getTaskName,   getTaskType,   getWrapper,   handleErrorFlush,   handleErrorOutput,   handleFlush,   handleInput,   handleOutput,   init,   isInvalid,   log,   log,   log,   log,   markInvalid,   maybeConfigure,   perform,   reconfigure,   setOwningTarget,   setRuntimeConfigurableWrapper,   setTaskName,   setTaskType
Methods from org.apache.tools.ant.ProjectComponent:
clone,   getDescription,   getLocation,   getProject,   log,   log,   setDescription,   setLocation,   setProject
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.taskdefs.email.EmailTask Detail:
 public  void addBcc(EmailAddress address) 
    Add a "bcc" address element.
 public  void addCc(EmailAddress address) 
    Add a "cc" address element.
 public  void addFileset(FileSet fs) 
    Add a set of files (nested fileset attribute).
 public  void addFrom(EmailAddress address) 
    Add a from address element.
 public  void addMessage(Message message) throws BuildException 
    Add a message element.
 public  void addReplyTo(EmailAddress address) 
    Add a replyto address element.
 public  void addTo(EmailAddress address) 
    Add a to address element.
 public Path createAttachments() 
    Creates a Path as container for attachments. Supports any filesystem resource-collections that way.
 public Header createHeader() 
    Create a nested header element.
 public  void execute() 
    Send an email.
 public String getCharset() 
    Returns the character set of mail message.
 public boolean getIncludeFileNames() 
    Get whether file names should be included.
 public  void setBccList(String list) 
    Shorthand to set the "bcc" address element.
 public  void setCcList(String list) 
    Shorthand to set the "cc" address element.
 public  void setCharset(String charset) 
    Sets the character set of mail message. Will be ignored if mimeType contains ....; Charset=... substring or encoding is not a mime.
 public  void setEnableStartTLS(boolean b) 
    Set whether to allow authentication to switch to a TLS connection via STARTTLS.
 public  void setEncoding(Encoding encoding) 
    Set the preferred encoding method.
 public  void setFailOnError(boolean failOnError) 
    Set whether BuildExceptions should be passed back to the core.
 public  void setFiles(String filenames) 
    Set the list of files to be attached.
 public  void setFrom(String address) 
    Shorthand to set the from address element.
 public  void setIgnoreInvalidRecipients(boolean b) 
    Whether invalid recipients should be ignored (but a warning will be logged) instead of making the task fail.

    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 setIncludefilenames(boolean includeFileNames) 
    Set whether to include filenames.
 public  void setMailhost(String host) 
    Set the host.
 public  void setMailport(int port) 
    Set the mail server port.
 public  void setMessage(String message) 
    Shorthand method to set the message.
 public  void setMessageFile(File file) 
    Shorthand method to set the message from a file.
 public  void setMessageMimeType(String type) 
    Shorthand method to set type of the text message, text/plain by default but text/html or text/xml is quite feasible.
 public  void setPassword(String password) 
    Set the password for SMTP auth; this requires JavaMail.
 public  void setReplyTo(String address) 
    Shorthand to set the replyto address element.
 public  void setSSL(boolean ssl) 
    Set whether to send data over SSL.
 public  void setSubject(String subject) 
    Set the subject line of the email.
 public  void setToList(String list) 
    Shorthand to set the "to" address element.
 public  void setUser(String user) 
    Set the user for SMTP auth; this requires JavaMail.