aboutsummaryrefslogtreecommitdiffstats
path: root/fripost-adduser
diff options
context:
space:
mode:
authorStefan Kangas <skangas@skangas.se>2011-03-14 14:57:50 +0100
committerStefan Kangas <skangas@skangas.se>2011-03-14 14:57:50 +0100
commit53bb0cb56f580b7115b874fe40d9011efe6dd8ed (patch)
tree80902e0a56d4c75ea9ab6e3234c7a428ce93bf13 /fripost-adduser
parent721873346737865ccc79e531570782eb56df18b6 (diff)
Fix encoding of welcome message
Diffstat (limited to 'fripost-adduser')
-rwxr-xr-xfripost-adduser15
1 files changed, 12 insertions, 3 deletions
diff --git a/fripost-adduser b/fripost-adduser
index 73ff70b..192a691 100755
--- a/fripost-adduser
+++ b/fripost-adduser
@@ -16,13 +16,16 @@ use FindBin qw($Bin);
use lib "$Bin/lib";
use Data::Dumper;
+use Encode qw(encode);
use File::Slurp qw(slurp);
use Fripost::Password;
use Fripost::Prompt;
use Fripost::Schema;
-use IO::Prompt;
use Getopt::Long;
+use IO::Prompt;
+use MIME::Base64;
use MIME::Lite;
+use MIME::QuotedPrint;
use YAML::Syck;
# Prompt for user info
@@ -86,14 +89,20 @@ say "New account $user->{username} added.";
## Send email
my $msg = MIME::Lite->new(
From => 'admin@fripost.org',
- To => $user->{username},
- Subject => 'Välkommen till Fripost!',
+ To => 'test@example.com',
+ Subject => "=?UTF-8?B?" .
+ encode_base64(encode("utf8", 'Välkommen till Fripost!'), "") . "?=",
Data => scalar slurp('templ/new_user_mail.tt'), # TODO: actually use TT
+ Encoding => 'quoted-printable',
);
+
+$msg->attr('content-type.charset' => 'utf-8');
$msg->send();
say "Sent welcome message: ";
say $msg->as_string;
+#say decode_qp($msg->as_string);
+
=head1 AUTHOR