|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mailster.message.SmtpMessage
public class SmtpMessage
Container for a complete SMTP message - headers and message body.
| Field Summary | |
|---|---|
private java.lang.StringBuilder |
body
Message body. |
private java.lang.String |
charset
|
private java.lang.String |
content
|
private SmtpHeadersInterface |
headers
Headers. |
private static int |
id
Likewise, a global id for Message-ID generation. |
private java.lang.String |
internalDate
|
private SmtpMessagePart |
internalParts
|
private static javax.mail.Session |
MAIL_SESSION
Variable used for MimeMessage conversion. |
private java.lang.String |
messageID
|
private java.lang.Boolean |
needsConversion
|
private java.lang.String |
oldPreferredContentType
|
private java.util.List<java.lang.String> |
recipients
Recipients (read from envelope) |
private static long |
serialVersionUID
|
| Constructor Summary | |
|---|---|
SmtpMessage()
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
addRecipients(java.util.List<java.lang.String> l)
Add a list of recipients to the list of recipients. |
protected void |
append(boolean isHeaderData,
java.lang.String line)
Update the headers or body of the message. |
javax.mail.internet.MimeMessage |
asMimeMessage()
Converts from a SmtpMessage to a MimeMessage. |
java.lang.String |
getBody()
Get the message body. |
java.lang.String |
getBodyCharset()
Get the charset specified in Content-Type header. |
java.lang.String |
getDate()
Note : this method generates and stores a date header if the mail doesn't have one. |
SmtpHeadersInterface |
getHeaders()
|
java.lang.String |
getHeaderValue(java.lang.String name)
Get the first value associated with a given header name. |
java.lang.String[] |
getHeaderValues(java.lang.String name)
Get the value(s) associated with the given header name. |
SmtpMessagePart |
getInternalParts()
|
java.lang.String |
getMessageID()
Get a unique value to use 'as' a Message-ID. |
java.lang.String |
getPreferredContent(java.lang.String preferredContentType)
|
java.util.List<java.lang.String> |
getRecipients()
Returns the recipients of this message (from the SMTP envelope). |
int |
getSize()
Return the size of the content of this message in bytes. |
java.lang.String |
getSubject()
|
java.lang.String |
getTo()
|
java.lang.String |
toString()
String representation of the SmtpMessage. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private static final transient javax.mail.Session MAIL_SESSION
private SmtpHeadersInterface headers
private java.lang.StringBuilder body
private java.util.List<java.lang.String> recipients
private SmtpMessagePart internalParts
private java.lang.String content
private java.lang.String oldPreferredContentType
private java.lang.String messageID
private java.lang.String internalDate
private java.lang.String charset
private java.lang.Boolean needsConversion
private static int id
| Constructor Detail |
|---|
public SmtpMessage()
| Method Detail |
|---|
protected void append(boolean isHeaderData,
java.lang.String line)
isHeaderData - true if data is part of the mail headerline - the line of mail datapublic java.lang.String getMessageID()
hashCode(), a global
ID (incremented on every use), the current time (in milliseconds), the
string "Mailster", and this user's local address generated by
InetAddress.getLocalHost(). (The address defaults to
"localhost" if getLocalHost() returns null.)
InetAddresspublic java.lang.String[] getHeaderValues(java.lang.String name)
name - header name
public java.lang.String getHeaderValue(java.lang.String name)
name - header name
public java.lang.String getBody()
public javax.mail.internet.MimeMessage asMimeMessage()
throws javax.mail.MessagingException,
java.io.UnsupportedEncodingException
SmtpMessage to a MimeMessage.
MimeMessage object
javax.mail.MessagingException - if MimeMessage creation fails
java.io.UnsupportedEncodingException - if charset is unknownpublic java.lang.String toString()
toString in class java.lang.Objectpublic SmtpHeadersInterface getHeaders()
public java.lang.String getDate()
public java.lang.String getTo()
public java.lang.String getSubject()
public SmtpMessagePart getInternalParts()
public java.lang.String getPreferredContent(java.lang.String preferredContentType)
public java.lang.String getBodyCharset()
protected void addRecipients(java.util.List<java.lang.String> l)
public java.util.List<java.lang.String> getRecipients()
public int getSize()
Note that this number may not be an exact measure of the content size and may or may not account for any transfer encoding of the content.
This implementation returns the size of the message body (if not null), otherwise, it returns 0.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||