MailMill .NET Class Library

Mail.Attachments Property

Gets a MailAttachments object that contains the MailAttachment objects.

public MailAttachments Attachments {get;}

Remarks

To add a new item to the Attachments object, create a new MailAttachment object, set the MailAttachment object properties and pass this object to the Add method. You can also pass a file name string to the Add method to create a new MailAttachment object, load it from the path specified, and add it to the MailAttachments in one step.

Example

This sample shows two different ways to add attachments to a Mail object.

Mail oMail = new Mail();

MailAttachment oAttachment = new MailAttachment();
oAttachment.Load(@"c:\documentation\product_specs.pdf");
oMail.Attachments.Add(oAttachment);
    
oMail.Attachments.Add(@"c:\documentation\product_help.pdf");

See Also

Mail Class | MailMill Namespace | MailAttachments | MailAttachment