DispositionTypeNames.Inline Campo

Definición

Especifica que los datos adjuntos se mostrarán como parte del cuerpo del mensaje de correo electrónico.

public: System::String ^ Inline;
public const string Inline;
val mutable Inline : string
Public Const Inline As String 

Valor de campo

Ejemplos

En el ejemplo de código siguiente se establece el tipo de disposición de los datos adjuntos.

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();
}

Se aplica a

Consulte también