cURL / Mailing Lists / curl-library / Single Mail


Re: attach a binary file to an email

From: Daniel Stenberg <>
Date: Sun, 2 Oct 2016 00:26:09 +0200 (CEST)

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 -
  - gmime -
  - mimetic - (C++)

List admin:
Received on 2016-10-02