perl

メールの送信

sub send { my ($from, $to, $subject, $body) = @_; my $data; $data = "From:$from\n"; $data .= "To:$to\n"; $data .= "Subject:$subject\n"; $data .= "Return-Path: <$from>\n"; $data .= "Content-Transfer-Encoding: 7bit\n"; $data .= "Content-Type…

メールを取り込んで、MIMEエンコードされたSubjectを直して表示

$strには、Subject行が入っているとして、 use Jcode; my $jconv=Jcode->new($str); my $decoded=$jconv->mime_decode->euc; で$decodedにeucの文字列に変換されて出てきます。 てっとりばやく my $decoded = Jcode->new($str)->mime_decode->euc; 逆の場合 …