X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Femailer.cc;h=8a061738bd14c86bfd6658bc5b194def845c94b0;hb=8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8;hp=b7cae70798437526a51d05e4d02903f6f7a07345;hpb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26;p=dcpomatic.git diff --git a/src/lib/emailer.cc b/src/lib/emailer.cc index b7cae7079..8a061738b 100644 --- a/src/lib/emailer.cc +++ b/src/lib/emailer.cc @@ -25,7 +25,6 @@ #include #include #include -#include #include "i18n.h" @@ -144,7 +143,7 @@ Emailer::send (string server, int port, EmailProtocol protocol, string user, str _email += _body; - BOOST_FOREACH (Attachment i, _attachments) { + for (auto i: _attachments) { _email += "\r\n\r\n--" + boundary + "\r\n" "Content-Type: " + i.mime_type + "; name=" + i.name + "\r\n" "Content-Transfer-Encoding: Base64\r\n" @@ -177,7 +176,7 @@ Emailer::send (string server, int port, EmailProtocol protocol, string user, str throw NetworkError ("Could not initialise libcurl"); } - if ((protocol == EMAIL_PROTOCOL_AUTO && port == 465) || protocol == EMAIL_PROTOCOL_SSL) { + if ((protocol == EmailProtocol::AUTO && port == 465) || protocol == EmailProtocol::SSL) { /* "SSL" or "Implicit TLS"; I think curl wants us to use smtps here */ curl_easy_setopt (curl, CURLOPT_URL, String::compose("smtps://%1:%2", server, port).c_str()); } else { @@ -194,13 +193,13 @@ Emailer::send (string server, int port, EmailProtocol protocol, string user, str curl_easy_setopt (curl, CURLOPT_MAIL_FROM, _from.c_str()); struct curl_slist* recipients = 0; - BOOST_FOREACH (string i, _to) { + for (auto i: _to) { recipients = curl_slist_append (recipients, i.c_str()); } - BOOST_FOREACH (string i, _cc) { + for (auto i: _cc) { recipients = curl_slist_append (recipients, i.c_str()); } - BOOST_FOREACH (string i, _bcc) { + for (auto i: _bcc) { recipients = curl_slist_append (recipients, i.c_str()); } @@ -210,7 +209,7 @@ Emailer::send (string server, int port, EmailProtocol protocol, string user, str curl_easy_setopt (curl, CURLOPT_READDATA, this); curl_easy_setopt (curl, CURLOPT_UPLOAD, 1L); - if (protocol == EMAIL_PROTOCOL_AUTO || protocol == EMAIL_PROTOCOL_STARTTLS) { + if (protocol == EmailProtocol::AUTO || protocol == EmailProtocol::STARTTLS) { curl_easy_setopt (curl, CURLOPT_USE_SSL, (long) CURLUSESSL_TRY); } curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0L); @@ -233,7 +232,7 @@ string Emailer::address_list (list addresses) { string o; - BOOST_FOREACH (string i, addresses) { + for (auto i: addresses) { o += i + ", "; }