MailMill .NET Class Library

MailAttachment.Data Property

Gets or sets the attachment file content.

public object Data {get; set;}

Remarks

The Data property can either be an array of byte or a string value. If Data contains a string value, it will be converted from UNICODE using the Charset character set encoding. If Data is set to a value that is neither a string nor a byte array, the value will be converted to string if possible or an error will occur.

Example

This sample shows how to create a new MailAttachment.

MailAttachment oAttachment = new MailAttachment();
oAttachment.Data = "Hello World!";
oAttachment.Type = "text/plain";
oAttachment.Name = "test.txt";

See Also

MailAttachment Class | MailMill Namespace | Mail.Charset