Home > DeveloperSection > Forums > Identify filename of Email Attachment
Ankita Pandey
Ankita Pandey

Total Post:183

Posted on    December-18-2013 12:57 AM

 C# C# 

 1 Reply(s)
 1429  View(s)
Rate this:

How do I get filename of the email attachment. I am using ActiveUp.Net.Mail.

Mailbox inbox = imap.SelectMailbox("inbox");

int[] ids = inbox.Search("ALL");

ArrayList mailContainer = new ArrayList();

for (int x = 0; x < ids.Length; x++ )




foreach (Message msg in mailContainer)


    if (msg.Attachments.Count > 0)





I was thinking of saving the attachment and then read the attachment...Is there a way I would directly read the attachment without saving if it in .xls format?

ezra heywood
ezra heywood

Total Post:145

Posted on    December-18-2013 1:28 AM

Hi Ankita,

Looks like this should work...

foreach(var attachment in msg.Attachments)


   attachment.StoreToFile(filepath + attachment.Filename);


Don't want to miss updates? Please click the below button!

Follow MindStick