【问题标题】:Perl - Mail::Sendmail encoding issuePerl - Mail::Sendmail 编码问题
【发布时间】:2012-01-17 11:22:35
【问题描述】:

我正在尝试发送包含一些非 ascii 字符(例如 ΓÇô)的邮件

Mail::Sendmail 失败并出现错误“C:/Perl64/site/lib/Mail/Sendmail.pm 第 237 行的子例程条目中的宽字符”

有什么想法吗?

【问题讨论】:

    标签: perl email encoding ascii sendmail


    【解决方案1】:

    a nice article 在 PerlMonks 解决这个问题。简而言之,您需要对发送的数据进行编码。上述文章中的一个例子:

    use Encode;
    
    my $bytes = encode('utf8', $input);
    email( {
      ...
      charset => 'utf8',
      _text => $bytes,
    }) ...
    

    【讨论】:

      猜你喜欢
      • 2020-12-21
      • 2012-12-08
      • 1970-01-01
      • 1970-01-01
      • 2014-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-30
      相关资源
      最近更新 更多