Attachment Class |
Namespace: MailBee.Mime
The Attachment type exposes the following members.
Name | Description | |
---|---|---|
Attachment |
Creates a new instance of Attachment object from the specified MimePart object.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetAttachmentsFromTnef |
Extracts all the files from TNEF container and returns them as AttachmentCollection.
| |
GetAttachmentsFromTnef(TnefExtractionOptions) |
Extracts items of the specified kinds from TNEF container and returns them as AttachmentCollection.
| |
GetData |
Gets the actual content of the attachment as a byte array.
| |
GetData(Int32, Int32) |
Gets the specified portion of the actual content of the attachment as a byte array.
| |
GetEncapsulatedMessage |
Gets the encapsulated e-mail message as a MailMessage object.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Save |
Saves the content of the attachment into the specified file.
| |
SaveAsync |
async/await version of Save(String, Boolean).
| |
SaveToFolder |
Saves the content of the attachment into a file in the specified folder.
| |
SaveToFolderAsync |
async/await version of SaveToFolder(String, Boolean).
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
AsMimePart |
Gets the attachment as MimePart object.
| |
ContentID |
Gets the Content-ID value of the attachment.
| |
ContentLocation |
Gets the content location of the attachment.
| |
ContentType |
Gets the content type of the attachment.
| |
Description |
Gets the description of the attachment.
| |
Filename |
Gets the filename of the attachment.
| |
FilenameOriginal |
Gets the original filename of the attachment.
| |
Headers |
Gets the collection of the attachment headers.
| |
IsFile |
Indicates if the attachment is a file.
| |
IsInline |
Indicates if the attachment is inline.
| |
IsMessageInside |
Indicates if the attachment contains a mail message.
| |
IsTnef |
Indicates if the attachment is MS-TNEF (winmail.dat) container which can have other attachments inside.
| |
IsVCard |
Indicates if the attachment is a vCard profile.
| |
IsZip |
Indicates if the attachment is a zip archive.
| |
LastResult |
Gets a numeric code of the last error.
| |
Name |
Gets the friendly name of the attachment.
| |
RawHeader |
Gets a string containing the header section of the attachment in the original form.
| |
SavedAs |
Gets the full path to the attachment which was saved to disk.
| |
Size |
Gets the length of the binary content of the attachment.
| |
ThrowExceptions |
Gets or sets whether the object will throw exceptions on errors.
|
All the attachments to the message (including embedded pictures) are stored in Attachments collection of the MailMessage object.
You can also create MDN attachments (deliver-status reports). See Add(String, String, HeaderCollection, MailTransferEncoding) for details.
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Mime; // The actual code (put it into a method of your class) // Load the message from file. MailMessage msg = new MailMessage(); msg.LoadMessage(@"C:\Docs\TestMail.eml"); // For every attachment... foreach (Attachment attach in msg.Attachments) { // ...show the filename of the attachment. Console.WriteLine("Attachment name is " + attach.Filename); }