[haXe] mtwin.mail.imap and attachement?

Pascal Péridont pperidont at motion-twin.com
Mon Apr 16 12:48:02 CEST 2007


Ivan Kobzarev a écrit :
> Hi All.
>     Who have ever get attachement from message in haxe. For example I 
> have:
Here's a small sample that get the main part (text/html or text/plain) 
of an email on imap :

        var mb = imapCnx.getMailbox( "INBOX" );
        var m = mb.get( uid, true );
        var mainPartId = m.structure.getMainPart().id;

        var t = if( mainPartId != "" )
            
m.getSection(mainPartId,Header)+m.getSection(mainPartId,Text,true);
        else
            m.getSection(mainPartId,true);
        var mainPart = 
mtwin.mail.Browser.parseString(t).getMainPartCharset("utf-8");


If you already have the complete mime content of the email, you can use :
mtwin.mail.Browser.parseString(completeMime).getMainPartCharset("utf-8");

Pascal




More information about the Haxe mailing list