diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-01-06 20:00:51 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-06 20:00:51 +0100 |
| commit | f15d2872c717e97112f5b0becb4645b91d378cc6 (patch) | |
| tree | d06fc0fa4bec080ca59b061797d746a4fe0283db /src | |
| parent | 2ef21914513ea6d4d62682cc4ec74b4c3809fc01 (diff) | |
Split Email::send() up.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/email.cc | 9 | ||||
| -rw-r--r-- | src/lib/email.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/email.cc b/src/lib/email.cc index 7a6e58d91..b91ae4702 100644 --- a/src/lib/email.cc +++ b/src/lib/email.cc @@ -110,7 +110,7 @@ Email::get_data(void* ptr, size_t size, size_t nmemb) void -Email::send(string server, int port, EmailProtocol protocol, string user, string password) +Email::create() { char date_buffer[128]; time_t now = time (0); @@ -185,6 +185,13 @@ Email::send(string server, int port, EmailProtocol protocol, string user, string if (!_attachments.empty ()) { _email += "\r\n--" + boundary + "--\r\n"; } +} + + +void +Email::send(string server, int port, EmailProtocol protocol, string user, string password) +{ + create(); curl_global_init (CURL_GLOBAL_DEFAULT); diff --git a/src/lib/email.h b/src/lib/email.h index ac4703453..878c5b131 100644 --- a/src/lib/email.h +++ b/src/lib/email.h @@ -54,6 +54,7 @@ private: std::string fix (std::string s) const; static std::string encode_rfc1342 (std::string subject); + void create(); std::string _from; std::vector<std::string> _to; |
