1

I'm here asking if it is possible to list all the attachments in a E-mail, show them in a list box, and only retrive them (on a program in the OS that opens that extension) once the user clicks on it.

If it's possible, please explain how. I'm using OpenPop.net and C#.

Thanks in advance.

João Borrego.

João Borrego
  • 95
  • 2
  • 12

1 Answers1

-1

You certainly can.

Use the Message.FindAllAttachments method to get a List<MessagePart> referencing each attachment in the Message. You might use the MessagePart.FileName property to populate your ListBox (beware of duplicate names however).

I'm not sure how you'd download an attachment through a user's interaction with a ListBox. Some ideas come to mind but in general you can download attachments using the File.WriteAllBytes method, passing in the Message.Body property for the method's bytes argument.

I recently used OpenPop in a project and was pleased with it.

Jay Riggs
  • 53,046
  • 9
  • 139
  • 151
  • To use Message.FindAllAttachments method you need to download message from server and user ask how to get attachment file names without downloading the whole attachment. I do not find a way in latest 2.0.4.369 version to find out attachment data without downloading the whole message. OpenPop is not flexible in this case. – Tomas Oct 26 '12 at 11:51