Re: [gmime-devel] Help appreciated adding attachments to outgoing mails



  Thanks for the detailed response, Jeffrey.  I don't know how
 you find the time!

  I used your framework, with only minor changes for the C++ vector
 type and things look mostly perfect [0]

  The only omission is that there is no explicit MIME-type for the
 main part of the message.  I thought I could add these two lines:

    GMimeContentType *new_type;
    new_type = g_mime_content_type_new_from_string ("text/plain; charset=UTF-8");
    g_mime_object_set_content_type ((GMimeObject *) message, new_type);
    g_mime_message_set_mime_part (message,(GMimeObject*) multipart);

  Unfortunately that doesn't quite do the right thing.  The resulting
 mail looks something like:

Content-Type: text/plain; charset=UTF-8
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-Qq0SE38PaOrGL/oBRst7"

--=-Qq0SE38PaOrGL/oBRst7

  This is text/plain

Steve
-- 
http://www.steve.org.uk/

--=-Qq0SE38PaOrGL/oBRst7
Content-Type: application/octet-stream; name=fstab
Content-Disposition: attachment; filename=fstab
Content-Transfer-Encoding: base64

IyAvZXRjL2ZzdGFiOiBzdGF0aWMgZmlsZSBzeXN0ZW0gaW5mb3JtYXRpb24uCiMKIyBVc2UgJ2Js
a2lkJyB0byBwcmludCB0aGUgdW5pdmVyc2FsbHkgdW5pcXVlIGlkZW50aWZpZXIgZm9yIGEKIyBk


  So it seems that the main-message is text/plain, rather than just
 the text-component of it.

  If you can tell me what I'm doing wrong then I'd appreciate it.

Steve
--


[0] -
https://github.com/skx/lumail/commit/bb14b9b5a65d7688ebaa8a80ddba394d58f1cac6


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