-1

I can't send a letter using the curl library. Writes an error unsupported protocol. I use the standard code from the official site: https://curl.se/libcurl/c/smtp-mail.html I tried different options, none came up:

curl_easy_setopt (curl, CURLOPT_URL, "smtp://smtp.gmail.com:465");
curl_easy_setopt (curl, CURLOPT_URL, "smtp://smtp.gmail.com");
curl_easy_setopt (curl, CURLOPT_URL, "smtp.gmail.com");
curl_easy_setopt (curl, CURLOPT_URL, "smtp://gmail.com");

Error message: curl_easy_perform() failed: Unsupported protocol

Eric Postpischil
  • 195,579
  • 13
  • 168
  • 312
Mikhail
  • 13
  • 3

1 Answers1

1

if you want to use smtp, you need to use a libcurl compiled with --enable-smtp, eg

./configure --with-ssl --enable-smtp
make -j $(nproc)

the libcurl you are linking against was not compiled with smtp support. if you're wondering how to compile libcurl yourself, maybe check out https://stackoverflow.com/a/56394968/1067003

hanshenrik
  • 19,904
  • 4
  • 43
  • 89