Attachment
Contents
[
Hide
]Attachment class
Inherits: Aspose::Email::AttachmentBase, Aspose::Email::IPreferredTextEncodingProvider
Represents an e-mail attachment.
The following example shows how to add and remove an Attachment from MailMessage .
// Create an instance of MailMessage class
var eml = new MailMessage {From = "sender@sender.com", To = "receiver@gmail.com"};
// Load an attachment
var attachment = new Attachment("1.txt");
eml.Attachments.Add(attachment);
// Remove attachment from your MailMessage
eml.Attachments.Remove(attachment);
' Create an instance of MailMessage class
Dim eml = New MailMessage With {
.From = "sender@sender.com",
.[To] = "receiver@gmail.com"
}
' Load an attachment
Dim attachment = New Attachment("1.txt")
eml.Attachments.Add(attachment)
' Remove attachment from your MailMessage
eml.Attachments.Remove(attachment)
Constructors
| Name | Description |
|---|---|
| Attachment (9 overloads) | Initializes a new instance of the Attachment class. |
Methods
| Name | Description |
|---|---|
| Clone | |
| ConvertToMapiAttachment | Implements Aspose::Email::AttachmentBase . |
| CreateAttachmentFromString (3 overloads) | Creates the attachment from string. |
| CreateName | |
| get_ContentDisposition | Gets Content-Disposition header |
| get_CreatedName | Created name from subject in case when attacment is message/rfc822 |
| get_Id | Object identifier |
| get_IsEmbeddedMessage | Gets a value indicating whether the attachment is an embedded message. |
| get_IsTnef | Gets a value indicating whether the attachment is TNEF formatted message. |
| get_IsUri | Gets a value indicating whether attachment is URI-attachment. |
| get_Name | Gets an attachment name |
| get_NameEncoding | Gets an encoding of attachment name |
| get_PreferredTextEncoding | Gets a preferred text encoding |
| get_UniqueId | Gets a unique identifier for the attachment that will be constant for each application run. |
| set_CreatedName | Created name from subject in case when attacment is message/rfc822 |
| set_Name | Sets an attachment name |
| set_NameEncoding | Sets an encoding of attachment name |
| set_PreferredTextEncoding | Sets a preferred text encoding |
| ToCalendarAttachmentProperty | |
| CollectionNum | |
| isUri |