Tadashi Okoshi
slash****@users*****
2005年 11月 18日 (金) 19:59:46 JST
Index: affelio/lib/Affelio/NetLib/Email.pm
diff -u affelio/lib/Affelio/NetLib/Email.pm:1.5 affelio/lib/Affelio/NetLib/Email.pm:1.6
--- affelio/lib/Affelio/NetLib/Email.pm:1.5 Fri Jul 1 11:00:09 2005
+++ affelio/lib/Affelio/NetLib/Email.pm Fri Nov 18 19:59:46 2005
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# $Id: Email.pm,v 1.5 2005/07/01 02:00:09 slash5234 Exp $
+# $Id: Email.pm,v 1.6 2005/11/18 10:59:46 slash5234 Exp $
package Affelio::NetLib::Email;
{
@@ -22,6 +22,7 @@
use lib("../../../extlib");
use Exporter;
use Jcode;
+ use MIME::Base64::Perl;
use lib("../../../lib");
use Affelio::misc::Debug;
@Affelio::NetLib::Email::ISA = "Exporter";
@@ -34,16 +35,23 @@
my $af = shift;
my $from = shift;
my $to = shift;
- my $title = shift;
+ my $subject = shift;
my $body = shift;
+ my $eol = "";
+ my $subject_b = MIME::Base64::Perl::encode_base64($subject, $eol);
+ $subject_b = "=?utf-8?B?" . $subject_b . "?=";
+ my $headers = "From:$from\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: base64\n";
+ my $body_b = MIME::Base64::Perl::encode_base64($body);
+
###########################################
Affelio::misc::Debug::debug_print("send_mail_ack: $af->{cmd__sendmail} -t\n");
#Sendmail
- open(MAIL, " | $af->{cmd__sendmail} -t ");
+ open(MAIL, " | $af->{cmd__sendmail} -tf $from ");
+ print MAIL $headers;
print MAIL "To: $to\n";
print MAIL "From: $from\n";
- print MAIL "Subject: $title\n\n";
+ print MAIL "Subject: $subject_b\n\n";
print MAIL "$body\n";
print MAIL "\n";
close(MAIL);