how to embed an image in an HTML mime message with libetpan
i use libetpan to send smtp message and i want embed an image in my message
for example :
<html><body>
<img src="picture1.jpg" /> 
</body></html>
source code
static struct mailmime * get_file_part(const char * filename, const char * mime_type,
    const char * text, size_t length)
{
    char * disposition_name;
    int encoding_type;
    struct mailmime_disposition * disposition;
    struct mailmime_mechanism * encoding;
    struct mailmime_content * content;
    struct mailmime * mime;
    struct mailmime_fields * mime_fields;
    disposition_name = NULL;
    if (filename != NULL) {
        disposition_name = strdup(filename);
    }
    disposition = mailmime_disposition_new_with_data(MAILMIME_DISPOSITION_TYPE_INLINE,disposition_name, NULL, NULL, NULL, (size_t)-1);
    content = mailmime_content_new_with_str(mime_type);
    encoding_type = MAILMIME_MECHANISM_BASE64;
    encoding = mailmime_mechanism_new(encoding_type, NULL);
    mime_fields = mailmime_fields_new_with_data(encoding,NULL, NULL, disposition, NULL);
    mime = part_new_empty(content, mime_fields, NULL, 0);
    mailmime_set_body_text(mime, (char *)text, length);
    return mime;
}
static struct mailmime * get_sample_file_part(void)
{
    struct mailmime * part;
    part = get_file_part("picture1.jpg", "multipart/related", FILEDATA, sizeof(FILEDATA) - 1);
    return part;
}
using embed object in my message
   embed_part = get_sample_file_part();
  r = mailmime_smart_add_part(messagem, embed_part);
  if (r != MAILIMF_NO_ERROR)
      goto err;
  ////////////////////////////////////////////////////
  MMAPString *str = mmap_string_new("<html><body>test<img alt=\"\" src=\"");  
  str = mmap_string_append(str, lastboundary );
  str = mmap_string_append(str, "\" style=\"height: 256px; width: 296px\"/></body></html>");
 
     
    