https://imgur.com/a/5cFfi8Q
- Code: Select all
mail = MailMessage.Load(file);
foreach (Attachment attach in mail.Attachments)
{
var target = path + Path.DirectorySeparatorChar + attach.ContentType.Name;
fs = File.Create(target);
attach.Data.CopyTo(fs);
fs.Dispose();
}
Here I also attached a sample file for you to test out.