cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Need help using CURL to send an email

From: Greg Stevens via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 1 Sep 2016 19:11:00 -0700

Hi Ray,

Thanks so much for this quick response and solution that now works! All
I had to do was change smpt to smpts and remove the port # in the url
and it now works!

Thanks again!

Greg

On 8/31/2016 11:37 PM, Ray Satiro via curl-library wrote:
> On 8/31/2016 8:29 PM, Greg Stevens via curl-library wrote:
>> curl_easy_setopt(curl, CURLOPT_URL, "smtp://smtp.gmail.com:465");
>
> You are specifying the SSL port for regular SMTP which is wrong, use
> smtps:// instead and the port will default to 465.
>
> curl_easy_setopt(curl, CURLOPT_URL, "smtps://smtp.gmail.com");
>
> And you may need to set CURLOPT_CAINFO to a certificate bundle [1] if
> you see the message '* SSL certificate problem: unable to get local
> issuer certificate'.
>
> Also gmail iirc disables "less secure" logins by default, which means
> they will not allow username password logins on some servers, even
> though SSL, unless you turn on less secure app mode [2].
>
>
> [1]: https://curl.haxx.se/docs/caextract.html
> [2]: https://support.google.com/accounts/answer/6010255?hl=en
>
>
>
> -------------------------------------------------------------------
> List admin: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette: https://curl.haxx.se/mail/etiquette.html

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