DispositionTypeNames Klass
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Tillhandahåller de strängar som används för att ange borttagningstypen för en bifogad e-postbilaga.
public ref class DispositionTypeNames abstract sealed
public static class DispositionTypeNames
type DispositionTypeNames = class
Public Class DispositionTypeNames
- Arv
-
DispositionTypeNames
Exempel
I följande kodexempel anges borttagningstypen för en bifogad fil.
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();
}
Kommentarer
Värdena i den här uppräkningen kan användas för att ange DispositionType egenskapen för en e-postbilaga. Informationen i ContentDisposition klassen representerar MIME Content-Disposition-huvudet. Den här rubriken beskrivs i RFC 2183 tillgänglig på https://www.ietf.org.
Fält
| Name | Description |
|---|---|
| Attachment |
Anger att den bifogade filen ska visas som en fil som är kopplad till e-postmeddelandet. |
| Inline |
Anger att den bifogade filen ska visas som en del av e-postmeddelandets brödtext. |