Domino interop - read email attachments

Hi.I am working on .net application that reads emails and attachments and saves attachments to the file system.

I was able to read multiple attachments using NotesDocument.Items and then use NotesDocument.GetAttachment and then NotesEmbeddedObject.ExtractFile.

This approach is described in:

http://www.dotnetspider.com/resources/16036-Extract-Message-Attachment-From-lotus-Notes.aspx

To use GetAttachment function I need to know file name. I was getting it from NotesItem. It works fine even with multiple attachments but doesn’t work with more than one attachment if email originated (sent from) outside notes (e.g.hotmail). The second NotesItem element instead of giving name of the second attachment returns filename of the first attachment (!). If I just forward received email with two or more attachments to myself - .net code is able to retrieve name of the second attachment correctly.

I haven’t found any workaround / any way to save attachments from the email received from the outside world.

Any help will be greatly appreciated.

Thanks.

Jack

Subject: Domino interop - read email attachments

I can’t test it, but a possible workaround is to use NotesSession.Evaluate(“@AttachmentNames”, notesDoc) to get an array of attachment filenames.