Aracılığıyla paylaş


DispositionTypeNames Sınıf

Tanım

E-posta eki için değerlendirme türünü belirtmek için kullanılan dizeleri sağlar.

public ref class DispositionTypeNames abstract sealed
public static class DispositionTypeNames
type DispositionTypeNames = class
Public Class DispositionTypeNames
Devralma
DispositionTypeNames

Örnekler

Aşağıdaki kod örneği, ekin değerlendirme türünü ayarlar.

public static void CreateMessageInlineAttachment3(string server, string
textMessage)
{
    // Create a message and set up the recipients.
    MailMessage message = new MailMessage(
       "jane@contoso.com",
       "ben@contoso.com",
       "An inline text message for you.",
       "Message: ");

    // Attach the message string to this email message.
    Attachment data = new Attachment(textMessage, MediaTypeNames.Text.Plain);
    // Send textMessage as part of the email body.
    message.Attachments.Add(data);
    ContentDisposition disposition = data.ContentDisposition;
    disposition.DispositionType = DispositionTypeNames.Inline;
    //Send the message.
    // Include credentials if the server requires them.
    SmtpClient client = new SmtpClient(server);
    client.Credentials = (ICredentialsByHost)CredentialCache.DefaultNetworkCredentials;
    client.Send(message);
    data.Dispose();
}

Açıklamalar

Bu numaralandırmadaki değerler, e-posta ekinin DispositionType özelliğini ayarlamak için kullanılabilir. sınıfındaki ContentDisposition bilgiler MIME content-Disposition üst bilgisini temsil eder. Bu üst bilgi rfc 2183 adresinde https://www.ietf.orgkullanılabilir bölümünde açıklanmıştır.

Alanlar

Name Description
Attachment

Ekin e-posta iletisine eklenmiş bir dosya olarak görüntüleneceğini belirtir.

Inline

Ekin e-posta iletisi gövdesinin bir parçası olarak görüntüleneceğini belirtir.

Şunlara uygulanır

Ayrıca bkz.