summaryrefslogtreecommitdiff
path: root/src/lib/email.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-03-07 16:40:03 +0100
committerCarl Hetherington <cth@carlh.net>2024-03-07 16:40:03 +0100
commit0a93c0df8fd6a40b627cc53d51a249628db6b795 (patch)
treed8aa0df9e1e4cf69014b659aae5dbcc472e75911 /src/lib/email.cc
parentf610a8708f11d6052a995f31cd506bc93faafa1c (diff)
Store attachment contents in the Email object.
Diffstat (limited to 'src/lib/email.cc')
-rw-r--r--src/lib/email.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/email.cc b/src/lib/email.cc
index 5017f4d28..8557b40e0 100644
--- a/src/lib/email.cc
+++ b/src/lib/email.cc
@@ -77,7 +77,7 @@ void
Email::add_attachment(boost::filesystem::path file, string name, string mime_type)
{
Attachment a;
- a.file = file;
+ a.file = dcp::ArrayData(file);
a.name = name;
a.mime_type = mime_type;
_attachments.push_back (a);
@@ -171,8 +171,7 @@ Email::send(string server, int port, EmailProtocol protocol, string user, string
}
bio = BIO_push (b64, bio);
- ArrayData data (i.file);
- BIO_write (bio, data.data(), data.size());
+ BIO_write(bio, i.file.data(), i.file.size());
(void) BIO_flush (bio);
char* out;