diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-12-23 21:53:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-12-26 00:27:08 +0100 |
| commit | 8caf013a9b8d709ed7c3d5e9febee0067e6fcf1f (patch) | |
| tree | 40da87cb357e8b1c54a1464bdbac2d014640e30c /src/lib/email.cc | |
| parent | cec6ff92aef45c687085ecfc1059004407c18c57 (diff) | |
Replace String::compose with fmt::format().
Diffstat (limited to 'src/lib/email.cc')
| -rw-r--r-- | src/lib/email.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/email.cc b/src/lib/email.cc index 7a6e58d91..10393945f 100644 --- a/src/lib/email.cc +++ b/src/lib/email.cc @@ -19,7 +19,6 @@ */ -#include "compose.hpp" #include "config.h" #include "email.h" #include "exceptions.h" @@ -146,7 +145,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" @@ -195,9 +194,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 ()) { @@ -237,7 +236,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); |
