OpMath

com.opmath.mail
Class MailMessage

java.lang.Object
  |
  +--javax.mail.Message
        |
        +--javax.mail.internet.MimeMessage
              |
              +--com.opmath.mail.MailMessage
All Implemented Interfaces:
MimePart, Part

public class MailMessage
extends MimeMessage

A MimeMessage that is compatible with the email queuing strategy used by com.opmath.mail.MailClient.

The purpose of this class is to allow for environment-independent email message objects. The issue arises where an email message contains a file attachment. It is simply not safe to queue a pointer to a file - that file might have been updated or deleted in the time between the message being queued, and the message being sent. The MailMessage class represents self-contained email message objects which can be created at thew time the message is enqueued.

Copyright: (c) 2002 The Open Math Company Limited

The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.

Since:
J2SE 1.3
Version:
1.0
Author:
Bruno Beloff bruno.beloff@opmath.com

Inner classes inherited from class javax.mail.internet.MimeMessage
MimeMessage.RecipientType
 
Inner classes inherited from class javax.mail.Message
Message.RecipientType
 
Fields inherited from class javax.mail.internet.MimeMessage
content, contentStream, dh, flags, headers, modified, saved
 
Fields inherited from class javax.mail.Message
expunged, folder, msgnum, session
 
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
MailMessage(Session session, String subject, InternetAddress from, String to, String cc, String bcc, String text)
          Constructs an email message.
MailMessage(Session session, String subject, InternetAddress from, String to, String cc, String bcc, String text, DataSource data, String dataName)
          Constructs an email message with an attachment.
 
Methods inherited from class javax.mail.internet.MimeMessage
, addFrom, addHeader, addHeaderLine, addRecipients, addRecipients, createInternetHeaders, getAllHeaderLines, getAllHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSentDate, getSize, getSubject, isMimeType, isSet, parse, removeHeader, reply, saveChanges, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFlags, setFrom, setFrom, setHeader, setRecipients, setRecipients, setReplyTo, setSentDate, setSubject, setSubject, setText, setText, updateHeaders, writeTo, writeTo
 
Methods inherited from class javax.mail.Message
addRecipient, getFolder, getMessageNumber, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailMessage

public MailMessage(Session session,
                   String subject,
                   InternetAddress from,
                   String to,
                   String cc,
                   String bcc,
                   String text,
                   DataSource data,
                   String dataName)
            throws MessagingException
Constructs an email message with an attachment.

There are only four obligatory parameters for the constructor:

Where a paremeter value is not required, it may be given as null.

Parameters:
session - the Session of the email client.
subject - a String subject text, or null.
from - the InternetAddress of the sender.
to - a String list of email addresses.
cc - a String list of email addresses, or null.
bcc - a String list of email addresses, or null.
text - a String ascii plain text message, or null.
data - a DataSource for the attachment, or null.
dataName - a String name for the data, or null.
Throws:
java.util.MessagingException - An exception thrown if the parameters were malformed.
Since:
JDK 1.2.2
See Also:
MailClient.setServer(String)

MailMessage

public MailMessage(Session session,
                   String subject,
                   InternetAddress from,
                   String to,
                   String cc,
                   String bcc,
                   String text)
            throws MessagingException
Constructs an email message.

There are only three obligatory parameters for the constructor:

Where a paremeter value is not required, it may be given as null.

Parameters:
session - the Session of the email client.
subject - a String subject text, or null.
from - the InternetAddress of the sender.
to - a String list of email addresses.
cc - a String list of email addresses, or null.
bcc - a String list of email addresses, or null.
text - a String ascii plain text message, or null.
Throws:
java.util.MessagingException - An exception thrown if the parameters were malformed.
Since:
JDK 1.2.2
See Also:
MailClient.setServer(String)

OpMath

Submit a bug or feature to Open Math
Copyright © 2002 Open Math Company Limited, Brighton, UK