Subject: | Impossible to send text emails in other than us-ascii charset |
Email::Stuff always sends text as the us-ascii charset.
There are ways of overriding the attributes in the text_body method,
however when the Email::Mime chunks are stitched together the outermost
chunk has default attribute settings which set the charset to us-ascii.
For example see this sample code:-
#!/usr/bin/perl
use strict;
use warnings;
use Email::Stuff;
use Data::Dump qw(dump);
my $ea =
Email::Stuff->from('y@z.com')->subject('hello')->to('x@y.com')
->using( SMTP => '127.0.0.1' )->text_body(
'Hello mum',
'content_type' => 'text/plain',
'charset' => 'utf-8',
'content_transfer_encoding' => '8bit',
'charset' => 'utf-8',
);
#print dump($ea);
print $ea->as_string, "\n";
-----------------
which gives
Date: Mon, 28 May 2007 15:55:46 +0100
MIME-Version: 1.0
from: y@z.com
subject: hello
to: x@y.com
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"
Hello mum
----------------
dumping the object shows that the us-ascii uis tagged on the container
object.
This could be considered a bug in the underlying modules I guess... for
now I am looking at just adding attribute params to the new method.