AttachmentCollection Class |
Namespace: MailBee.Mime
The AttachmentCollection type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | Add(String) |
Adds the attachment from a file.
|
![]() ![]() | Add(Attachment) |
Adds the specified Attachment object to the collection.
|
![]() ![]() | Add(String, String) |
Adds the attachment from a file.
|
![]() ![]() | Add(String, String, String) |
Adds the attachment from a file.
|
![]() ![]() | Add(String, String, HeaderCollection, MailTransferEncoding) |
Adds text-only part with the specified content-type.
|
![]() ![]() | Add(Byte, String, String, String, HeaderCollection, NewAttachmentOptions, MailTransferEncoding) |
Adds the attachment from a byte array.
|
![]() ![]() | Add(Stream, String, String, String, HeaderCollection, NewAttachmentOptions, MailTransferEncoding) |
Adds the attachment from a stream.
|
![]() ![]() | Add(String, String, String, String, HeaderCollection, NewAttachmentOptions, MailTransferEncoding) |
Adds the attachment from a file.
|
![]() ![]() | Add(MailMessage, String, String, String, HeaderCollection, NewAttachmentOptions, MailTransferEncoding) |
Adds the specified the MailMessage as attachment (i.e. forwards that message as attachment).
|
![]() | AddAsync(String) |
async/await version of Add(String).
|
![]() | AddAsync(String, String) |
async/await version of Add(String, String).
|
![]() | AddAsync(String, String, String) |
async/await version of Add(String, String, String).
|
![]() | AddAsync(String, String, String, String, HeaderCollection, NewAttachmentOptions, MailTransferEncoding) | |
![]() ![]() | Clear |
Clears the attachments collection.
|
![]() | 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.) |
![]() | GetEnumerator | Returns an enumerator that iterates through the CollectionBase instance. (Inherited from CollectionBase.) |
![]() | 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.) |
![]() | OnClear | Performs additional custom processes when clearing the contents of the CollectionBase instance. (Inherited from CollectionBase.) |
![]() | OnClearComplete | Performs additional custom processes after clearing the contents of the CollectionBase instance. (Inherited from CollectionBase.) |
![]() | OnInsert | Performs additional custom processes before inserting a new element into the CollectionBase instance. (Inherited from CollectionBase.) |
![]() | OnInsertComplete | Performs additional custom processes after inserting a new element into the CollectionBase instance. (Inherited from CollectionBase.) |
![]() | OnRemove | Performs additional custom processes when removing an element from the CollectionBase instance. (Inherited from CollectionBase.) |
![]() | OnRemoveComplete | Performs additional custom processes after removing an element from the CollectionBase instance. (Inherited from CollectionBase.) |
![]() | OnSet | Performs additional custom processes before setting a value in the CollectionBase instance. (Inherited from CollectionBase.) |
![]() | OnSetComplete | Performs additional custom processes after setting a value in the CollectionBase instance. (Inherited from CollectionBase.) |
![]() | OnValidate | Performs additional custom processes when validating a value. (Inherited from CollectionBase.) |
![]() ![]() | Remove |
Removes the attachment having the specified unique name from the collection.
|
![]() ![]() | RemoveAt |
Removes the attachment with the specified index from the collection.
|
![]() ![]() | SaveAll(String) |
Saves all attachments of the message to the specified folder.
|
![]() ![]() | SaveAll(String, Boolean) |
Saves real (and, optionally, inline) attachments.
|
![]() | SaveAllAsync(String) |
async/await version of SaveAll(String).
|
![]() | SaveAllAsync(String, Boolean) |
async/await version of SaveAll(String, Boolean).
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
![]() | Capacity | Gets or sets the number of elements that the CollectionBase can contain. (Inherited from CollectionBase.) |
![]() | Count | Gets the number of elements contained in the CollectionBase instance. This property cannot be overridden. (Inherited from CollectionBase.) |
![]() | InlineCount |
Returns the number of inline attachments in the collection.
|
![]() | InnerList | Gets an ArrayList containing the list of elements in the CollectionBase instance. (Inherited from CollectionBase.) |
![]() ![]() | ItemInt32 |
Gets or sets the Attachment object at the specified zero-based index in the collection.
|
![]() ![]() | ItemString |
Gets the Attachment object in the collection by the specified filename.
|
![]() ![]() | LastResult |
Gets a numeric code of the last error.
|
![]() | List | Gets an IList containing the list of elements in the CollectionBase instance. (Inherited from CollectionBase.) |
![]() ![]() | ThrowExceptions |
Gets or sets whether the object will throw exceptions on errors.
|
// 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 from the attachments collection... foreach (Attachment attach in msg.Attachments) { // Save the attachment to the file. attach.Save(@"C:\Temp\" + attach.Name, true); }