IMime |
public interface IMimePart : IMimeEntity, IDisposable
The IMimePart type exposes the following members.
Name | Description | |
---|---|---|
Content | Get or set the MIME content. | |
ContentBase |
Get or set the base content URI.
(Inherited from IMimeEntity) | |
ContentDescription | Get or set the description of the content if available. | |
ContentDisposition |
Get or set the content disposition.
(Inherited from IMimeEntity) | |
ContentDuration | Get or set the duration of the content if available. | |
ContentId |
Get or set the Content-Id.
(Inherited from IMimeEntity) | |
ContentLocation |
Get or set the content location.
(Inherited from IMimeEntity) | |
ContentMd5 | Get or set the md5sum of the content. | |
ContentTransferEncoding | Get or set the content transfer encoding. | |
ContentType |
Get the type of the content.
(Inherited from IMimeEntity) | |
FileName | Get or set the name of the file. | |
Headers |
Get the list of headers.
(Inherited from IMimeEntity) | |
IsAttachment |
Get a value indicating whether this entity is an attachment.
(Inherited from IMimeEntity) |
Name | Description | |
---|---|---|
Accept |
Dispatches to the specific visit method for this MIME entity.
(Inherited from IMimeEntity) | |
ComputeContentMd5 | Compute the MD5 checksum of the content. | |
Dispose | (Inherited from IDisposable) | |
GetBestEncoding(EncodingConstraint, CancellationToken) | Calculate the most efficient content encoding given the specified constraint. | |
GetBestEncoding(EncodingConstraint, Int32, CancellationToken) | Calculate the most efficient content encoding given the specified constraint. | |
Prepare |
Prepare the MIME entity for transport using the specified encoding constraints.
(Inherited from IMimeEntity) | |
VerifyContentMd5 | Verify the Content-Md5 value against an independently computed md5sum. | |
WriteTo(Stream, CancellationToken) |
Write the IMimeEntity to the specified output stream.
(Inherited from IMimeEntity) | |
WriteTo(String, CancellationToken) |
Write the IMimeEntity to the specified file.
(Inherited from IMimeEntity) | |
WriteTo(FormatOptions, Stream, CancellationToken) |
Write the IMimeEntity to the specified output stream.
(Inherited from IMimeEntity) | |
WriteTo(FormatOptions, String, CancellationToken) |
Write the IMimeEntity to the specified file.
(Inherited from IMimeEntity) | |
WriteTo(Stream, Boolean, CancellationToken) |
Write the IMimeEntity to the specified output stream.
(Inherited from IMimeEntity) | |
WriteTo(String, Boolean, CancellationToken) |
Write the IMimeEntity to the specified file.
(Inherited from IMimeEntity) | |
WriteTo(FormatOptions, Stream, Boolean, CancellationToken) |
Write the IMimeEntity to the specified output stream.
(Inherited from IMimeEntity) | |
WriteTo(FormatOptions, String, Boolean, CancellationToken) |
Write the IMimeEntity to the specified file.
(Inherited from IMimeEntity) | |
WriteToAsync(Stream, CancellationToken) |
Asynchronously write the IMimeEntity to the specified output stream.
(Inherited from IMimeEntity) | |
WriteToAsync(String, CancellationToken) |
Asynchronously write the IMimeEntity to the specified file.
(Inherited from IMimeEntity) | |
WriteToAsync(FormatOptions, Stream, CancellationToken) |
Asynchronously write the IMimeEntity to the specified output stream.
(Inherited from IMimeEntity) | |
WriteToAsync(FormatOptions, String, CancellationToken) |
Asynchronously write the IMimeEntity to the specified file.
(Inherited from IMimeEntity) | |
WriteToAsync(Stream, Boolean, CancellationToken) |
Asynchronously write the IMimeEntity to the specified output stream.
(Inherited from IMimeEntity) | |
WriteToAsync(String, Boolean, CancellationToken) |
Asynchronously write the IMimeEntity to the specified file.
(Inherited from IMimeEntity) | |
WriteToAsync(FormatOptions, Stream, Boolean, CancellationToken) |
Asynchronously write the IMimeEntity to the specified output stream.
(Inherited from IMimeEntity) | |
WriteToAsync(FormatOptions, String, Boolean, CancellationToken) |
Asynchronously write the IMimeEntity to the specified file.
(Inherited from IMimeEntity) |
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); } }