AlternateView 類別

定義

表示要檢視電子郵件訊息的格式。Represents the format to view an email message.

public ref class AlternateView : System::Net::Mail::AttachmentBase
public class AlternateView : System.Net.Mail.AttachmentBase
type AlternateView = class
    inherit AttachmentBase
Public Class AlternateView
Inherits AttachmentBase
繼承
AlternateView

備註

使用 AlternateView 類別,以不同的格式來指定電子郵件訊息的複本。Use the AlternateView class to specify copies of an email message in different formats. 例如,如果您以 HTML 傳送訊息,可能也會想要提供純文字版本,以免某些收件者使用無法顯示 HTML 內容的電子郵件讀取器。For example, if you send a message in HTML, you might also want provide a plain text version in case some of the recipients use email readers that cannot display HTML content.

這個類別有兩個屬性 LinkedResourcesBaseUri,用來解析電子郵件內容中的 Url。This class has two properties LinkedResources and BaseUri that are used to resolve URLs within the content of the email. LinkedResourcesLinkedResource 物件的集合。LinkedResources is a collection of LinkedResource objects. 轉譯時,電子郵件內容中的 Url 會先與 LinkedResources 集合中每個 LinkedResource 物件 ContentLink 的 Url 進行比對,並加以解析。When rendered, URLs within the email's content are first matched against the URLs in the ContentLink of each LinkedResource object in the LinkedResources collection, and resolved. 郵件讀取器會使用 BaseUri 來解析主體內的相對 Url,也可以解析 LinkedResources 集合中的相對 ContentLink Url。BaseUri is used by the mail reader to resolve relative URLs within the body, and also to resolve relative ContentLink URLs, in the LinkedResources collection.

建構函式

AlternateView(Stream)

使用指定的 AlternateView,初始化 Stream 的新執行個體。Initializes a new instance of AlternateView with the specified Stream.

AlternateView(Stream, ContentType)

使用指定的 AlternateViewStream,初始化 ContentType 的新執行個體。Initializes a new instance of AlternateView with the specified Stream and ContentType.

AlternateView(Stream, String)

使用指定的 AlternateView 和媒體類型,初始化 Stream 的新執行個體。Initializes a new instance of AlternateView with the specified Stream and media type.

AlternateView(String)

使用指定的檔案名稱,初始化 AlternateView 的新執行個體。Initializes a new instance of AlternateView with the specified file name.

AlternateView(String, ContentType)

使用指定的檔案名稱和內容類型,初始化 AlternateView 的新執行個體。Initializes a new instance of AlternateView with the specified file name and content type.

AlternateView(String, String)

使用指定的檔案名稱和媒體類型,初始化 AlternateView 的新執行個體。Initializes a new instance of AlternateView with the specified file name and media type.

屬性

BaseUri

取得或設定基底 URI,用來解析 AlternateView 中的相對 URI。Gets or sets the base URI to use for resolving relative URIs in the AlternateView.

ContentId

取得或設定這個附件的 MIME 內容識別碼。Gets or sets the MIME content ID for this attachment.

(繼承來源 AttachmentBase)
ContentStream

取得這個附件的內容資料流。Gets the content stream of this attachment.

(繼承來源 AttachmentBase)
ContentType

取得這個附件的內容類型。Gets the content type of this attachment.

(繼承來源 AttachmentBase)
LinkedResources

取得由這個附件所參考的內嵌資源集合。Gets the set of embedded resources referred to by this attachment.

TransferEncoding

取得或設定這個附件的編碼方式。Gets or sets the encoding of this attachment.

(繼承來源 AttachmentBase)

方法

CreateAlternateViewFromString(String)

使用 AlternateView 中指定的內容,建立電子郵件訊息的 StringCreates a AlternateView of an email message using the content specified in a String.

CreateAlternateViewFromString(String, ContentType)

使用 AlternateView 中指定的內容以及內容中指定的 MIME 媒體類型,建立電子郵件訊息的 StringCreates an AlternateView of an email message using the content specified in a String and the specified MIME media type of the content.

CreateAlternateViewFromString(String, Encoding, String)

使用 AlternateView 中指定的內容、指定的文字編碼和 MIME 媒體類型,建立電子郵件訊息的 StringCreates an AlternateView of an email message using the content specified in a String, the specified text encoding, and MIME media type of the content.

Dispose()

釋放 AttachmentBase 使用的資源。Releases the resources used by the AttachmentBase.

(繼承來源 AttachmentBase)
Dispose(Boolean)

釋放 AlternateView 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the AlternateView and optionally releases the managed resources.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於