org.apache.tools.ant.taskdefs.email
public abstract class Mailer extends Object
Since: Ant 1.5
Field Summary | |
---|---|
protected Vector | bccList |
protected Vector | ccList |
protected Vector | files |
protected EmailAddress | from |
protected Vector | headers |
protected String | host |
protected boolean | includeFileNames |
protected Message | message |
protected String | password |
protected int | port |
protected Vector | replyToList |
protected String | subject |
protected boolean | SSL |
protected Task | task |
protected Vector | toList |
protected String | user |
Method Summary | |
---|---|
protected String | getDate()
Return the current Date in a format suitable for a SMTP date
header.
|
protected boolean | isStartTLSEnabled() |
abstract void | send()
Send the email.
|
void | setBccList(Vector list)
Set the bcc addresses.
|
void | setCcList(Vector list)
Set the cc addresses.
|
void | setEnableStartTLS(boolean b)
Set whether to allow authentication to switch to a TLS
connection via STARTTLS. |
void | setFiles(Vector files)
Set the files to attach.
|
void | setFrom(EmailAddress from)
Set the address to send from.
|
void | setHeaders(Vector v)
Set the generic headers to add to the email. |
void | setHost(String host)
Set the mail server.
|
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 b)
Indicate whether filenames should be listed in the body.
|
void | setMessage(Message m)
Set the message.
|
void | setPassword(String password)
Set the password for smtp auth.
|
void | setPort(int port)
Set the smtp port.
|
void | setReplyToList(Vector list)
Set the replyto addresses.
|
void | setSSL(boolean ssl)
Set whether to send the mail through SSL.
|
void | setSubject(String subject)
Set the subject.
|
void | setTask(Task task)
Set the owning task.
|
void | setToList(Vector list)
Set the to addresses.
|
void | setUser(String user)
Set the user for smtp auth.
|
protected boolean | shouldIgnoreInvalidRecipients()
Whether invalid recipients should be ignored.
|
Returns: the current date in SMTP suitable format.
Since: Ant 1.5
Throws: BuildException if the email can't be sent.
Parameters: list a vector of the bcc addresses.
Parameters: list a vector of cc addresses.
Parameters: b boolean; if true STARTTLS will be supported.
Since: Ant 1.8.0
Parameters: files list of files to attach to the email.
Parameters: from the sender.
Parameters: v a Vector presumed to contain Header objects.
Since: Ant 1.7
Parameters: host the mail server name.
Even with this property set to true the task will still fail if the mail couldn't be sent to any recipient at all.
Since: Ant 1.8.0
Parameters: b if true list attached file names in the body content.
Parameters: m the message content.
Parameters: password the authentication password.
Since: Ant 1.6
Parameters: port the SMTP port.
Parameters: list a vector of reployTo addresses.
Since: Ant 1.6
Parameters: ssl if true use SSL transport.
Since: Ant 1.6
Parameters: subject the subject line.
Parameters: task the owning task instance.
Parameters: list a vector of recipient addresses.
Parameters: user the username.
Since: Ant 1.6
Since: Ant 1.8.0