org.jwarp.service.mail
Class MultiPartEmail
java.lang.Object
|
+--org.jwarp.service.mail.Email
|
+--org.jwarp.service.mail.MultiPartEmail
- Direct Known Subclasses:
- HtmlEmail
- public class MultiPartEmail
- extends Email
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.
- Version:
- $Id: MultiPartEmail.java,v 1.2 2000/09/05 22:19:22 gonzalo Exp $
- Author:
- Jon S. Stevens, Frank Y. Kim, Brett McLaughlin, Regis Koenig
|
Field Summary |
protected org.jwarp.service.mail.MimeMultipart |
emailBody
Body portion of the email. |
protected org.jwarp.service.mail.MimeBodyPart |
main
The message container. |
| Fields inherited from class org.jwarp.service.mail.Email |
ATTACHMENTS, CONTENT_TYPE, EMAIL_BODY, EMAIL_SUBJECT, FILE_SERVER, MAIL_HOST, MAIL_SERVER, MAIL_TRANSPORT_PROTOCOL, message, RECEIVER_EMAIL, RECEIVER_NAME, SENDER_EMAIL, SENDER_NAME, SMTP, TEXT_HTML, TEXT_PLAIN |
|
Constructor Summary |
MultiPartEmail(java.lang.String mailServer)
Initialize the multipart email. |
|
Method Summary |
MultiPartEmail |
attach(EmailAttachment attachment)
Attach an EmailAttachement. |
MultiPartEmail |
attach(java.net.URL url,
java.lang.String name,
java.lang.String description)
Attach a file located by its URL. |
MultiPartEmail |
attach(java.net.URL url,
java.lang.String name,
java.lang.String description,
java.lang.String disposition)
Attach a file located by its URL. |
protected void |
init(java.lang.String mailServer)
Initialize the multipart email. |
Email |
setMsg(java.lang.String msg)
Set the message of the email. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
emailBody
protected org.jwarp.service.mail.MimeMultipart emailBody
- Body portion of the email.
main
protected org.jwarp.service.mail.MimeBodyPart main
- The message container.
MultiPartEmail
public MultiPartEmail(java.lang.String mailServer)
throws javax.mail.MessagingException
- Initialize the multipart email.
- Throws:
MessagingException. -
init
protected void init(java.lang.String mailServer)
throws javax.mail.MessagingException
- Initialize the multipart email.
- Overrides:
init in class Email
- Throws:
MessagingException. -
setMsg
public Email setMsg(java.lang.String msg)
throws javax.mail.MessagingException
- Set the message of the email.
- Overrides:
setMsg in class Email
- Parameters:
msg - A String.- Returns:
- An Email.
- Throws:
MessagingException. -
attach
public MultiPartEmail attach(EmailAttachment attachment)
throws javax.mail.MessagingException
- Attach an EmailAttachement.
- Parameters:
attachment - An EmailAttachment.- Returns:
- A MultiPartEmail.
- Throws:
MessagingException. -
attach
public MultiPartEmail attach(java.net.URL url,
java.lang.String name,
java.lang.String description)
throws javax.mail.MessagingException
- 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).name - The name field for the attachment.description - A description for the attachement.- Returns:
- A MultiPartEmail.
- Throws:
MessagingException. -
attach
public MultiPartEmail attach(java.net.URL url,
java.lang.String name,
java.lang.String description,
java.lang.String disposition)
throws javax.mail.MessagingException
- Attach a file located by its URL.
- Parameters:
url - The URL of the file (may be any valid URL).name - The name field for the attachment.description - A description for the attachement.disposition - Either mixed or inline.- Returns:
- A MultiPartEmail.
- Throws:
MessagingException. -