FileDocCategorySizeDatePackage
Mailer.javaAPI DocApache Ant 1.705320Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.taskdefs.email

Mailer

public abstract class Mailer extends Object
Base class for the various emailing implementations.
since
Ant 1.5

Fields Summary
protected String
host
protected int
port
protected String
user
protected String
password
protected boolean
SSL
protected Message
message
protected EmailAddress
from
protected Vector
replyToList
protected Vector
toList
protected Vector
ccList
protected Vector
bccList
protected Vector
files
protected String
subject
protected org.apache.tools.ant.Task
task
protected boolean
includeFileNames
protected Vector
headers
Constructors Summary
Methods Summary
protected final java.lang.StringgetDate()
Return the current Date in a format suitable for a SMTP date header.

return
the current date in SMTP suitable format.
since
Ant 1.5

        return DateUtils.getDateForHeader();
    
public abstract voidsend()
Send the email.

throws
BuildException if the email can't be sent.

public voidsetBccList(java.util.Vector list)
Set the bcc addresses.

param
list a vector of the bcc addresses.

        this.bccList = list;
    
public voidsetCcList(java.util.Vector list)
Set the cc addresses.

param
list a vector of cc addresses.

        this.ccList = list;
    
public voidsetFiles(java.util.Vector files)
Set the files to attach.

param
files list of files to attach to the email.

        this.files = files;
    
public voidsetFrom(EmailAddress from)
Set the address to send from.

param
from the sender.

        this.from = from;
    
public voidsetHeaders(java.util.Vector v)
Set the generic headers to add to the email.

param
v a Vector presumed to contain Header objects.
since
Ant 1.7

        this.headers = v;
    
public voidsetHost(java.lang.String host)
Set the mail server.

param
host the mail server name.

    // CheckStyle:VisibilityModifier ON

                   
        
        this.host = host;
    
public voidsetIncludeFileNames(boolean b)
Indicate whether filenames should be listed in the body.

param
b if true list attached file names in the body content.

        this.includeFileNames = b;
    
public voidsetMessage(Message m)
Set the message.

param
m the message content.

        this.message = m;
    
public voidsetPassword(java.lang.String password)
Set the password for smtp auth.

param
password the authentication password.
since
Ant 1.6

        this.password = password;
    
public voidsetPort(int port)
Set the smtp port.

param
port the SMTP port.

        this.port = port;
    
public voidsetReplyToList(java.util.Vector list)
Set the replyto addresses.

param
list a vector of reployTo addresses.
since
Ant 1.6

        this.replyToList = list;
    
public voidsetSSL(boolean ssl)
Set whether to send the mail through SSL.

param
ssl if true use SSL transport.
since
Ant 1.6

        this.SSL = ssl;
    
public voidsetSubject(java.lang.String subject)
Set the subject.

param
subject the subject line.

        this.subject = subject;
    
public voidsetTask(org.apache.tools.ant.Task task)
Set the owning task.

param
task the owning task instance.

        this.task = task;
    
public voidsetToList(java.util.Vector list)
Set the to addresses.

param
list a vector of recipient addresses.

        this.toList = list;
    
public voidsetUser(java.lang.String user)
Set the user for smtp auth.

param
user the username.
since
Ant 1.6

        this.user = user;