| java.lang.Object org.apache.commons.mail.Email org.apache.commons.mail.MultiPartEmail
All known Subclasses: org.apache.commons.mail.HtmlEmail, org.apache.commons.mail.mocks.MockMultiPartEmailConcrete,
MultiPartEmail | public class MultiPartEmail extends Email (Code) | | A multipart email.
This class is used to send multi-part internet email like
messages with attachments.
To create a multi-part email, call the default constructor and
then you can call setMsg() to set the message and call the
different attach() methods.
since: 1.0 author: Quinton McCombs author: Jon S. Stevens author: Frank Y. Kim author: Brett McLaughlin author: Regis Koenig author: Corey Scott version: $Id: MultiPartEmail.java 279285 2005-09-07 09:52:44Z henning $ |
Method Summary | |
public Email | addPart(String partContent, String partContentType) Add a new part to the email.
Parameters: partContent - The content. Parameters: partContentType - The content type. | public Email | addPart(MimeMultipart multipart) Add a new part to the email.
Parameters: multipart - The MimeMultipart. | public Email | addPart(MimeMultipart multipart, int index) Add a new part to the email.
Parameters: multipart - The part to add. Parameters: index - The index to add at. | public MultiPartEmail | attach(EmailAttachment attachment) Attach an EmailAttachment.
Parameters: attachment - An EmailAttachment. | public MultiPartEmail | attach(URL url, String name, String description) Attach a file located by its URL. | public MultiPartEmail | attach(URL url, String name, String description, String disposition) Attach a file located by its URL.
Parameters: url - The URL of the file (may be any valid URL). Parameters: name - The name field for the attachment. Parameters: description - A description for the attachment. Parameters: disposition - Either mixed or inline. | public MultiPartEmail | attach(DataSource ds, String name, String description) Attach a file specified as a DataSource interface.
Parameters: ds - A DataSource interface for the file. Parameters: name - The name field for the attachment. Parameters: description - A description for the attachment. | public MultiPartEmail | attach(DataSource ds, String name, String description, String disposition) Attach a file specified as a DataSource interface.
Parameters: ds - A DataSource interface for the file. Parameters: name - The name field for the attachment. Parameters: description - A description for the attachment. Parameters: disposition - Either mixed or inline. | public void | buildMimeMessage() | protected BodyPart | createBodyPart() Method that can be overridden if you don't
want to create a MimeBodyPart. | protected MimeMultipart | createMimeMultipart() | protected MimeMultipart | getContainer() Gets the message container. | protected BodyPart | getPrimaryBodyPart() Gets first body part of the message. | public String | getSubType() Get the MIME subtype of the email. | protected void | init() Initialize the multipart email. | public boolean | isBoolHasAttachments() | protected boolean | isInitialized() | public void | setBoolHasAttachments(boolean b) | protected void | setInitialized(boolean b) | public Email | setMsg(String msg) Set the message of the email.
Parameters: msg - A String. | public void | setSubType(String aSubType) Set the MIME subtype of the email. |
addPart | public Email addPart(String partContent, String partContentType) throws EmailException(Code) | | Add a new part to the email.
Parameters: partContent - The content. Parameters: partContentType - The content type. An Email. throws: EmailException - see javax.mail.internet.MimeBodyPartfor definitions since: 1.0 |
addPart | public Email addPart(MimeMultipart multipart) throws EmailException(Code) | | Add a new part to the email.
Parameters: multipart - The MimeMultipart. An Email. throws: EmailException - see javax.mail.internet.MimeBodyPartfor definitions since: 1.0 |
addPart | public Email addPart(MimeMultipart multipart, int index) throws EmailException(Code) | | Add a new part to the email.
Parameters: multipart - The part to add. Parameters: index - The index to add at. The email. throws: EmailException - An error occured while adding the part. since: 1.0 |
attach | public MultiPartEmail attach(URL url, String name, String description) throws EmailException(Code) | | Attach a file located by its URL. The disposition of the file
is set to mixed.
Parameters: url - The URL of the file (may be any valid URL). Parameters: name - The name field for the attachment. Parameters: description - A description for the attachment. A MultiPartEmail. throws: EmailException - see javax.mail.internet.MimeBodyPartfor definitions since: 1.0 |
attach | public MultiPartEmail attach(URL url, String name, String description, String disposition) throws EmailException(Code) | | Attach a file located by its URL.
Parameters: url - The URL of the file (may be any valid URL). Parameters: name - The name field for the attachment. Parameters: description - A description for the attachment. Parameters: disposition - Either mixed or inline. A MultiPartEmail. throws: EmailException - see javax.mail.internet.MimeBodyPartfor definitions since: 1.0 |
attach | public MultiPartEmail attach(DataSource ds, String name, String description) throws EmailException(Code) | | Attach a file specified as a DataSource interface.
Parameters: ds - A DataSource interface for the file. Parameters: name - The name field for the attachment. Parameters: description - A description for the attachment. A MultiPartEmail. throws: EmailException - see javax.mail.internet.MimeBodyPartfor definitions since: 1.0 |
attach | public MultiPartEmail attach(DataSource ds, String name, String description, String disposition) throws EmailException(Code) | | Attach a file specified as a DataSource interface.
Parameters: ds - A DataSource interface for the file. Parameters: name - The name field for the attachment. Parameters: description - A description for the attachment. Parameters: disposition - Either mixed or inline. A MultiPartEmail. throws: EmailException - see javax.mail.internet.MimeBodyPartfor definitions since: 1.0 |
buildMimeMessage | public void buildMimeMessage() throws EmailException(Code) | | Builds the actual MimeMessage
throws: EmailException - see javax.mail.internet.MimeBodyPartfor definitions since: 1.0 |
createBodyPart | protected BodyPart createBodyPart()(Code) | | Method that can be overridden if you don't
want to create a MimeBodyPart.
|
createMimeMultipart | protected MimeMultipart createMimeMultipart()(Code) | | |
getContainer | protected MimeMultipart getContainer()(Code) | | Gets the message container.
The message container. since: 1.0 |
getPrimaryBodyPart | protected BodyPart getPrimaryBodyPart() throws MessagingException(Code) | | Gets first body part of the message.
The primary body part. throws: MessagingException - An error occured while getting the primary body part. since: 1.0 |
getSubType | public String getSubType()(Code) | | Get the MIME subtype of the email.
MIME subtype of the email since: 1.0 |
init | protected void init()(Code) | | Initialize the multipart email.
since: 1.0 |
isBoolHasAttachments | public boolean isBoolHasAttachments()(Code) | | boolHasAttachments since: 1.0 |
isInitialized | protected boolean isInitialized()(Code) | | |
setBoolHasAttachments | public void setBoolHasAttachments(boolean b)(Code) | | Parameters: b - boolHasAttachments since: 1.0 |
setInitialized | protected void setInitialized(boolean b)(Code) | | Parameters: b - |
setSubType | public void setSubType(String aSubType)(Code) | | Set the MIME subtype of the email.
Parameters: aSubType - MIME subtype of the email since: 1.0 |
Methods inherited from org.apache.commons.mail.Email | public Email addBcc(String email) throws EmailException(Code)(Java Doc) public Email addBcc(String email, String name) throws EmailException(Code)(Java Doc) public Email addCc(String email) throws EmailException(Code)(Java Doc) public Email addCc(String email, String name) throws EmailException(Code)(Java Doc) public void addHeader(String name, String value)(Code)(Java Doc) public Email addReplyTo(String email) throws EmailException(Code)(Java Doc) public Email addReplyTo(String email, String name) throws EmailException(Code)(Java Doc) public Email addTo(String email) throws EmailException(Code)(Java Doc) public Email addTo(String email, String name) throws EmailException(Code)(Java Doc) public void buildMimeMessage() throws EmailException(Code)(Java Doc) public InternetAddress getFromAddress()(Code)(Java Doc) public String getHostName()(Code)(Java Doc) public Session getMailSession() throws EmailException(Code)(Java Doc) public MimeMessage getMimeMessage()(Code)(Java Doc) public Date getSentDate()(Code)(Java Doc) public String getSmtpPort()(Code)(Java Doc) public String getSubject()(Code)(Java Doc) public String send() throws EmailException(Code)(Java Doc) public String sendMimeMessage() throws EmailException(Code)(Java Doc) public void setAuthentication(String userName, String password)(Code)(Java Doc) public void setAuthenticator(Authenticator newAuthenticator)(Code)(Java Doc) public Email setBcc(Collection aCollection) throws EmailException(Code)(Java Doc) public Email setBounceAddress(String email)(Code)(Java Doc) public Email setCc(Collection aCollection) throws EmailException(Code)(Java Doc) public void setCharset(String newCharset)(Code)(Java Doc) public void setContent(MimeMultipart aMimeMultipart)(Code)(Java Doc) public void setContent(Object aObject, String aContentType)(Code)(Java Doc) public void setDebug(boolean d)(Code)(Java Doc) public Email setFrom(String email) throws EmailException(Code)(Java Doc) public Email setFrom(String email, String name) throws EmailException(Code)(Java Doc) public void setHeaders(Map map)(Code)(Java Doc) public void setHostName(String aHostName)(Code)(Java Doc) public void setMailSession(Session aSession)(Code)(Java Doc) abstract public Email setMsg(String msg) throws EmailException(Code)(Java Doc) public void setPopBeforeSmtp(boolean newPopBeforeSmtp, String newPopHost, String newPopUsername, String newPopPassword)(Code)(Java Doc) public void setSentDate(Date date)(Code)(Java Doc) public void setSmtpPort(int aPortNumber)(Code)(Java Doc) public Email setSubject(String aSubject)(Code)(Java Doc) public Email setTo(Collection aCollection) throws EmailException(Code)(Java Doc) protected InternetAddress[] toInternetAddressArray(List list)(Code)(Java Doc)
|
|
|