Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Japanese Perl and Sendmail



2004/06/03 (木) 12:15 に Blomberg David さんは書きました:
> :) smile me again after a short break I am back on trying to get
> Japanese text from Perl below is my current relevant portion.  The
> subject line prints correclty but the body does not ----PLEASE tell me I
> am doing something stupid and this is an neasy fix, 

You're doing something stupid and it's an easy fix. 

Feel better now? ;-)

At a glance I'd say try skipping the Mime encoding stuff on the body and
just print it straight out (in ISO-2022-JP encoding).


> if not....any
> ideas??? (keep in mind I dont use Japanese in Perl much and am most
> likely missing something) :)
> 
> ----------------------start program-----------------------------
> #!/usr/bin/perl
> 
> use MIME::Base64;
> 
> my $MAILBIN = "/usr/sbin/sendmail";
> my @example.com = ("-oi", "-tr", "$ENV_FROM");
> $SIG{PIPE} = \&PipeHandler;
> $ENV{PATH} = "/bin:/usr/bin:/sbin:/usr/sbin";
> 
> my $pid = open(MAIL, "|-")||exec("$MAILBIN", @example.com);
> print MAIL "From: admin@example.com";
> print MAIL "To: dblomber\@example.com";
> print MAIL 'Content-Type: text/plain; charset="ISO-2022-JP"' . "\n";
> #$temp = MIME::Base64::encode("?????????");
> #chomp($temp);
> #print MAIL "=?UTF-8?B?$temp?=\n";
> print MAIL "Subject:
> =?ISO-2022-JP?B?GyRCSVRANSVRJTklbyE8JUk+cEpzGyhCCg==?=\n";
> print MAIL "=?ISO-2022-JP?B?GyRCSVRANSVRJTklbyE8JUk+cEpzGyhCCg==?=\n";
> 
> ----------------------------end program--------------------------------
> 
> -- 
> David Blomberg
> AIS, APS, ASE, CCNA, LCP, LCA, Linux+, LPI I, MCP, MCSA, MCSE, RHCE, Server+
> Nihon Libertec
dblomber@example.com
-- 
-dave

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links