+2015-12-04 Carl Hetherington <cth@carlh.net>
+
+ * Fix non-functional send-problem-report.
+
2015-12-03 Carl Hetherington <cth@carlh.net>
* Version 2.6.2 released.
string const name = tidy_for_filename(i.cinema->name) + "_" + tidy_for_filename(film_name) + ".zip";
email.add_attachment (zip_file, name, "application/zip");
- email.send ();
+
+ Config* c = Config::instance ();
+ email.send (c->mail_server(), c->mail_port(), c->mail_user(), c->mail_password());
if (log) {
log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
}
void
-Emailer::send ()
+Emailer::send (string server, int port, string user, string password)
{
char date_buffer[32];
time_t now = time (0);
throw NetworkError ("Could not initialise libcurl");
}
- curl_easy_setopt (curl, CURLOPT_URL, String::compose (
- "smtp://%1:%2",
- Config::instance()->mail_server().c_str(),
- Config::instance()->mail_port()
- ).c_str());
+ curl_easy_setopt (curl, CURLOPT_URL, String::compose ("smtp://%1:%2", server.c_str(), port).c_str());
- if (!Config::instance()->mail_user().empty ()) {
- curl_easy_setopt (curl, CURLOPT_USERNAME, Config::instance()->mail_user().c_str());
+ if (!user.empty ()) {
+ curl_easy_setopt (curl, CURLOPT_USERNAME, user.c_str ());
}
- if (!Config::instance()->mail_password().empty ()) {
- curl_easy_setopt (curl, CURLOPT_PASSWORD, Config::instance()->mail_password().c_str());
+ if (!password.empty ()) {
+ curl_easy_setopt (curl, CURLOPT_PASSWORD, password.c_str());
}
curl_easy_setopt (curl, CURLOPT_MAIL_FROM, _from.c_str());
void add_bcc (std::string bcc);
void add_attachment (boost::filesystem::path file, std::string name, std::string mime_type);
- void send ();
+ void send (std::string server, int port, std::string user = "", std::string password = "");
std::string notes () const {
return _notes;
to.push_back ("carl@dcpomatic.com");
Emailer emailer (_from, to, "DCP-o-matic problem report", body);
- emailer.send ();
+ emailer.send ("main.carlh.net", 2525);
set_progress (1);
set_state (FINISHED_OK);