cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: attach a binary file to an email

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Sun, 2 Oct 2016 02:34:55 -0400

On 10/1/2016 6:26 PM, Daniel Stenberg wrote:
> On Fri, 30 Sep 2016, Canellas wrote:
>
>> Searching the web, I came to conclude that either I go deep into RFC
>> 2045, or try to use another library.
>
> That seems accurate. libcurl only handles the email *transport*:
> sending the SMTP protocol stuff and the payload as *prepared by you*.
> You need to pass on the correct email headers and body. To send binary
> files you need to send a mime-formatted email body. libcurl will not
> help you produce such email body. You need to find a tool/library that
> makes one.
>
> A quick google showed me at least these library candidates (I've not
> used any of them myself):
>
> - libcmime - http://libcmime.org/
> - gmime - http://spruce.sourceforge.net/gmime/
> - mimetic - http://www.codesink.org/mimetic_mime_library.html (C++)
>

Also libquickmail [1] which uses libcurl. It appears you can do it with
just libcurl [2], I'll see if I can come up with an example.

[1]: https://sourceforge.net/projects/libquickmail/
[2]: https://curl.haxx.se/mail/lib-2012-04/0021.html

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-10-02