Skip to content

Instantly share code, notes, and snippets.

@sng2c
Created September 6, 2013 02:04
Show Gist options
  • Save sng2c/6458681 to your computer and use it in GitHub Desktop.
Save sng2c/6458681 to your computer and use it in GitHub Desktop.
한글로 메일 보내기
package KorMailSend;
use strict;
use warnings;
use MIME::Lite;
use MIME::Base64;
use Encode qw(encode);
sub sendmail{
my ($from,$to,$subj,$cont) = @_;
my $subj2 = '=?UTF8?B?' . encode_base64($subj) .'?=';
my $msg = MIME::Lite->new(
From => $from,
To => $to,
Subject => $subj2,
Charset => 'utf-8',
Encoding=> '8bit',
Data => $cont,
);
$msg->attr('content-type' => 'text/html');
$msg->attr('content-type.charset' => 'UTF-8');
return $msg->send;
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment