I'm using openpop to retrieve and process emails, In processing the mails, I'm checking for attachments and saving them to a specific folder. This works fine for csv files but for some reason for pdfs "att.Name" is returning null and won't save.
AttachmentCollection attachments = mailItem.Attachments;
foreach (Attachment att in attachments)
{
using (var fileStream = new FileStream(conf.AttachmentSaveTo + att.Name, FileMode.Create, FileAccess.Write))
{
att.ContentStream.CopyTo(fileStream);
}
}
Any help, much appreciated.