aspNetEmail

Attachment.ContentDisposition Property

The Content Disposition for the mime part.

public string ContentDisposition {get; set;}

Property Value

A string representing the ContentDisposition of the attachment.

Remarks

By default this property is set to 'attachment' and should only be modified by the advanced developer.

Example

[C#]
            EmailMessage msg = new EmailMessage();
            msg.Server = "mail.mycompany.com";
            msg.FromAddress = "me@mycompany.com";
            msg.To = "you@yourcompany.com";
            msg.Subject = "this is an advanced sample";
            msg.Body = "this email contains an inline attachment.";
             
            Attachment a = new Attachment();
            a.Name = "MyAsciiText.txt";
            a.ContentDisposition = "inline";
            a.ContentTransferEncoding = MailEncoding.Bit7;
            a.ContentType = "text/plain";
            a.Contents = "this is my inline attachment";
             
            msg.AddAttachment( a );
            msg.Send();
                
[Visual Basic]
            Dim msg As New EmailMessage()
            msg.Server = "mail.mycompany.com"
            msg.FromAddress = "me@mycompany.com"
            msg.To = "you@yourcompany.com"
            msg.Subject = "this is an advanced sample"
            msg.Body = "this email contains an inline attachment."
             
            Dim a As New Attachment()
            a.Name = "MyAsciiText.txt"
            a.ContentDisposition = "inline"
            a.ContentTransferEncoding = MailEncoding.Bit7
            a.ContentType = "text/plain"
            a.Contents = "this is my inline attachment"
             
            msg.AddAttachment(a)
            msg.Send()
                

See Also

Attachment Class | aspNetEmail Namespace