[geary] Add option to send HTML in geary-mailer



commit c6f5ac9a07340ebd29d7499cb3421af9a9c1d303
Author: Robert Schroll <rschroll gmail com>
Date:   Tue May 27 11:39:37 2014 -0400

    Add option to send HTML in geary-mailer

 src/mailer/main.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/mailer/main.vala b/src/mailer/main.vala
index 88320ee..50daab2 100644
--- a/src/mailer/main.vala
+++ b/src/mailer/main.vala
@@ -36,6 +36,13 @@ async void main_async() throws Error {
                 composed_email.body_text = contents;
             }
             
+            if (!Geary.String.is_empty(arg_html)) {
+                string contents;
+                FileUtils.get_contents(arg_html, out contents);
+                
+                composed_email.body_html = contents;
+            }
+            
             msg = new Geary.RFC822.Message.from_composed_email(composed_email, null);
         }
         
@@ -73,6 +80,7 @@ string arg_from;
 string arg_to;
 int arg_count = 1;
 string? arg_file = null;
+string? arg_html = null;
 string? arg_full_file = null;
 const OptionEntry[] options = {
     { "debug",    0,    0,  OptionArg.NONE,     ref arg_debug,  "Output debugging information", null },
@@ -86,6 +94,7 @@ const OptionEntry[] options = {
     { "to",     't',    0,  OptionArg.STRING,   ref arg_to,     "To (recipient)",       "<email>" },
     { "count",  'c',    0,  OptionArg.INT,      ref arg_count,  "Number of emails to send (not applied for 
file-full)", null },
     { "file-body",'i',  0,  OptionArg.STRING,   ref arg_file,   "File to send as body (must be RFC 822 
ready!)", "<filename>"},
+    { "html-body",'m',  0,  OptionArg.STRING,   ref arg_html,   "HTML file to be sent as body", "<filename>" 
},
     { "file-full",0,    0,  OptionArg.STRING,   ref arg_full_file, "File to send as full message (headers 
and body, must be RFC822 ready!, --from and --to ignored)", "<filename>"},
     { null }
 };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]