Email subject MIME encoding in Perl.

…衆ロ難τιáo~ 提交于 2019-12-02 02:56:10

Your editor treats the file as UTF-8, so it shows

my $subject = "Änderungen";

Perl effectively treats the file as iso-8859-1, so it sees

my $subject = "Ã?nderungen";

Tell Perl you encoded your script using UTF-8 by adding

use utf8;

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";
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!