[Evolution-hackers] Re: Help request: Mime v1.0 from char* to CamelMimeMessage* Solution Found
- From: Smartuser <smartuser gmail com>
- To: evolution-hackers gnome org
- Subject: [Evolution-hackers] Re: Help request: Mime v1.0 from char* to CamelMimeMessage* Solution Found
- Date: Fri, 9 Jun 2006 13:52:44 +0200
I'll think I've found the solution to my problem.
printf("Message:\n %s\n", szMessage);
stream = camel_stream_mem_new();
camel_stream_reset (stream);
msg = camel_mime_message_new ();
camel_stream_write(stream, szMessage, strlen(szMessage));
camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) msg,
stream);
camel_stream_reset (stream);
if(-1 ==
camel_data_wrapper_construct_from_stream((CamelDataWrapper*) msg,stream)){
printf("Hello World Data Wrapper");
}else{
printf ("Error Wrap = \n");
}
On Friday 09 June 2006 11:24, Smartuser wrote:
> This is some extra information on my previous message.
> - Help request: Mime v1.0 from char* to CamelMimeMessage*
>
> I've tried the following code to put the char* (containing the message) in
> a stream. And then convert it to a message. But this dousnot work this way
> I guess what am I doing wrong?
>
>
> CamelStream *stream = NULL;
> CamelDataWrapper *dw = NULL;
> CamelMimeParser *parser = NULL;
> // CamelContentType *ct = NULL;
> int errwrap = 0;
> debug(__FILE__,__FUNCTION__,__LINE__,1);
> //if(IMToINet(pMapiMessage, &szMessage) == hrSuccess){
> if(IMToINet(pMapiMessage, &szMessage) != hrSuccess){
> debug(__FILE__,__FUNCTION__,__LINE__,1);
> printf("Message:\n %s\n", szMessage);
>
> stream = camel_stream_mem_new();
> camel_stream_reset(stream);
> camel_stream_write(stream, szMessage, strlen(szMessage));
> msg = camel_mime_message_new ();
>
> if(-1 ==
> camel_data_wrapper_construct_from_stream((CamelDataWrapper*) msg,stream)){
> printf("Hello World Data Wrapper");
> }else{
> // stream = camel_stream_mem_new_with_buffer((const
> char*)szMessage, strlen(szMessage));
> // errwrap = camel_data_wrapper_construct_from_stream(dw,stream);
>
> printf ("Error Wrap = \n");
> // printf("mime_type = %s\n",
> camel_data_wrapper_get_mime_type(dw)); }
> _______________________________________________
> Evolution-hackers mailing list
> Evolution-hackers gnome org
> http://mail.gnome.org/mailman/listinfo/evolution-hackers
-------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]