Skip to content

Instantly share code, notes, and snippets.

@punytan
Created January 30, 2011 05:51
Show Gist options
  • Save punytan/802596 to your computer and use it in GitHub Desktop.
Save punytan/802596 to your computer and use it in GitHub Desktop.
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