MailMessage Class
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.
Inheritance Hierarchy
SystemObject
  Aspose.EmailMailMessage

Namespace: Aspose.Email
Assembly: Aspose.Email (in Aspose.Email.dll) Version: 19.7
Syntax
[SerializableAttribute]
public class MailMessage : IDisposable, 
	IPreferredTextEncodingProvider, IEnumerable<MailMessage>, IEnumerable, IMessage, 
	ISerializable

The MailMessage type exposes the following members.

Constructors
  NameDescription
Public methodMailMessage
Initializes a new instance of the MailMessage class
Public methodMailMessage(Boolean)
Initializes a new instance of the MailMessage class
Protected methodMailMessage(SerializationInfo, StreamingContext)
Initializes a new instance of the MailMessage class.
Public methodMailMessage(String, String)
Initializes a new instance of the MailMessage class
Public methodMailMessage(MailAddress, MailAddress)
Initializes a new instance of the MailMessage class
Public methodMailMessage(String, String, String, String)
Initializes a new instance of the MailMessage class
Properties
  NameDescription
Public propertyAlternateViews
Gets the collection of alternate views of message
Public propertyAttachments
Gets the collection of attachments of message
Public propertyBcc
Gets or sets the address collection that contains the BCC recipients of message
Public propertyBody
Gets or sets the plain text representation of message's body.
Public propertyBodyEncoding
Gets or sets encoding of body
Public propertyBodyType
Gets the type of the body.
Public propertyCC
Gets or sets the address collection that contains the CC recipients
Public propertyDate
Gets or sets the date of message
Public propertyDeliveryNotificationOptions
Gets or sets the delivery notifications
Public propertyFrom
Gets or sets the from address
Public propertyHeaders
Gets headers collection of message
Public propertyHtmlBody
Gets or sets html body
Public propertyHtmlBodyText
Gets the message htmlbody as plain text.
Public propertyIsBodyHtml
Gets or sets a value indicating whether the message body is in Html
Public propertyIsDraft
Gets or sets value that indicates whether or not a message has been sent.
Public propertyIsEncrypted
Gets a value indicating whether the message is encrypted.
Public propertyIsReadOnly
Gets a value indicating whether the message is read only
Public propertyIsSigned
Gets a value indicating whether the message is signed.
Public propertyLinkedResources
Gets the collection of linked resources of message
Public propertyMessageId
Gets or sets the message id
Public propertyOriginalIsTnef
Gets a value indicating whether original EML message is in TNEF format.
Public propertyPreferredTextEncoding
Gets or sets preferred encoding for all text properties
Public propertyPriority
Gets or sets the priority of message
Public propertyReadReceiptTo
Gets or sets the read receipt address.
Public propertyReplyToList
Gets or sets the list of addresses to reply to for the mail message
Public propertyReversePath
Gets or sets ReversePath address
Public propertySender
Gets or sets sender address
Public propertySensitivity
Gets or sets the sensitivity of message
Public propertySubject
Gets or sets the subject line
Public propertySubjectEncoding
Gets or sets the encoding of subject
Public propertyTimeZoneOffset
Gets or sets the Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC.
Public propertyTo
Gets or sets the address collection that contains the recipients of message
Public propertyXMailer
Gets or sets the X-Mailer the software that created the e-mail message
Methods
  NameDescription
Public methodAddAlternateView
Add an alternate view to message
Public methodAddAttachment
Add an attachment to message
Public methodAttachSignature(CmsSigner)
Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.
Public methodAttachSignature(X509Certificate2)
Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.
Public methodAttachSignature(CmsSigner, Boolean)
Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.
Public methodAttachSignature(X509Certificate2, Boolean)
Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.
Public methodCheckBounced
Checks whether this message can be treated as a bounce message.
Public methodCheckSignature
Checking signature exsisting MailMessage.
Public methodStatic memberCheckSignature(Stream)
Checks the signature of the specified eml message.
Public methodStatic memberCheckSignature(String)
Checks the signature of the specified eml file.
Public methodClone
Clones this instance
Public methodCreateReadReceipt
Creates the read receipt.
Public methodDecrypt
Decrypts this message
Public methodDecrypt(X509Certificate2)
Decrypts this message
Public methodDispose
Releases all resources used by the MailMessage
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources
Public methodDKIMSign
Signs this message using DKIM (DomainKeys Identified Mail) signature.
Public methodEncrypt(X509Certificate2)
Encrypts this message
Public methodEncrypt(X509Certificate2)
Encrypts this message
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetEnumerator
Returns an enumerator that iterates through a collection.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetHtmlBodyText
Gets the message htmlbody as plain text.
Public methodGetObjectData
Populates a SerializationInfo with the data needed to serialize the target object.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Public methodImport
Imports message from stream
Public methodStatic memberLoad(Stream)
Load message from stream
Public methodStatic memberLoad(String)
Load message from file
Public methodStatic memberLoad(Stream, LoadOptions)
Load message from stream with additional options.
Public methodStatic memberLoad(String, LoadOptions)
Load message from file with additional options.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRecomposeTnefContent
Composes the TNEF content. Note, that tnef attachment is composed if a message initially contained TNEF and was loaded without FileCompatibilityMode.PreserveTnefAttachments flag, That is this method doesn't create tnef message out of the regular one.
Public methodRemoveSignature
Remove signature
Public methodSave(Stream)
Save message as a stream
Public methodSave(String)
Save message as a file
Public methodSave(Stream, SaveOptions)
Save message as a stream with additional options.
Public methodSave(String, SaveOptions)
Save message as a file with additional options.
Public methodToString
Returns a string that represents the current object.
(Overrides ObjectToString.)
Public methodStatic memberValidateMessage(Stream)
Validate eml message for corresponding to mime specification.
Public methodStatic memberValidateMessage(String)
Validate eml message for corresponding to mime specification.
See Also