cURL / Mailing Lists / curl-library / Single Mail

curl-library

Sample sending SMTP HTML email

From: brett kaylor <bbkaylor_at_yahoo.com>
Date: Sun, 8 Jan 2012 17:50:39 -0800 (PST)

I am new to this group.  An answer may exist that I haven't discovered, sorry in advance if that is the case.
 
I am trying to send an HTML email via SMTP with libcurl.  I have an html file and am using the curl_easy_setopt(curl, CURLOPT_READDATA, f); Where f is a FILE*.  I need to set the Content-Type in the header otherwise it just comes through as text.  I was trying to build a header and use curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);  But it doesn't seem to get used.  I also tried to put a complete list of header values in the html file; but that only partially worked.  The headers worked, but the content data was missing data.
 
The ideal mechanism for me would be to have the HTML file seperate from the header, but I can work around that if I have to.  Can anyone point me to a working example of sending SMTP HTML email?
 
thanks,

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-01-09