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!
Sure this might be a bad design, but to answer the question short:
AttachmentCollection attachmentCollection = new MailMessage().Attachments;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With