- 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 (job);
+ email.add_attachment (zip_file, name_format.get(name_values) + ".zip", "application/zip");
+
+ Config* c = Config::instance ();
+
+ try {
+ email.send (c->mail_server(), c->mail_port(), c->mail_user(), c->mail_password());
+ } catch (...) {
+ if (log) {
+ log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
+ log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
+ log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
+ log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
+ }
+ throw;
+ }