org.apache.turbine.util.mail
Class MultiPartEmail

java.lang.Object
  extended byorg.apache.turbine.util.mail.Email
      extended byorg.apache.turbine.util.mail.MultiPartEmail
Direct Known Subclasses:
HtmlEmail

Deprecated. Use org.apache.commons.mail.MultiPartEmail instead.

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 264148 2005-08-29 14:21:04Z henning $
Author:
Jon S. Stevens, Frank Y. Kim, Brett McLaughlin, Regis Koenig

Field Summary
protected  javax.mail.internet.MimeMultipart emailBody
          Deprecated. Body portion of the email.
protected  javax.mail.internet.MimeBodyPart main
          Deprecated. The message container.
 
Fields inherited from class org.apache.turbine.util.mail.Email
ATTACHMENTS, charset, CONTENT_TYPE, EMAIL_BODY, EMAIL_SUBJECT, FILE_SERVER, ISO_8859_1, KOI8_R, MAIL_HOST, MAIL_SERVER, MAIL_SMTP_FROM, MAIL_TRANSPORT_PROTOCOL, message, RECEIVER_EMAIL, RECEIVER_NAME, SENDER_EMAIL, SENDER_NAME, SMTP, TEXT_HTML, TEXT_PLAIN, US_ASCII
 
Constructor Summary
MultiPartEmail()
          Deprecated. Initialize the multipart email.
MultiPartEmail(org.apache.torque.util.Criteria criteria)
          Deprecated. Constructor used to initialize attributes.
 
Method Summary
 MultiPartEmail attach(javax.activation.DataSource ds, java.lang.String name, java.lang.String description)
          Deprecated. Attach a file specified as a DataSource interface.
 MultiPartEmail attach(javax.activation.DataSource ds, java.lang.String name, java.lang.String description, java.lang.String disposition)
          Deprecated. Attach a file specified as a DataSource interface.
 MultiPartEmail attach(EmailAttachment attachment)
          Deprecated. Attach an EmailAttachement.
 MultiPartEmail attach(java.net.URL url, java.lang.String name, java.lang.String description)
          Deprecated. 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)
          Deprecated. Attach a file located by its URL.
protected  void init()
          Deprecated. Initialize the multipart email.
protected  void initCriteria(org.apache.torque.util.Criteria criteria)
          Deprecated. Uses the criteria to set the fields.
 Email setMsg(java.lang.String msg)
          Deprecated. Set the message of the email.
 
Methods inherited from class org.apache.turbine.util.mail.Email
addBcc, addCc, addReplyTo, addTo, initialize, send, setCharset, setFrom, setSentDate, setSubject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

emailBody

protected javax.mail.internet.MimeMultipart emailBody
Deprecated. 
Body portion of the email.


main

protected javax.mail.internet.MimeBodyPart main
Deprecated. 
The message container.

Constructor Detail

MultiPartEmail

public MultiPartEmail()
               throws javax.mail.MessagingException
Deprecated. 
Initialize the multipart email.

Throws:
MessagingException.
javax.mail.MessagingException

MultiPartEmail

public MultiPartEmail(org.apache.torque.util.Criteria criteria)
               throws javax.mail.MessagingException
Deprecated. 
Constructor used to initialize attributes.

This method uses the criteria object to set the different fields of the e-mail. The expected fields of the Criteria are:

Deprecated, since Criteria is deprecated in mail API.

Parameters:
criteria - A Criteria.
Throws:
MessagingException.
javax.mail.MessagingException
Method Detail

init

protected void init()
             throws javax.mail.MessagingException
Deprecated. 
Initialize the multipart email.

Overrides:
init in class Email
Throws:
MessagingException.
javax.mail.MessagingException

initCriteria

protected void initCriteria(org.apache.torque.util.Criteria criteria)
                     throws javax.mail.MessagingException
Deprecated. 
Uses the criteria to set the fields.

This method uses the criteria object to set the different fields of the e-mail. The expected fields of the Criteria are:

Deprecated, since the Criteria is deprecated.

Overrides:
initCriteria in class Email
Parameters:
criteria - A Criteria.
Throws:
MessagingException.
javax.mail.MessagingException

setMsg

public Email setMsg(java.lang.String msg)
             throws javax.mail.MessagingException
Deprecated. 
Set the message of the email.

Specified by:
setMsg in class Email
Parameters:
msg - A String.
Returns:
An Email.
Throws:
MessagingException.
javax.mail.MessagingException

attach

public MultiPartEmail attach(EmailAttachment attachment)
                      throws javax.mail.MessagingException
Deprecated. 
Attach an EmailAttachement.

Parameters:
attachment - An EmailAttachment.
Returns:
A MultiPartEmail.
Throws:
MessagingException.
javax.mail.MessagingException

attach

public MultiPartEmail attach(java.net.URL url,
                             java.lang.String name,
                             java.lang.String description)
                      throws javax.mail.MessagingException
Deprecated. 
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 attachment.
Returns:
A MultiPartEmail.
Throws:
MessagingException.
javax.mail.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
Deprecated. 
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 attachment.
disposition - Either mixed or inline.
Returns:
A MultiPartEmail.
Throws:
MessagingException.
javax.mail.MessagingException

attach

public MultiPartEmail attach(javax.activation.DataSource ds,
                             java.lang.String name,
                             java.lang.String description)
                      throws javax.mail.MessagingException
Deprecated. 
Attach a file specified as a DataSource interface.

Parameters:
ds - A DataSource interface for the file.
name - The name field for the attachment.
description - A description for the attachment.
Returns:
A MultiPartEmail.
Throws:
MessagingException.
javax.mail.MessagingException

attach

public MultiPartEmail attach(javax.activation.DataSource ds,
                             java.lang.String name,
                             java.lang.String description,
                             java.lang.String disposition)
                      throws javax.mail.MessagingException
Deprecated. 
Attach a file specified as a DataSource interface.

Parameters:
ds - A DataSource interface for the file.
name - The name field for the attachment.
description - A description for the attachement.
disposition - Either mixed or inline.
Returns:
A MultiPartEmail.
Throws:
MessagingException.
javax.mail.MessagingException


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.