TransferEncoding 列挙型

定義

電子メール メッセージの添付データの Content-Transfer-Encoding ヘッダー情報を指定します。

public enum class TransferEncoding
public enum TransferEncoding
type TransferEncoding = 
Public Enum TransferEncoding
継承
TransferEncoding

フィールド

Base64 1

ストリーム ベースのデータをエンコードします。 RFC 2406 セクション 6.8 を参照してください。

EightBit 3

このデータは、行の全長が 8 ビット文字で 1000 以内の、国際文字を表す可能性がある 8 ビット文字です。 この 8 ビット MIME トランスポート拡張機能の詳細については、IETF RFC 6152 を参照してください。

QuotedPrintable 0

US-ASCII 文字セットの印刷可能な文字で構成されるデータをエンコードします。 RFC 2406 セクション 6.7 を参照してください。

SevenBit 2

エンコードされないデータに使用されます。 このデータは、行の全長が 1000 文字以内の 7 ビット US-ASCII 文字です。 RFC 2406 セクション 2.7 を参照してください。

Unknown -1

転送エンコーディングが不明であることを示します。

添付ファイルで使用されるコード例を TransferEncoding 次に示します。

static void DisplayStreamAttachment( Attachment^ a )
{
   Stream^ s = a->ContentStream;
   StreamReader^ reader = gcnew StreamReader( s );
   Console::WriteLine( L"Content: {0}", reader->ReadToEnd() );
   Console::WriteLine( L"Content Type {0}", a->ContentType );
   Console::WriteLine( L"Transfer Encoding {0}", a->TransferEncoding );
   
   // Note that you cannot close the reader before the email is sent. 
   // Closing the reader before sending the email will close the 
   // ContentStream and cause an SmtpException.
   reader = nullptr;
}
public static void DisplayStreamAttachment(Attachment a)
{
    Stream s = a.ContentStream;
    StreamReader reader = new StreamReader(s);
    Console.WriteLine("Content: {0}", reader.ReadToEnd());
    Console.WriteLine("Content Type {0}", a.ContentType.ToString());
    Console.WriteLine("Transfer Encoding {0}", a.TransferEncoding);
    // Note that you cannot close the reader before the email is sent.
    // Closing the reader before sending the email will close the
    // ContentStream and cause an SmtpException.
    reader = null;
}

注釈

列挙体の TransferEncoding 値は、プロパティと共に AttachmentBase.TransferEncoding 使用されます。

Content-Transfer-Encoding ヘッダーは、関連付けられているメッセージ本文のエンコードを指定して、SMTP 要件を満たすようにします。 SMTP では、トランスポート用のデータが 1000 文字以下の 7 ビット US-ASCII 文字に含まれる必要があります。

コンテンツ転送エンコードの値については、RFC 2045 セクション 6 https://www.ietf.orgで詳しく説明されています。

適用対象