org.codehaus.plexus.mailsender
Class MailMessage

java.lang.Object
  extended by org.codehaus.plexus.mailsender.MailMessage
Direct Known Subclasses:
SimpleMailMessage

public class MailMessage
extends Object

Version:
$Id: MailMessage.java 5555 2007-02-01 15:17:45Z evenisse $
Author:
Trygve Laugstøl, Emmanuel Venisse

Nested Class Summary
static class MailMessage.Address
           
 
Field Summary
static String TYPE_HTML
           
static String TYPE_TEXT
           
 
Constructor Summary
MailMessage()
           
 
Method Summary
 void addBcc(MailMessage.Address bcc)
           
 void addBcc(String mailbox, String name)
           
 void addCc(MailMessage.Address cc)
           
 void addCc(String mailbox, String name)
           
 void addHeader(String headerName, String headerValue)
          Adds the given value to the headers identified by headerName.
 void addTo(MailMessage.Address to)
           
 void addTo(String mailbox, String name)
           
 List getBccAddresses()
           
 List getCcAddresses()
           
 String getContent()
           
 String getContentType()
           
 MailMessage.Address getFrom()
           
 Map getHeaders()
           
 MailMessage.Address getReplyTo()
           
 Date getSendDate()
           
 String getSubject()
           
 List getToAddresses()
           
 void setContent(String content)
           
 void setContentType(String contentType)
           
 void setFrom(MailMessage.Address from)
           
 void setFrom(String mailbox, String name)
           
 List setHeader(String headerName, String headerValue)
          Sets the named header to the given value.
 void setReplyTo(MailMessage.Address replyTo)
           
 void setReplyTo(String mailbox, String name)
           
 void setSendDate(Date sendDate)
           
 void setSubject(String subject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_HTML

public static final String TYPE_HTML
See Also:
Constant Field Values

TYPE_TEXT

public static final String TYPE_TEXT
See Also:
Constant Field Values
Constructor Detail

MailMessage

public MailMessage()
Method Detail

getFrom

public MailMessage.Address getFrom()

setFrom

public void setFrom(String mailbox,
                    String name)
             throws MailSenderException
Throws:
MailSenderException

setFrom

public void setFrom(MailMessage.Address from)

getReplyTo

public MailMessage.Address getReplyTo()

setReplyTo

public void setReplyTo(String mailbox,
                       String name)
                throws MailSenderException
Throws:
MailSenderException

setReplyTo

public void setReplyTo(MailMessage.Address replyTo)

getToAddresses

public List getToAddresses()

addTo

public void addTo(String mailbox,
                  String name)
           throws MailSenderException
Throws:
MailSenderException

addTo

public void addTo(MailMessage.Address to)
           throws MailSenderException
Throws:
MailSenderException

getCcAddresses

public List getCcAddresses()

addCc

public void addCc(String mailbox,
                  String name)
           throws MailSenderException
Throws:
MailSenderException

addCc

public void addCc(MailMessage.Address cc)
           throws MailSenderException
Throws:
MailSenderException

getBccAddresses

public List getBccAddresses()

addBcc

public void addBcc(String mailbox,
                   String name)
            throws MailSenderException
Throws:
MailSenderException

addBcc

public void addBcc(MailMessage.Address bcc)
            throws MailSenderException
Throws:
MailSenderException

getSubject

public String getSubject()

setSubject

public void setSubject(String subject)

getContent

public String getContent()

setContent

public void setContent(String content)

getContentType

public String getContentType()

setContentType

public void setContentType(String contentType)

getSendDate

public Date getSendDate()

setSendDate

public void setSendDate(Date sendDate)

getHeaders

public Map getHeaders()

addHeader

public void addHeader(String headerName,
                      String headerValue)
Adds the given value to the headers identified by headerName. RFC 822 provides the rules for what text may constitute a header name and value.

Parameters:
headerName - the name of the header to append this value to
headerValue - the value to append

setHeader

public List setHeader(String headerName,
                      String headerValue)
Sets the named header to the given value. RFC 822 provides the rules for what text may constitute a header name and value.

Parameters:
headerName - the named header to set
headerValue - the value to set
Returns:
the List of values that was previously set under this headerName


Copyright © 2001-2012 Codehaus. All Rights Reserved.