MailMessage Methods

The MailMessage type exposes the following members.

Methods
  NameDescription
Public methodCode exampleAppendChunk
Adds a block of bytes to the source of the message.
Public methodCode exampleAppendPartialMessage
Adds the specified partial message to this message.
Public methodCode exampleClear
Removes the specified elements from the message.
Public methodCode exampleClone
Creates a copy of the message.
Public methodConvertFromSystemNetMail
Loads the message from System.Net.Mail.MailMessage object.
Public methodConvertToSystemNetMail
Exports the message to System.Net.Mail.MailMessage object.
Public methodCode exampleDeserialize(String)
Loads a message from the specified .XML file.
Public methodCode exampleDeserialize(XmlReader)
Loads a message from XML stream using the specified XmlReader object.
Public methodDeserializeAsync(String)
async/await version of Deserialize(String).
Public methodDeserializeAsync(XmlReader)
async/await version of Deserialize(XmlReader).
Public methodDispose
Removes the temporary folders and files that are associated with the mail message.
Public methodCode exampleDomainKeysSign
Signs the current e-mail message with DKIM and classic DomainKeys signatures.
Public methodCode exampleDomainKeysVerify
Verifies DKIM and classic DomainKeys signatures of the current e-mail message.
Public methodDomainKeysVerifyAsync
Public methodCode exampleEncodeAllHeaders
Encodes all message headers into the specified encoding.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Finalizes the instance of MailMessage object.
(Overrides ObjectFinalize.)
Public methodCode exampleForwardAsAttachment
Forwards a mail message as attached .EML file.
Public methodCode exampleGetAllRecipients
Gets the EmailAddressCollection object containing the e-mail addresses of all message recipients.
Public methodStatic memberCode exampleGetEncodedHeaderValue
Encodes the value of the specified header.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodCode exampleGetHtmlAndRelatedFilesInMemory
Gets HTML body with references to all inline attachments being replaced with user-defined indexed paths.
Public methodCode exampleGetHtmlAndSaveRelatedFiles
Extracts the HTML body of the message, saves the attached inline pictures and other related files to disk, and return the modified HTML body.
Public methodCode exampleGetHtmlAndSaveRelatedFiles(String, VirtualMappingType, MessageFolderBehavior)
Prepares the HTML body of the message for displaying in a web application: saves all embedded objects to a temporary location, replaces their Content-ID's with their virtual paths in the temporary location, and returns the modified HTML body as a string.
Public methodGetHtmlAndSaveRelatedFilesAsync
Public methodGetHtmlAndSaveRelatedFilesAsync(String, VirtualMappingType, MessageFolderBehavior)
Public methodCode exampleGetHtmlWithBase64EncodedRelatedFiles
Gets the HTML body with all related files being embedded directly in the HTML body as base64 chunks.
Public methodCode exampleGetMessageRawData
Gets the source of the message as a byte array.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodCode exampleImportRelatedFiles
Adds all the related files (referenced in HTML part of the message) as inline attachments.
Public methodImportRelatedFilesAsync
Public methodCode exampleIsBodyAvail
Indicates if the body of the specified format is present in the message.
Public methodCode exampleLoadBodyText(String, MessageBodyType)
Loads the contents of the specified file into HTML or plain-text body of the message.
Public methodCode exampleLoadBodyText(String, MessageBodyType, Encoding, ImportBodyOptions)
Loads the contents of the specified file or web page into HTML or plain-text body of the message, also attaching related objects such as inline images if necessary.
Public methodLoadBodyTextAsync(String, MessageBodyType)
async/await version of LoadBodyText(String, MessageBodyType).
Public methodLoadBodyTextAsync(String, MessageBodyType, Encoding, ImportBodyOptions)
Public methodCode exampleLoadMessage(Byte)
Loads the message from a byte array.
Public methodCode exampleLoadMessage(Stream)
Loads the message from a stream.
Public methodCode exampleLoadMessage(String)
Loads the message from the specified file.
Public methodLoadMessageAsync(Stream)
async/await version of LoadMessage(Stream).
Public methodLoadMessageAsync(String)
async/await version of LoadMessage(String).
Public methodCode exampleMakePlainBodyFromHtmlBody
Creates a plain text body from the existing HTML body of the message.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodCode exampleReset
Resets all the properties of the MailMessage object to the default values.
Public methodCode exampleSaveHtmlAndRelatedFiles
Saves the HTML body of the message and all inline pictures and other inline objects to disk.
Public methodSaveHtmlAndRelatedFilesAsync
async/await version of SaveHtmlAndRelatedFiles(String).
Public methodCode exampleSaveMessage(Stream)
Saves a message into the specified stream.
Public methodCode exampleSaveMessage(String)
Saves a message into the specified file.
Public methodSaveMessageAsync(Stream)
async/await version of SaveMessage(Stream).
Public methodSaveMessageAsync(String)
async/await version of SaveMessage(String).
Public methodCode exampleSerialize(String)
Saves the message into the specified .XML file.
Public methodCode exampleSerialize(XmlWriter)
Saves the message into XML stream using the specified XmlWriter object.
Public methodSerializeAsync(String)
async/await version of Serialize(String).
Public methodSerializeAsync(XmlWriter)
async/await version of Serialize(XmlWriter).
Public methodCode exampleSetDateFromString
Sets the date of the message creation as a string.
Public methodCode exampleSetUniqueMessageID
Sets a new unique value of Message-ID header and returns it.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also