08/03/10 16:46:11
すみません、下のソースで、sendmailをcloseしたときにエラー($?=256)が返されてしまうのですが、
これはどう対処すべきなのでしょうか…?
#タイトルのエンコード
$subject = encode('iso-2022-jp', $subject); # iso-2022-jpにエンコード
$subject = encode_base64($subject, ''); # Base64にエンコード
$subject = '=?iso-2022-jp?B?' . $subject . '?='; # ヘッダー文字列の追加
# 本文のエンコード
$content = encode('iso-2022-jp', $content); # iso-2022-jpにエンコード
# メール送信
$cnt=<<"EOT";
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=iso-2022-jp
From: $from
To: $to
Subject: $subject
$content
EOT
open MAIL, "| /usr/sbin/sendmail -t" or &err("Cannot open sendmail: $!");
print MAIL $cnt;
close MAIL or &err("Cannot close sendmail: !=$! ?=$?");