![]() | MimeContent Class |
Namespace: MimeKit
public class MimeContent : IMimeContent, IDisposable
The MimeContent type exposes the following members.
Name | Description | |
---|---|---|
![]() | MimeContent |
Initialize a new instance of the MimeContent class.
|
Name | Description | |
---|---|---|
![]() | Encoding |
Get or set the content encoding.
|
![]() | NewLineFormat |
Get the new-line format, if known.
|
![]() | Stream |
Get the content stream.
|
Name | Description | |
---|---|---|
![]() ![]() | DecodeTo |
Decode the content stream into another stream.
|
![]() ![]() | DecodeToAsync |
Asynchronously decode the content stream into another stream.
|
![]() | Dispose |
Releases all resources used by the MimeContent object.
|
![]() | Dispose(Boolean) |
Releases the unmanaged resources used by the MimeContent and
optionally releases the managed resources.
|
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize |
Releases unmanaged resources and performs other cleanup operations before the
MimeContent is reclaimed by garbage collection.
(Overrides ObjectFinalize.) |
![]() | 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.) |
![]() | Open |
Open the decoded content stream.
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | WriteTo |
Copy the content stream to the specified output stream.
|
![]() | WriteToAsync |
Asynchronously copy the content stream to the specified output stream.
|
foreach (var attachment in message.Attachments) { if (attachment is MessagePart) { var fileName = attachment.ContentDisposition?.FileName; var rfc822 = (MessagePart) attachment; if (string.IsNullOrEmpty (fileName)) fileName = "attached-message.eml"; using (var stream = File.Create (fileName)) rfc822.Message.WriteTo (stream); } else { var part = (MimePart) attachment; var fileName = part.FileName; using (var stream = File.Create (fileName)) part.Content.DecodeTo (stream); } }