A task to send SMTP email. This is a refactoring of the SendMail and
MimeMail tasks such that both are within a single task.
addBcc
public void addBcc(EmailAddress address)
Adds "bcc" address elements
address
- The email address
addCc
public void addCc(EmailAddress address)
Adds "cc" address element
address
- The email address
addFileset
public void addFileset(FileSet fs)
Adds a set of files (nested fileset attribute).
fs
- The fileset
addFrom
public void addFrom(EmailAddress address)
Adds a from address element
address
- The address to send from
addReplyTo
public void addReplyTo(EmailAddress address)
Adds a replyto address element
address
- The address to reply to
- ant 1.6
addTo
public void addTo(EmailAddress address)
Adds a to address element
address
- An email address
execute
public void execute()
Sends an email
- execute in interface Task
getCharset
public String getCharset()
Returns the character set of mail message.
- Charset of mail message.
- Ant 1.6
getIncludeFileNames
public boolean getIncludeFileNames()
Identifies whether file names should be included
- Identifies whether file names should be included
setBccList
public void setBccList(String list)
Adds "bcc" address elements
list
- comma separated list of addresses
setCcList
public void setCcList(String list)
Adds "cc" address elements
list
- Comma separated list of addresses
setCharset
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
- Ant 1.6
setEncoding
public void setEncoding(EmailTask.Encoding encoding)
Allows the build writer to choose the preferred encoding method
encoding
- The encoding (one of AUTO,MIME,UU,PLAIN)
setFailOnError
public void setFailOnError(boolean failOnError)
Indicates whether BuildExceptions should be passed back to the core
failOnError
- The new FailOnError value
setFiles
public void setFiles(String filenames)
Adds a list of files to be attached
filenames
- Comma separated list of files
setFrom
public void setFrom(String address)
Shorthand to set the from address element
address
- The address to send mail from
setIncludefilenames
public void setIncludefilenames(boolean includeFileNames)
Sets Includefilenames attribute
includeFileNames
- Whether to include filenames in the text of the
message
setMailhost
public void setMailhost(String host)
Sets the host
host
- The host to connect to
setMailport
public void setMailport(int port)
Sets the mail server port
port
- The port to use
setMessage
public void setMessage(String message)
Shorthand method to set the message
message
- Message body of this email.
setMessageFile
public void setMessageFile(File file)
Shorthand method to set the message from a file
file
- The file from which to take the message
setMessageMimeType
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.
type
- The new MessageMimeType value
setPassword
public void setPassword(String password)
sets the password for SMTP auth; this requires JavaMail
password
-
- ant 1.6
setReplyTo
public void setReplyTo(String address)
Shorthand to set the replyto address element
address
- The address to which replies should be directed
- ant 1.6
setSSL
public void setSSL(boolean SSL)
tells if the user needs to send his data over SSL
SSL
-
- ant 1.6
setSubject
public void setSubject(String subject)
Sets the subject line of the email
subject
- Subject of this email.
setToList
public void setToList(String list)
Adds "to" address elements
list
- Comma separated list of addresses
setUser
public void setUser(String user)
sets the user for SMTP auth; this requires JavaMail
user
-
- ant 1.6