Email subject MIME encoding in Perl.

前端 未结 2 1216
醉梦人生
醉梦人生 2021-01-24 02:06

I am trying to send an email with non-ASCII characters in the subject line under Perl 5.8.5. My simple example uses the word \"Änderungen\" (German umlaut), but instead of corre

2条回答
  •  被撕碎了的回忆
    2021-01-24 02:12

    In your question, you declared:

    my $subject_encoded = encode("MIME-Q", $subject);
    

    But you didn't use it later.

    print MAIL "Subject: $subject\n\n";
    

    should be:

    print MAIL "Subject: $subject_encoded\n\n";
    

提交回复
热议问题