DispositionTypeNames.Inline Field


Specifies that the attachment is to be displayed as part of the e-mail message body.

Namespace:   System.Net.Mime
Assembly:  System (in System.dll)

public const string Inline

Field Value

Type: System.String

The following code example sets the disposition type for an attachment.

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

	// Attach the message string to this e-mail message.
	Attachment data = new Attachment(textMessage, MediaTypeNames.Text.Plain);
	// Send textMessage as part of the e-mail body.
	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;

.NET Framework
Available since 2.0
Return to top