add a Http::set_smtp_ssl_mode(long mode) method for selecting the ssl mode

This commit is contained in:
2023-05-10 14:00:33 +02:00
parent e822e13dc8
commit bf386e2286
2 changed files with 34 additions and 0 deletions

View File

@@ -86,6 +86,8 @@ Http & Http::begin()
smtp_from = nullptr;
username = nullptr;
password = nullptr;
force_smtp_ssl_mode = false;
smtp_ssl_mode = 0;
return *this;
}
@@ -195,6 +197,15 @@ Http & Http::add_recipient(const std::wstring & recipient)
}
Http & Http::set_smtp_ssl_mode(long mode)
{
force_smtp_ssl_mode = true;
smtp_ssl_mode = mode;
return *this;
}
Http & Http::add_headers(pt::Space * headers)
{
additional_space_headers_to_send = headers;
@@ -812,6 +823,12 @@ void Http::put_method(Method & method)
{
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, smtp_recipients);
}
if( force_smtp_ssl_mode )
{
curl_easy_setopt(curl, CURLOPT_USE_SSL, smtp_ssl_mode);
}
break;
default: