cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Need help using CURL to send an email

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 1 Sep 2016 02:37:49 -0400

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
Received on 2016-09-01