curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Sending an email with an image via libcurl

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sun, 26 Feb 2017 11:10:07 +0100

On Sun, Feb 26, 2017 at 01:29:48AM -0800, Nicholas Chambers wrote:
> Thanks Dan. I've made the changes you suggested. Good call about the date. I'll
> make sure to fix that. (Also, I am wanting it inline, so I removed that). In
> the actual code, I'll have it send the image in a better way like what you
> recommended, but will leave it alone for now since this program is more focused
> around the image. I tried running it again, and am still seeing the behavior. I
> tried removing the \r\n's from the image base64 encoding, but still no dice. I

This isn't a good idea, because SMTP and RFC822 enforces limits on line length.

> verified the image is valid by decoding my base64 encoded string and got back
> the image I was expecting. New code is attached.

I figured it out—there's a missing Content-Transfer-Encoding: base64 header
after the Content-Type: for the image.

>>> Dan
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-02-26