System.Net.Mail.AttachmentCollection Class

Stores attachments to be sent as part of an e-mail message.

See Also: AttachmentCollection Members


public sealed class AttachmentCollection : System.Collections.ObjectModel.Collection<Attachment>, IDisposable


Instances of the System.Net.Mail.AttachmentCollection class are returned by the MailMessage.AlternateViews and MailMessage.Attachments properties.

Use the MailMessage.AlternateViews property to specify copies of an e-mail message in different formats. For example, if you send a message in HTML, you might also want provide a plain text version in case some of the recipients use e-mail readers that cannot display HTML content.

Use the collection returned by the MailMessage.Attachments property to add an attachment, such as a file or the contents of a System.IO.Stream to this System.Net.Mail.MailMessage.


Namespace: System.Net.Mail
Assembly: System (in System.dll)
Assembly Versions:,
Since: .NET 2.0