AttachmentCollectionSaveAll Method (String) |
Namespace: MailBee.Mime
Exception | Condition |
---|---|
MailBeeInvalidArgumentException | folderName is a null reference (Nothing in Visual Basic) or an empty string. |
MailBeeIOException | An error occurred and ThrowExceptions is true. |
If the specified folder does not exist, MailBee will try to create it first.
Attachments having duplicate filenames will be renamed and then saved. For instance, if there are three attachments with my_cat.jpg file name, they will be saved to disk under the following filenames:
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Mime; // The actual code (put it into a method of your class) // Load the message from file. MailMessage msg = new MailMessage(); msg.LoadMessage(@"C:\Docs\TestMail.eml"); // Save all attachments into the folder. msg.Attachments.SaveAll(@"C:\Temp");