in the .NET MailMessage class, how do you remove an attachment?
We have modified the code on a project I am working on. Part of the modifications seem to impact code that has not changed at all.
It would appear that now a part of the code that added attachments to email (using the "MailMessage" class) is failing because those email attachments are located on a secure server.
And so, as a test, it would be interesting to implement a piece of code that would remove the attachment upon a failure of the SmtpClient Send (which passes a MailMessage class as a parameter). If I am using .Attachments.Remove, it asks for an Attachment class. Where and how do I assign this?
Remove
removes a specific item. Usemail.Attachments.Clear()
to remove all items.