Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttachmentCollection attachmentCollection in C#

I am trying to utilize the AttachmentCollection Class in C# and when I try to create a new instance of it it gives me an error saying "Error 32 The type 'System.Net.Mail.AttachmentCollection' has no constructors defined".... Here is what I was trying, how to a create a new instance of this if there are no constructors defined ?

AttachmentCollection attachmentCollection = new AttachmentCollection();

Thanks for your help!

like image 496
Gabe Avatar asked Aug 18 '09 15:08

Gabe


1 Answers

Sure this might be a bad design, but to answer the question short:

AttachmentCollection attachmentCollection = new MailMessage().Attachments;
like image 75
Louie Almeda Avatar answered Oct 19 '22 03:10

Louie Almeda