summaryrefslogtreecommitdiff
path: root/src/lib/email.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/email.cc')
-rw-r--r--src/lib/email.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/email.cc b/src/lib/email.cc
index 1333b9e2d..6a70ff774 100644
--- a/src/lib/email.cc
+++ b/src/lib/email.cc
@@ -19,7 +19,6 @@
*/
-#include "compose.hpp"
#include "config.h"
#include "dcpomatic_log.h"
#include "email.h"
@@ -119,7 +118,7 @@ Email::send_with_retry(string server, int port, EmailProtocol protocol, int retr
send(server, port, protocol, user, password);
return;
} catch (NetworkError& e) {
- LOG_ERROR("Error %1 when trying to send email on attempt %2 of 3", e.what(), this_try + 1, retries);
+ LOG_ERROR("Error {} when trying to send email on attempt {} of 3", e.what(), this_try + 1, retries);
if (this_try == (retries - 1)) {
throw;
}
@@ -156,7 +155,7 @@ Email::send(string server, int port, EmailProtocol protocol, string user, string
}
_email += "Subject: " + encode_rfc1342(_subject) + "\r\n" +
- variant::insert_dcpomatic("User-Agent: %1\r\n\r\n");
+ variant::insert_dcpomatic("User-Agent: {}\r\n\r\n");
if (!_attachments.empty()) {
_email += "--" + boundary + "\r\n"
@@ -205,9 +204,9 @@ Email::send(string server, int port, EmailProtocol protocol, string user, string
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());
+ curl_easy_setopt(curl, CURLOPT_URL, fmt::format("smtps://{}:{}", server, port).c_str());
} else {
- curl_easy_setopt(curl, CURLOPT_URL, String::compose("smtp://%1:%2", server, port).c_str());
+ curl_easy_setopt(curl, CURLOPT_URL, fmt::format("smtp://{}:{}", server, port).c_str());
}
if (!user.empty()) {
@@ -247,7 +246,7 @@ Email::send(string server, int port, EmailProtocol protocol, string user, string
auto const r = curl_easy_perform(curl);
if (r != CURLE_OK) {
- throw NetworkError(_("Failed to send email"), String::compose("%1 sending to %2:%3", curl_easy_strerror(r), server, port));
+ throw NetworkError(_("Failed to send email"), fmt::format("{} sending to {}:{}", curl_easy_strerror(r), server, port));
}
curl_slist_free_all(recipients);