write fetched mime section

Marko Ivancic <[email protected]> Thu, 13 Apr 2006 15:52:25 +0200
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
Hi

How to "insert" back the retrived section of a MIME.

I first retrive the mime message part
char* resultText;
size_t result_len = 0;

r = 
mailmessage_fetch_section(entireMail,entireMime,&resultText,&result_len); 
//and I get the right part

Then I try to write this part back into entireMime structure
/// I tried with this

mailmime* submime; // is apointer to submime of entireMime structure

data = submime->mm_body; //mailmime_data
mailmime_data_free(data); //free previous empty data

data = mailmime_data_new(nType, nTextEncoding,
                                     nTextEncoded, resultText, result_len,
                                     resutl_text); // create new 
retrived data

But it doesn't work.

r = mailmime_write(file, &col,eni);

 What am I doing wrong or better what is the right way to do it right ??

Tnx
By,
Marko


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642