handy dandy message generator
Chris Nehren [Sun, 4 Sep 2011 02:42:30 +0000 (22:42 -0400)]
script/make_message [new file with mode: 0644]

diff --git a/script/make_message b/script/make_message
new file mode 100644 (file)
index 0000000..aa4d20d
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use Email::MIME;
+use File::Slurp 'read_file';
+
+my ($from, $to, $subject) = @ARGV;
+my $body = read_file \*STDIN;
+
+
+my $email = Email::MIME->create(
+  header => [
+    From => $from,
+    To   => $to,
+    Subject => $subject,
+  ],
+  body => $body,
+);
+print $email->as_string;