Created
January 30, 2011 05:51
-
-
Save punytan/802596 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use utf8; | |
use Encode; | |
use Email::MIME::Creator; | |
use Email::Sender::Simple qw/sendmail/; | |
sub send { | |
my $email = shift; | |
my $body = '文字列'; | |
my $mail = Email::MIME->create( | |
header => [ | |
From => '[email protected]', | |
To => $email, | |
Subject => encode('MIME-Header', 'いろはにほへと'), | |
], | |
attributes => { | |
content_type => 'text/plain', | |
charset => 'utf8', | |
encoding => '8bit', | |
}, | |
body_str => $body, | |
); | |
sendmail($mail, {from => '[email protected]'}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment