Created
September 6, 2013 02:04
-
-
Save sng2c/6458681 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
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