|
Secure iNet Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jscape.inet.mime.MimeMessage
com.jscape.inet.email.EmailMessage
com.jscape.inet.email.HtmlEmailMessage
Represents an email message that contains both HTML and plain text parts.
Example Usage:
HtmlEmailMessage message = new HtmlEmailMessage();
message.setTo("jsmith@myserver.com");
message.setFrom("rjones@myserver.com");
message.setSubject("Meeting at 8");
message.setTextBody("this is the text body");
message.setHtmlBody("<html><body><img src=\"cid:12345\"><br>this is the html body</body></html>");
message.embed(new URL("http://www.domain.com/image.gif","12345");
| Field Summary |
| Fields inherited from interface com.jscape.inet.mime.MimeConstants |
COLON, CR, CRLF, EQUALS, LF, QUESTION_MARK, SEMI_COLON, SPACE, TAB |
| Constructor Summary | |
HtmlEmailMessage()
Creates a new HtmlEmailMessage instance. |
|
| Method Summary | |
void |
addAttachment(Attachment att)
Adds attachment to email message. |
void |
embed(java.io.File file,
java.lang.String id)
Embeds a resource in the email message. |
void |
embed(java.net.URL url,
java.lang.String id)
Embeds a resource in the email message. |
byte[] |
getMessage()
Gets contents of this HtmlEmailMessage. |
void |
setHtmlBody(java.io.File htmlBody)
Sets the HTML portion of this email message from contents of a file. |
void |
setHtmlBody(java.lang.String htmlBody)
Sets the HTML portion of this email message. |
void |
setTextBody(java.io.File textBody)
Sets the plain text portion of this email message from contents of a file. |
void |
setTextBody(java.lang.String textBody)
Sets the plain text portion of this email message. |
| Methods inherited from class com.jscape.inet.email.EmailMessage |
addAttachment, getAttachments, getBcc, getBody, getCc, getContentType, getDate, getFrom, getPriority, getReplyTo, getSubject, getTo, setBcc, setCc, setCc, setContentType, setContentType, setFrom, setFrom, setPriority, setReplyTo, setReplyTo, setSubject, setSubject, setTo, setTo |
| Methods inherited from class com.jscape.inet.mime.MimeMessage |
addHeader, addHeader, addPart, addReplaceHeader, addReplaceHeader, getBodyData, getBoundary, getContentTransferEncoding, getHeader, getHeaders, getHeaders, getHeaderValue, getPart, getParts, getRawBodyData, removeHeader, removePart, removeParts, setBody, setBody, setBody, setBody |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HtmlEmailMessage()
throws MimeException
MimeException - if a MIME related error occurs| Method Detail |
public void addAttachment(Attachment att)
throws MimeException
attachment
and false as method argument to ensure that existing body is not added as a separate MIME part.
addAttachment in class EmailMessageatt - the attachment to add
MimeException - if a MIME related error occurspublic void setTextBody(java.lang.String textBody)
textBody - the plain text portion of this messagepublic void setHtmlBody(java.lang.String htmlBody)
htmlBody - the HTML portion of this message
public void setHtmlBody(java.io.File htmlBody)
throws java.io.IOException
htmlBody - file containing HTML body
java.io.IOException - if an I/O error occurs
public void setTextBody(java.io.File textBody)
throws java.io.IOException
textBody - file containing text body
java.io.IOException - if an I/O error occurs
public void embed(java.net.URL url,
java.lang.String id)
url - the URL of the resourceid - the unique Content-ID header value of the resource referenced in the HTML code
public void embed(java.io.File file,
java.lang.String id)
file - the resource fileid - the unique Content-ID header value of the resource referenced in the HTML code
public byte[] getMessage()
throws MimeException
HtmlEmailMessage. Contents include all
MIME message headers, body and any parts.
getMessage in class EmailMessageMimeException - if a MIME related parsing error occurs
|
Secure iNet Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||