Class MimeAttachment
A convenience wrapper for a MIME attachment, providing easy access to the filename, content ID, content type, and decoded content bytes.
Inherited Members
Namespace: DRIT.Mail.Rfc.Mime
Assembly: DRIT.Mail.dll
Syntax
public sealed class MimeAttachment
Constructors
View SourceMimeAttachment(string?, string?, ContentType, byte[], bool)
Initializes a new instance of the MimeAttachment class.
Declaration
public MimeAttachment(string? fileName, string? contentId, ContentType contentType, byte[] content, bool isInline)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | |
| string | contentId | |
| ContentType | contentType | |
| byte[] | content | |
| bool | isInline |
Properties
View SourceContentId
Gets the Content-ID of the attachment (for inline references), or null if not specified.
Declaration
public string? ContentId { get; }
Property Value
| Type | Description |
|---|---|
| string |
ContentType
Gets the Content-Type of the attachment.
Declaration
public ContentType ContentType { get; }
Property Value
| Type | Description |
|---|---|
| ContentType |
FileName
Gets the filename of the attachment, or null if not specified.
Declaration
public string? FileName { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsInline
Gets a value indicating whether this is an inline attachment.
Declaration
public bool IsInline { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceGetContent()
Gets the decoded content bytes of the attachment.
Declaration
public byte[] GetContent()
Returns
| Type | Description |
|---|---|
| byte[] |