【问题标题】:Message string messed up when sending email with Codeigniter email class使用 Codeigniter 电子邮件类发送电子邮件时消息字符串混乱
【发布时间】:2012-07-04 14:25:32
【问题描述】:

所以我在编写使用 Codeigniter 的电子邮件类发送电子邮件的脚本时遇到了问题。我这样设置配置:

    $config['protocol'] = 'mail';
    $config['charset'] = 'iso-8859-1';
    $config['wordwrap'] = FALSE;
    $config['mailtype']= "html";

电子邮件已成功发送,但当我打开电子邮件时(电子邮件客户端是使用 iso-8859-1 字符集的 webmail 客户端),我的一些文字搞砸了。

这是我想要的电子邮件:

Thank you for registering a UMall account. Here's the details of your account:
Email: su-mie@ntu.edu.sg
Pass: 1234567
Fullname: Reinardus Surya Pradhitya
Phone: 83612737
Click here to activate your account: http://su.ntu.edu.sg/umall/index.php/register/activate/3a228e96124a66f1070361e0961854d5

它是这样出现的:

Thank you for registering a UMall account. Here's the details of your accou= nt:
Email: su-mie@ntu.edu.sg
Pass: 1234567
Full= name: Reinardus Surya Pradhitya
Phone: 83612737
Click here= to activate your account: http://su.ntu.edu.sg/um= all/index.php/register/activate/3a228e96124a66f1070361e0961854d5

错误字符始终是“=”。等号后跟一个空格。有谁知道怎么回事?

有趣的是,我尝试在手机的另一个电子邮件客户端中打开它,它看起来不错。

编辑:我认为问题在于自动换行。我无法覆盖该设置,也无法使用 {unwrap}{/unwrap}。如何解决?

【问题讨论】:

  • 为什么不能你使用{unwrap}或覆盖设置?你试过了吗?

标签: php codeigniter character-encoding html-email iso-8859-1


【解决方案1】:

我遇到了同样的问题,“@Alix Axel”帮助解决了它。

看到这个帖子:CodeIgniter SMTP email message - characters replaced with equal signs

它涵盖了您需要的配置。

【讨论】:

    【解决方案2】:

    尝试将字符集更改为 utf-8。

    $config['protocol'] = 'mail';
    $config['charset'] = 'utf-8';
    $config['wordwrap'] = FALSE;
    $config['mailtype']= "html";
    

    【讨论】:

      猜你喜欢
      • 2017-12-07
      • 1970-01-01
      • 2012-12-29
      • 1970-01-01
      • 2013-01-07
      • 2019-08-07
      • 1970-01-01
      • 2012-03-22
      • 1970-01-01
      相关资源
      最近更新 更多