Class EmailMessage
- Namespace
- Microsoft.Exchange.WebServices.Data
- Assembly
- Microsoft.Exchange.WebServices.dll
Represents an e-mail message. Properties available on e-mail messages are defined in the EmailMessageSchema class.
public class EmailMessage : Item
- Inheritance
-
EmailMessage
- Inherited Members
Constructors
EmailMessage(ExchangeService)
Initializes an unsaved local instance of EmailMessage. To bind to an existing e-mail message, use EmailMessage.Bind() instead.
public EmailMessage(ExchangeService service)
Parameters
service
ExchangeServiceThe ExchangeService object to which the e-mail message will be bound.
Properties
ApprovalRequestData
Gets the ApprovalRequestData property of the e-mail message.
public ApprovalRequestData ApprovalRequestData { get; }
Property Value
BccRecipients
Gets the list of Bcc recipients for the e-mail message.
public EmailAddressCollection BccRecipients { get; }
Property Value
CcRecipients
Gets the list of Cc recipients for the e-mail message.
public EmailAddressCollection CcRecipients { get; }
Property Value
ConversationIndex
Gets the conversation index of the e-mail message.
public byte[] ConversationIndex { get; }
Property Value
- byte[]
ConversationTopic
Gets the conversation topic of the e-mail message.
public string ConversationTopic { get; }
Property Value
From
Gets or sets the "on behalf" sender of the e-mail message.
public EmailAddress From { get; set; }
Property Value
InternetMessageId
Gets the Internat Message Id of the e-mail message.
public string InternetMessageId { get; }
Property Value
IsAssociated
Gets or sets a value indicating whether this is an associated message.
public bool IsAssociated { get; set; }
Property Value
IsDeliveryReceiptRequested
Gets or sets a value indicating whether a read receipt is requested for the e-mail message.
public bool IsDeliveryReceiptRequested { get; set; }
Property Value
IsRead
Gets or sets a value indicating whether the e-mail message is read.
public bool IsRead { get; set; }
Property Value
IsReadReceiptRequested
Gets or sets a value indicating whether a read receipt is requested for the e-mail message.
public bool IsReadReceiptRequested { get; set; }
Property Value
IsResponseRequested
Gets or sets a value indicating whether a response is requested for the e-mail message.
public bool? IsResponseRequested { get; set; }
Property Value
- bool?
ReceivedBy
Gets the ReceivedBy property of the e-mail message.
public EmailAddress ReceivedBy { get; }
Property Value
ReceivedRepresenting
Gets the ReceivedRepresenting property of the e-mail message.
public EmailAddress ReceivedRepresenting { get; }
Property Value
References
Gets or sets the references of the e-mail message.
public string References { get; set; }
Property Value
ReplyTo
Gets a list of e-mail addresses to which replies should be addressed.
public EmailAddressCollection ReplyTo { get; }
Property Value
Sender
Gets or sets the sender of the e-mail message.
public EmailAddress Sender { get; set; }
Property Value
ToRecipients
Gets the list of To recipients for the e-mail message.
public EmailAddressCollection ToRecipients { get; }
Property Value
VotingInformation
Gets the VotingInformation property of the e-mail message.
public VotingInformation VotingInformation { get; }
Property Value
Methods
Bind(ExchangeService, ItemId)
Binds to an existing e-mail message and loads its first class properties. Calling this method results in a call to EWS.
public static EmailMessage Bind(ExchangeService service, ItemId id)
Parameters
service
ExchangeServiceThe service to use to bind to the e-mail message.
id
ItemIdThe Id of the e-mail message to bind to.
Returns
- EmailMessage
An EmailMessage instance representing the e-mail message corresponding to the specified Id.
Bind(ExchangeService, ItemId, PropertySet)
Binds to an existing e-mail message and loads the specified set of properties. Calling this method results in a call to EWS.
public static EmailMessage Bind(ExchangeService service, ItemId id, PropertySet propertySet)
Parameters
service
ExchangeServiceThe service to use to bind to the e-mail message.
id
ItemIdThe Id of the e-mail message to bind to.
propertySet
PropertySetThe set of properties to load.
Returns
- EmailMessage
An EmailMessage instance representing the e-mail message corresponding to the specified Id.
CreateForward()
Creates a forward response to the message.
public ResponseMessage CreateForward()
Returns
- ResponseMessage
A ResponseMessage representing the forward response that can subsequently be modified and sent.
CreateReply(bool)
Creates a reply response to the message.
public ResponseMessage CreateReply(bool replyAll)
Parameters
replyAll
boolIndicates whether the reply should go to all of the original recipients of the message.
Returns
- ResponseMessage
A ResponseMessage representing the reply response that can subsequently be modified and sent.
Forward(MessageBody, params EmailAddress[])
Forwards the message. Calling this method results in a call to EWS.
public void Forward(MessageBody bodyPrefix, params EmailAddress[] toRecipients)
Parameters
bodyPrefix
MessageBodyThe prefix to prepend to the original body of the message.
toRecipients
EmailAddress[]The recipients to forward the message to.
Forward(MessageBody, IEnumerable<EmailAddress>)
Forwards the message. Calling this method results in a call to EWS.
public void Forward(MessageBody bodyPrefix, IEnumerable<EmailAddress> toRecipients)
Parameters
bodyPrefix
MessageBodyThe prefix to prepend to the original body of the message.
toRecipients
IEnumerable<EmailAddress>The recipients to forward the message to.
Reply(MessageBody, bool)
Replies to the message. Calling this method results in a call to EWS.
public void Reply(MessageBody bodyPrefix, bool replyAll)
Parameters
bodyPrefix
MessageBodyThe prefix to prepend to the original body of the message.
replyAll
boolIndicates whether the reply should be sent to all of the original recipients of the message.
Send()
Sends this e-mail message. Calling this method results in at least one call to EWS.
public void Send()
SendAndSaveCopy()
Sends this e-mail message and saves a copy of it in the Sent Items folder. SendAndSaveCopy does not work if the message has unsaved attachments. In that case, the message must first be saved and then sent. Calling this method results in a call to EWS.
public void SendAndSaveCopy()
SendAndSaveCopy(FolderId)
Sends this e-mail message and saves a copy of it in the specified folder. SendAndSaveCopy does not work if the message has unsaved attachments. In that case, the message must first be saved and then sent. Calling this method results in a call to EWS.
public void SendAndSaveCopy(FolderId destinationFolderId)
Parameters
destinationFolderId
FolderIdThe Id of the folder in which to save the copy.
SendAndSaveCopy(WellKnownFolderName)
Sends this e-mail message and saves a copy of it in the specified folder. SendAndSaveCopy does not work if the message has unsaved attachments. In that case, the message must first be saved and then sent. Calling this method results in a call to EWS.
public void SendAndSaveCopy(WellKnownFolderName destinationFolderName)
Parameters
destinationFolderName
WellKnownFolderNameThe name of the folder in which to save the copy.
SuppressReadReceipt()
Suppresses the read receipt on the message. Calling this method results in a call to EWS.
public void SuppressReadReceipt()