|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.wisesoft.util.mail.MsgPart
An email message is always made of parts.This is a part of message.
In the simplest case there is just one part that contains text,
however sometimes one part can contain a file (binary data),
a HTML page or other parts (type multipart).
Example:
this is an example part that contains html data:
MsgPart htmlpart=new MsgPart(); htmlpart.ContentType="Text"; htmlpart.ContentSubType="Html"; htmlpart.setData("This is the html text",MimeEncoder.QUOTED);this is a example part that contains binary data:
byte[] binaryData=new {55,21,25,65,51}; part=new MsgPart(); part.ContentType="Application"; part.ContentSubType="Octet-stream"; part.setBinaryData(binaryData,MimeEncoder.BASE64);
Field Summary | |
java.lang.String |
boundary
Boundary used to separate subparts |
java.lang.String |
ContentSubType
Content subtype of the e-mail values: * Text / Plain * Text / Html * Message / rfc822 * Application / Octets-stream * Application / Images and so forth |
java.lang.String |
ContentType
MIME style ContentType string This value if optional. |
int |
Encoding
Encoding type |
java.lang.String |
FileName
File name if the part has "Application" ContentType. |
java.lang.String |
header
Header of the part |
int |
partCounter
Number of subparts in the part |
java.lang.String |
partName
Name of part |
Constructor Summary | |
MsgPart()
Constructor |
Method Summary | |
void |
addPart(MsgPart mailMsgPart)
|
java.lang.String |
getData()
Returns the content of the mail body |
java.lang.String |
getHeader()
|
MsgPart |
getPart(int num)
|
boolean |
saveToFile(java.lang.String pkfile)
|
void |
setBinaryData(byte[] binaryData)
|
void |
setCodedData(java.lang.String d)
|
void |
setData(java.lang.String data,
int encoding)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.lang.String ContentType
public java.lang.String ContentSubType
public int Encoding
public java.lang.String partName
public int partCounter
public java.lang.String FileName
public java.lang.String header
public java.lang.String boundary
Constructor Detail |
public MsgPart()
Method Detail |
public void setCodedData(java.lang.String d)
public MsgPart getPart(int num)
public void addPart(MsgPart mailMsgPart)
mailMsgPart
- MailMsg Part
public void setBinaryData(byte[] binaryData)
binaryData
- sets the binary content of the part which will be encoded with BASE64.public void setData(java.lang.String data, int encoding)
data
- The data of mail bodyencoding
- The encoding type
Sets the content of the part if not binary, you must specify an encoding method:public java.lang.String getData()
public boolean saveToFile(java.lang.String pkfile)
pkfile
- The file name
public java.lang.String getHeader()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |