summaryrefslogtreecommitdiff
path: root/src/lib/emailer.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-10-07 23:04:05 +0100
committerCarl Hetherington <cth@carlh.net>2015-10-09 13:44:59 +0100
commitfa8bdd16e1b3742e921b928708614613b6a21036 (patch)
tree177d2d84ff56f26d4b9504fc83b4cf13194b4395 /src/lib/emailer.h
parentbcf01bddc54da34425c727ed67f51cb946546ba6 (diff)
Missing files.
Diffstat (limited to 'src/lib/emailer.h')
-rw-r--r--src/lib/emailer.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/lib/emailer.h b/src/lib/emailer.h
new file mode 100644
index 000000000..4b4d1f6f7
--- /dev/null
+++ b/src/lib/emailer.h
@@ -0,0 +1,51 @@
+/*
+ Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <curl/curl.h>
+#include <boost/scoped_array.hpp>
+
+class Emailer
+{
+public:
+ Emailer (std::string from, std::string to, std::string subject, std::string body);
+
+ void add_cc (std::string cc);
+ void add_bcc (std::string bcc);
+ void add_attachment (boost::filesystem::path attachment, std::string);
+
+ void send (boost::shared_ptr<Job> job);
+
+ std::string notes () const;
+
+ size_t get_data (void* ptr, size_t size, size_t nmemb);
+
+private:
+ static std::string address_list (std::list<std::string> addresses);
+
+ std::string _from;
+ std::string _to;
+ std::string _subject;
+ std::string _body;
+ std::list<std::string> _cc;
+ std::list<std::string> _bcc;
+ std::list<std::pair<boost::filesystem::path, std::string> > _attachments;
+ std::string _email;
+ size_t _offset;
+ boost::scoped_array<char> _notes_buffer;
+};