Re: [gmime-devel] How to get attachment headers & inline attachment file



Hi Ash,

What you'll need to do is use the GMimeParser to parse a message from a GMimeStream and then iterate over the subparts of the GMimeMessage, looking for GMimeParts with a Content-Type of "image/*".

Once you have an image part, you can use:

GMimeDataWrapper *content = g_mime_part_get_content_object (part);

That will get the image content. Next, you'll want to write that content out to a file:

GMimeStream *output;
int fd;

fd = open ("/path/to/file", O_CREAT | O_WRONLY, 0666);
output = g_mime_stream_fs_new (fd);

g_mime_data_wrapper_write_to_stream (content, output);
g_object_unref (output);

Hope that helps,

Jeff

On 03/08/2012 08:03 AM, ash wrote:
Hi ,

  I am new to gmime , if anyone can help in how to get attachment headers&
Inline image .



_______________________________________________
gmime-devel-list mailing list
gmime-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gmime-devel-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]