MDi JLib
1.7.4

com.microdeveloper.util.net.mail
Class JMailContent

java.lang.Object
  extended by com.microdeveloper.util.net.mail.JMailContent

abstract class JMailContent
extends Object

A simple container for JMail messages.

Since:
1.3
Version:
1.0
Author:
MicroDeveloper, Inc.

Field Summary
static String CHARSET_DEFAULT
          Default system character set for text encoding
static String CHARSET_ISO88591
          ISO 8859-1 character set text encoding
static String CHARSET_USASCII
          US ASCII character set text encoding
static String DEFAULTHOST
          Default mail host name
static String HTML
          HTML message type
static String HTML_MIMETYPE
          HTML mime type
static String MULTIPART
          Multipart message type
static String PLAIN
          PLAIN message type
static String PLAIN_MIMETYPE
          PLAIN mime type
 
Constructor Summary
protected JMailContent()
          Constructor JMail
protected JMailContent(String from, Vector to, Vector cc, Vector bcc, String subject, String body)
          Creates a new JMailContent object which is a simple container for an E-mail
protected JMailContent(String from, Vector to, Vector cc, Vector bcc, String subject, String plainBody, String htmlBody)
          Creates a new JMailContent object which is a simple container for an E-mail
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a property listener adding property change support to the element
 Vector getAttachmentProperty()
          Returns the attachment list or null if not set
 Vector getBccProperty()
          Returns the BCC e-mail addresses or null if not set
 String getBodyProperty()
          Returns the body property.
 Vector getCcProperty()
          Returns the CC e-mail addresses or null if not set
 String getCharacterSetProperty()
          Returns the character set property
 boolean getDebugProperty()
          Returns the DEBUG property
 String getFromProperty()
          Returns the FROM e-mail addresses or null if not set
 String getHostProperty()
          Returns the SMTP host property
 String getHtmlBodyProperty()
          Returns the HTML message body
 String getMimeTypeProperty()
          Returns the MIMETYPE property
 String getPlainBodyProperty()
          Returns the plain text message body
 String getSubjectProperty()
          Returns the message subject property
 Vector getToProperty()
          Returns the TO e-mail addresses or null if not set
 String getTypeProperty()
          Returns the message type property
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a property listener removing property change support from the element
 void setAttachmentProperty(Vector attachments)
          Provides property change support for the attachments
 void setBccProperty(String bcc)
          Provides property change support for the BCC e-mail addresses
 void setBccProperty(Vector bcc)
          Provides property change support for the BCC e-mail addresses
 void setBodyProperty(String body)
          Provides property change support for the message body property.
 void setCcProperty(String cc)
          Provides property change support for the CC e-mail addresses
 void setCcProperty(Vector cc)
          Provides property change support for the CC e-mail addresses
 void setCharacterSetProperty(String value)
          Provides property change support for the character set
 void setDebugProperty(boolean debug)
          Provides property change support for the debug property
 void setFromProperty(String from)
          Provides property change support for the FROM e-mail addresses
 void setHostProperty(String host)
          Provides property change support for the SMTP host property
 void setHtmlBodyProperty(String htmlBody)
          Provides property change support for the HTML message body property
 void setMimeTypeProperty(String mimeType)
          Provides property change support for the mime type property.
 void setPlainBodyProperty(String plainBody)
          Provides property change support for the plain text message body property
 void setSubjectProperty(String subject)
          Provides property change support for the Subject property
 void setToProperty(String to)
          Provides property change support for the TO e-mail addresses
 void setToProperty(Vector to)
           
 void setTypeProperty(String type)
          Provides property change support for the message type property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAIN_MIMETYPE

public static final String PLAIN_MIMETYPE
PLAIN mime type

See Also:
Constant Field Values

HTML_MIMETYPE

public static final String HTML_MIMETYPE
HTML mime type

See Also:
Constant Field Values

PLAIN

public static final String PLAIN
PLAIN message type

See Also:
Constant Field Values

HTML

public static final String HTML
HTML message type

See Also:
Constant Field Values

MULTIPART

public static final String MULTIPART
Multipart message type

See Also:
Constant Field Values

DEFAULTHOST

public static final String DEFAULTHOST
Default mail host name

See Also:
Constant Field Values

CHARSET_DEFAULT

public static final String CHARSET_DEFAULT
Default system character set for text encoding


CHARSET_USASCII

public static final String CHARSET_USASCII
US ASCII character set text encoding

See Also:
Constant Field Values

CHARSET_ISO88591

public static final String CHARSET_ISO88591
ISO 8859-1 character set text encoding

See Also:
Constant Field Values
Constructor Detail

JMailContent

protected JMailContent()
Constructor JMail


JMailContent

protected JMailContent(String from,
                       Vector to,
                       Vector cc,
                       Vector bcc,
                       String subject,
                       String plainBody,
                       String htmlBody)
Creates a new JMailContent object which is a simple container for an E-mail

Parameters:
from - from sender e-mail address(es)
to - to recipient e-mail address(es)
cc - cc recipient e-mail address(es)
bcc - bcc recipient e-mail address(es)
subject - subject of the message
plainBody - content of the message in plain text format (message body)
htmlBody - content of the message in HTML format (message body)

JMailContent

protected JMailContent(String from,
                       Vector to,
                       Vector cc,
                       Vector bcc,
                       String subject,
                       String body)
Creates a new JMailContent object which is a simple container for an E-mail

Parameters:
from - from sender e-mail address(es)
to - to recipient e-mail address(es)
cc - cc recipient e-mail address(es)
bcc - bcc recipient e-mail address(es)
subject - subject of the message
body - content of the message in plain text format (message body)
Method Detail

setFromProperty

public void setFromProperty(String from)
Provides property change support for the FROM e-mail addresses

Parameters:
from - the new FROM e-mail address property

setToProperty

public void setToProperty(String to)
Provides property change support for the TO e-mail addresses

Parameters:
to - the new TO e-mail address property

setCcProperty

public void setCcProperty(String cc)
Provides property change support for the CC e-mail addresses

Parameters:
cc - the new CC e-mail address property

setBccProperty

public void setBccProperty(String bcc)
Provides property change support for the BCC e-mail addresses

Parameters:
bcc - the new BCC e-mail address property

setToProperty

public void setToProperty(Vector to)

setCcProperty

public void setCcProperty(Vector cc)
Provides property change support for the CC e-mail addresses

Parameters:
cc - the new CC e-mail address property

setCharacterSetProperty

public void setCharacterSetProperty(String value)
Provides property change support for the character set

Parameters:
value - the new character set property

setBccProperty

public void setBccProperty(Vector bcc)
Provides property change support for the BCC e-mail addresses

Parameters:
bcc - the new BCC e-mail address property

setAttachmentProperty

public void setAttachmentProperty(Vector attachments)
Provides property change support for the attachments

Parameters:
attachments - Vector list of attachments

setSubjectProperty

public void setSubjectProperty(String subject)
Provides property change support for the Subject property

Parameters:
subject - the new Subject property

setPlainBodyProperty

public void setPlainBodyProperty(String plainBody)
Provides property change support for the plain text message body property

Parameters:
plainBody - the new plain text message body property

setHtmlBodyProperty

public void setHtmlBodyProperty(String htmlBody)
Provides property change support for the HTML message body property

Parameters:
htmlBody - the new HTML message body property

setBodyProperty

public void setBodyProperty(String body)
Provides property change support for the message body property. The established type determines which body part is actually populated.

Parameters:
body - the new body property

setTypeProperty

public void setTypeProperty(String type)
Provides property change support for the message type property. This is different from the MIME type but it will affect the mime type.

Parameters:
type - the new message type property

setMimeTypeProperty

public void setMimeTypeProperty(String mimeType)
Provides property change support for the mime type property. This is different from the type and it does not affect the type property.

Parameters:
mimeType - the new message type property

setHostProperty

public void setHostProperty(String host)
Provides property change support for the SMTP host property

Parameters:
host - the new SMTP host IP address or name

setDebugProperty

public void setDebugProperty(boolean debug)
Provides property change support for the debug property

Parameters:
debug - true for debugging or false otherwise

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a property listener adding property change support to the element

Parameters:
listener - the listener to add

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property listener removing property change support from the element

Parameters:
listener - the listener to remove

getCharacterSetProperty

public String getCharacterSetProperty()
Returns the character set property

Returns:
current character set

getTypeProperty

public String getTypeProperty()
Returns the message type property

Returns:
message type

getBodyProperty

public String getBodyProperty()
Returns the body property. The content may be one of HTML or plain text and is defined by the message type and the mime type.

Returns:
message body

getHtmlBodyProperty

public String getHtmlBodyProperty()
Returns the HTML message body

Returns:
HTML body text

getPlainBodyProperty

public String getPlainBodyProperty()
Returns the plain text message body

Returns:
PLAIN TEXT body text

getSubjectProperty

public String getSubjectProperty()
Returns the message subject property

Returns:
subject text

getBccProperty

public Vector getBccProperty()
Returns the BCC e-mail addresses or null if not set

Returns:
vector containing the BCC addresses

getCcProperty

public Vector getCcProperty()
Returns the CC e-mail addresses or null if not set

Returns:
vector containing the CC addresses

getToProperty

public Vector getToProperty()
Returns the TO e-mail addresses or null if not set

Returns:
vector containing the TO addresses

getFromProperty

public String getFromProperty()
Returns the FROM e-mail addresses or null if not set

Returns:
vector containing the FROM addresses

getAttachmentProperty

public Vector getAttachmentProperty()
Returns the attachment list or null if not set

Returns:
vector containing the attachment file paths

getHostProperty

public String getHostProperty()
Returns the SMTP host property

Returns:
SMTP host name or IP address

getMimeTypeProperty

public String getMimeTypeProperty()
Returns the MIMETYPE property

Returns:
mime type

getDebugProperty

public boolean getDebugProperty()
Returns the DEBUG property

Returns:
debug state

MDi JLib
1.7.4

Copyright©2001-2007 MicroDeveloper, Inc. All Rights Reserved.