Le 27/09/2013 14:45, bill-lancaster a écrit :
> Some advice on how to extract attachment s woule be appreciated.
>
> I have a message (stored at hResultGlobal!MsgWhole) known to contain an
> attached .pdf
>
>       hMimeMessage = New MimeMessage(hResultGlobal!MsgWhole)
>       hMimeMessage.Headers["Content-Type"] produces - multipart/mixed;
> boundary="----MIME delimiter for sendEmail-530503.088449226".
> but
>       hMimeMessage.Headers["Content-Disposition"] gives a blank string
> but I know the message contains the line - 'Content-Disposition: attachment;
> filename="bg01.pdf'
>

You have to use the ContentType property. Please read the RFC about Mime 
format to understand that what is stored in the headers are not 
necessarily what *you* want to get.

As for the attachments, you must browse the Mime subparts and use the 
Data property once you have found your attachment. Again, read the RFCs 
to see that a Mime Message can have any structure : an attachment can be 
a part inside a part inside a part...

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to