Attachment

Attachment class

表示电子邮件附件。

public class Attachment : AttachmentBase, IAttachment, IPreferredTextEncodingProvider

构造函数

姓名描述
Attachment(string)初始化Attachment类.
Attachment(Stream, ContentType)初始化Attachment类.
Attachment(Stream, string)初始化Attachment类.
Attachment(string, ContentType)初始化Attachment类.
Attachment(string, string)初始化Attachment类.
Attachment(Stream, string, string)初始化Attachment类.

特性

姓名描述
ContentDisposition { get; }获取 Content-Disposition 标头
ContentId { get; set; }获取或设置内容id。
ContentStream { get; set; }获取或设置内容流。
ContentType { get; set; }获取或设置内容的类型。
virtual Headers { get; }获取附件的标题集合。
IsEmbeddedMessage { get; }获取一个值,该值指示附件是否为嵌入消息。
IsUri { get; }获取一个值,该值指示附件是否为 URI-attachment。
Name { get; set; }获取或设置附件名称
NameEncoding { get; set; }获取或设置附件名称 的编码
PreferredTextEncoding { get; set; }获取或设置首选文本编码
TransferEncoding { get; set; }获取或设置传输编码。

方法

姓名描述
static CreateAttachmentFromString(string, ContentType)从字符串创建附件。
static CreateAttachmentFromString(string, string)从字符串创建附件。
static CreateAttachmentFromString(string, string, Encoding, string)从字符串创建附件。
Dispose()执行与释放、 释放或重置非托管资源相关的应用程序定义任务。
virtual Save(Stream)保存指定的流。
virtual Save(string)保存指定的文件名。

也可以看看