|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.network.MailMessage
public class MailMessage
Represents an e-mail message. It allows to access message properties, ex. subject, body, sender and recipients addreses, etc. Also it can be sent and delivered by means of supported mail protocols.
Constructor Summary | |
---|---|
MailMessage()
Constructor |
|
MailMessage(MailAddress from,
MailAddress to)
Constructor |
|
MailMessage(String from,
String to)
Constructor |
|
MailMessage(String from,
String to,
String subject,
String body)
Constructor |
Method Summary | |
---|---|
void |
addAlternateView(AlternateView view)
Add an alternate view to message |
void |
addAttachment(Attachment attachment)
Add an attachment to message |
void |
AddCalendar(com.aspose.network.CalendarObject calendar)
Deprecated. Please use Appoinment Class. |
MailMessage |
deepClone()
Clones this instance |
void |
dispose()
Releases all resources used by the MailMessage |
AlternateViewCollection |
getAlternateViews()
Gets the collection of alternate views of message |
AttachmentCollection |
getAttachments()
Gets the collection of attachments of message |
MailAddressCollection |
getBcc()
Gets or sets the address collection that contains the BCC recipients of message |
String |
getBody()
Gets or sets the message body |
Charset |
getBodyEncoding()
|
MailAddressCollection |
getCC()
Gets or sets the address collection that contains the CC recipients |
Date |
getDate()
|
int |
getDeliveryNotificationOptions()
Gets or sets the delivery notifications |
MailAddress |
getFrom()
Gets or sets the from address |
HeaderCollection |
getHeaders()
Gets headers collection of message |
String |
getHtmlBody()
Gets or sets html body |
LinkedResourceCollection |
getLinkedResources()
Gets the collection of linked resources of message |
String |
getMessageId()
Gets or sets the message id |
Charset |
getPreferredTextEncoding()
|
com.aspose.ms.System.Text.Encoding |
getPreferredTextEncodingInternal()
Gets or sets preferred encoding for all text properties |
boolean |
getPreserveOriginalDates()
Gets or sets value that defines whether it is necessary to generate new saving and modification dates when saving a message |
int |
getPriority()
Gets or sets the priority of message |
MailAddress |
getReplyTo()
Deprecated. |
MailAddressCollection |
getReplyToList()
Gets or sets the list of addresses to reply to for the mail message |
MailAddress |
getSender()
Get or sets sender address |
int |
getSensitivity()
Gets or sets the sensitivity of message |
String |
getSubject()
Gets or sets the subject line |
Charset |
getSubjectEncoding()
|
String |
getTextBody()
Gets or sets plain text body |
MailAddressCollection |
getTo()
Gets or sets the address collection that contains the recipients of message |
boolean |
getWriteHeaderToMht()
Gets or sets a value indicating whether header information should be written if message is being saved in mht format. |
boolean |
getWriteOutlineAttachmentsToMht()
Gets or sets a value indicating whether outline attachments should be written if message is being saved in mht format. |
String |
getXMailer()
Gets or sets the X-Mailer the software that created the e-mail message |
void |
importMessage(InputStream stream)
Imports message from stream |
boolean |
isBodyHtml()
Gets or sets a value indicating whether the message body is in Html |
void |
isBodyHtml(boolean value)
|
boolean |
isReadOnly()
Gets a value indicating whether the message is read only |
boolean |
isSigned()
Gets or sets a value indicating whether the message is signed |
Iterator<MailMessage> |
iterator()
|
static MailMessage |
load(InputStream stream)
Load message from stream |
static MailMessage |
load(InputStream stream,
int mode)
Load message from stream |
static MailMessage |
load(InputStream stream,
MessageFormat format)
Load message from stream |
static MailMessage |
load(String fileName)
Load message from file |
static MailMessage |
load(String fileName,
int mode)
Load message from file |
static MailMessage |
load(String fileName,
MessageFormat format)
Load message from stream |
void |
save(OutputStream stream)
Save message as a stream |
void |
save(OutputStream stream,
int mode)
Save message as a stream |
void |
save(OutputStream stream,
MailMessageSaveType savetype)
Message saving into a stream in one of the supported formats |
void |
save(OutputStream stream,
MessageFormat format)
Message saving as a stream in one of the supported formats |
void |
save(String fileName)
Save message as a file |
void |
save(String fileName,
int mode)
Save message as a file |
void |
save(String fileName,
MailMessageSaveType savetype)
Message saving into a file into one of the supported formats |
void |
save(String fileName,
MessageFormat format)
Message saving into a file into one of the supported formats |
void |
setBcc(MailAddressCollection value)
|
void |
setBody(String value)
|
void |
setBodyEncoding(Charset value)
|
void |
setCC(MailAddressCollection value)
|
void |
setDate(Date value)
|
void |
setDeliveryNotificationOptions(int value)
|
void |
setFrom(MailAddress value)
|
void |
setHtmlBody(String value)
|
void |
setMessageId(String value)
|
void |
setPreferredTextEncoding(Charset value)
|
void |
setPreferredTextEncodingInternal(com.aspose.ms.System.Text.Encoding value)
|
void |
setPreserveOriginalDates(boolean value)
|
void |
setPriority(int value)
|
void |
setReplyTo(MailAddress value)
Deprecated. |
void |
setReplyToList(MailAddressCollection value)
|
void |
setSender(MailAddress value)
|
void |
setSensitivity(int value)
|
void |
setSubject(String value)
|
void |
setSubjectEncoding(Charset value)
|
void |
setTextBody(String value)
|
void |
setTo(MailAddressCollection value)
|
void |
setWriteHeaderToMht(boolean value)
|
void |
setWriteOutlineAttachmentsToMht(boolean value)
|
void |
setXMailer(String value)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MailMessage(String from, String to)
Constructor
from
- Sender addressto
- Recipient addresspublic MailMessage()
Constructor
public MailMessage(String from, String to, String subject, String body)
Constructor
from
- Sender addressto
- Recipient addresssubject
- Message subjectbody
- Message bodypublic MailMessage(MailAddress from, MailAddress to)
Constructor
from
- Sender addressto
- Recipient addressMethod Detail |
---|
public com.aspose.ms.System.Text.Encoding getPreferredTextEncodingInternal()
Gets or sets preferred encoding for all text properties
public Charset getPreferredTextEncoding()
getPreferredTextEncoding
in interface IPreferredTextEncodingProvider
public void setPreferredTextEncodingInternal(com.aspose.ms.System.Text.Encoding value)
public void setPreferredTextEncoding(Charset value)
setPreferredTextEncoding
in interface IPreferredTextEncodingProvider
public MailAddress getFrom()
Gets or sets the from address
public void setFrom(MailAddress value)
public MailAddress getSender()
Get or sets sender address
public void setSender(MailAddress value)
@Deprecated public MailAddress getReplyTo()
Gets or sets the ReplyTo address
@Deprecated public void setReplyTo(MailAddress value)
public MailAddressCollection getReplyToList()
Gets or sets the list of addresses to reply to for the mail message
public void setReplyToList(MailAddressCollection value)
public MailAddressCollection getTo()
Gets or sets the address collection that contains the recipients of message
public void setTo(MailAddressCollection value)
public MailAddressCollection getBcc()
Gets or sets the address collection that contains the BCC recipients of message
public void setBcc(MailAddressCollection value)
public MailAddressCollection getCC()
Gets or sets the address collection that contains the CC recipients
public void setCC(MailAddressCollection value)
public int getPriority()
Gets or sets the priority of message
public void setPriority(int value)
public int getSensitivity()
Gets or sets the sensitivity of message
public void setSensitivity(int value)
public int getDeliveryNotificationOptions()
Gets or sets the delivery notifications
public void setDeliveryNotificationOptions(int value)
public String getSubject()
Gets or sets the subject line
public void setSubject(String value)
public Date getDate()
public void setDate(Date value)
public String getMessageId()
Gets or sets the message id
public void setMessageId(String value)
public String getXMailer()
Gets or sets the X-Mailer the software that created the e-mail message
public void setXMailer(String value)
public Charset getSubjectEncoding()
public void setSubjectEncoding(Charset value)
public HeaderCollection getHeaders()
Gets headers collection of message
public String getTextBody()
Gets or sets plain text body
public void setTextBody(String value)
public String getHtmlBody()
Gets or sets html body
public void setHtmlBody(String value)
public String getBody()
Gets or sets the message body
public void setBody(String value)
public Charset getBodyEncoding()
public void setBodyEncoding(Charset value)
public boolean isBodyHtml()
Gets or sets a value indicating whether the message body is in Html
public void isBodyHtml(boolean value)
public boolean isSigned()
Gets or sets a value indicating whether the message is signed
public boolean isReadOnly()
Gets a value indicating whether the message is read only
public boolean getPreserveOriginalDates()
Gets or sets value that defines whether it is necessary to generate new saving and modification dates when saving a message
public void setPreserveOriginalDates(boolean value)
public AttachmentCollection getAttachments()
Gets the collection of attachments of message
public LinkedResourceCollection getLinkedResources()
Gets the collection of linked resources of message
public AlternateViewCollection getAlternateViews()
Gets the collection of alternate views of message
public boolean getWriteHeaderToMht()
Gets or sets a value indicating whether header information should be written if message is being saved in mht format.
Default value is true
.
true
if header information should be written; otherwise, false
.
public void setWriteHeaderToMht(boolean value)
public boolean getWriteOutlineAttachmentsToMht()
Gets or sets a value indicating whether outline attachments should be written if message is being saved in mht format.
Default value is true
.
true
if outline attachments should be written; otherwise, false
.
public void setWriteOutlineAttachmentsToMht(boolean value)
public static MailMessage load(String fileName)
Load message from file
fileName
- Message file name (.eml)
public static MailMessage load(InputStream stream)
Load message from stream
stream
- Stream that represents message in .eml format
public static MailMessage load(String fileName, int mode)
Load message from file
fileName
- Message file name (.eml)mode
- FileCompatibilityMode
that defines inner conversions that are necessarily to be done
public static MailMessage load(InputStream stream, int mode)
Load message from stream
stream
- Stream that represents message in .eml formatmode
- FileCompatibilityMode
that defines inner conversions
that are necessarily to be done
ArgumentNullException
- stream
is null.public static MailMessage load(InputStream stream, MessageFormat format)
Load message from stream
stream
- Stream that represents message
in one of the supported formatsformat
- Message format represented in stream
ArgumentNullException
- If stream
is null.
FormatNotSupportedException
- If format
is not supported.public static MailMessage load(String fileName, MessageFormat format)
Load message from stream
fileName
- Message file name.
File must be in one of the suported formatsformat
- Message file format
ArgumentNullException
- If fileName
is null.
FormatNotSupportedException
- If format
is not supported.public void importMessage(InputStream stream)
Imports message from stream
stream
- System.IO.Streampublic MailMessage deepClone()
Clones this instance
public void save(String fileName, int mode)
Save message as a file
fileName
- Name of the filemode
- FileCompatibilityMode
that defines inner conversions that are necessarily to be done
public void save(OutputStream stream, int mode)
Save message as a stream
stream
- The stream into which message is savedmode
- FileCompatibilityMode
that defines inner conversions that are necessarily to be done
public void save(String fileName)
Save message as a file
fileName
- File namepublic void save(OutputStream stream)
Save message as a stream
stream
- Stream into which message is savedpublic void save(OutputStream stream, MessageFormat format)
Message saving as a stream in one of the supported formats
stream
- Stream into which message is savedformat
- Format into which m�ssage is savedpublic void save(OutputStream stream, MailMessageSaveType savetype)
Message saving into a stream in one of the supported formats
stream
- Stream into which message is savedsavetype
- Format into which message is savedpublic void save(String fileName, MailMessageSaveType savetype)
Message saving into a file into one of the supported formats
fileName
- Full file namesavetype
- Format into which message is savedpublic void save(String fileName, MessageFormat format)
Message saving into a file into one of the supported formats
fileName
- Full file nameformat
- Format into which message is savedpublic void addAlternateView(AlternateView view)
Add an alternate view to message
view
- Alternate view for addingpublic void addAttachment(Attachment attachment)
Add an attachment to message
attachment
- Attachment for adding@Deprecated public void AddCalendar(com.aspose.network.CalendarObject calendar)
calendar
- public void dispose()
Releases all resources used by the MailMessage
dispose
in interface com.aspose.ms.System.IDisposable
public Iterator<MailMessage> iterator()
iterator
in interface Iterable<MailMessage>
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |