Remove unnecessary Film variable in ContentPart.
[dcpomatic.git] / src / lib / emailer.cc
index c7f1b9053fc2f8bc2c6298620488a2491dd47ea7..dfc654396ad84500355dab194177da0d4bfe27ce 100644 (file)
@@ -18,7 +18,6 @@
 */
 
 #include "compose.hpp"
-#include "data.h"
 #include "config.h"
 #include "emailer.h"
 #include "exceptions.h"
@@ -35,6 +34,7 @@ using std::list;
 using std::cout;
 using std::pair;
 using boost::shared_ptr;
+using dcp::Data;
 
 Emailer::Emailer (string from, list<string> to, string subject, string body)
        : _from (from)
@@ -44,6 +44,7 @@ Emailer::Emailer (string from, list<string> to, string subject, string body)
        , _offset (0)
 {
        boost::algorithm::replace_all (_body, "\n", "\r\n");
+       boost::algorithm::replace_all (_body, "\0", " ");
 }
 
 void
@@ -108,11 +109,11 @@ Emailer::send (string server, int port, string user, string password)
              << "From: " << _from << "\r\n";
 
        if (!_cc.empty ()) {
-               email << "Cc: " << address_list (_cc);
+               email << "Cc: " << address_list (_cc) << "\r\n";
        }
 
        if (!_bcc.empty ()) {
-               email << "Bcc: " << address_list (_bcc);
+               email << "Bcc: " << address_list (_bcc) << "\r\n";
        }
 
        string const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";