我的电子邮件有问题,html 没问题,但是当我打开它们时,文本中有错误,链接中的一些字符变成了 = like

Thanks for joining . your log=n details are here ma=e sure you keep them safe.
To verify your email address, please follow this link:

 Finish your registration...

Link doesn't work? Copy the following link to your browser address bar:  http://www.myurl.com/dev=l/panel/auth/activate/123131/123131

Please verify your email within 123131 hours, otherwise your registration =ill become invalid and you will have to register again.

每个图像和链接甚至文本都被破坏了
我认为它与 {unwrap} 有关,但没有帮助

这是 config/email.php
$config['email_notification']['protocol'] = 'smtp';
$config['email_notification']['smtp_host'] = 'smtp.live.com';
$config['email_notification']['smtp_user'] = 'xxxxx';
$config['email_notification']['smtp_pass'] = 'xxxxxxx';
$config['email_notification']['smtp_port'] = '587';
$config['email_notification']['mailtype'] = 'html';
$config['email_notification']['charset'] = 'utf-8';
$config['email_notification']['wordwrap'] = false;
$config['email_notification']['smtp_crypto'] = 'tls';

这是 Controller
 $this->load->library('email');



    $this->email->initialize($this->config->item('email_notification'));
    $this->email->subject('Email Test');

    $this->email->set_newline("\r\n");
    $this->email->from('xxxxxx'); // change it to yours
    $this->email->to('xxxxx');
    $this->email->subject('Email Test');

    $data=array(
        'site_name'=>'tralalalal',
        'user_id'=>'123131',
        'new_email_key'=>'123131',
        'activation_period'=>'123131',
        'email'=>'123131',
        'title'=>'123131',

    );
    $this->email->message($this->load->view('email/activate_account/en',$data,true));

电子邮件正文是
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
    /* Client-specific Styles */
#outlook a{padding:0;} /* Force Outlook to provide a "view in browser" button. */
body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */
body{-webkit-text-size-adjust:none;} /* Prevent Webkit platforms from changing default text sizes. */

    /* Reset Styles */
body{margin:0; padding:0;}
img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;}
table td{border-collapse:collapse;}
#backgroundTable{height:100% !important; margin:0; padding:0; width:100% !important;}
</style>
</head>
<body>

谢谢

最佳答案

我找到了答案,所以如果有人有同样的问题

这是为什么



这是您更改代码以覆盖此限制的地方
系统/库/email.php

原版

protected function _prep_quoted_printable($str, $charlim = '')
{
    // Set the character limit
    // Don't allow over 76, as that will make servers and MUAs barf
    // all over quoted-printable data
    if ($charlim == '' OR $charlim > '76')
    {
        $charlim = '76';
    }

快速解决 :)
protected function _prep_quoted_printable($str, $charlim = '')
{
    // Set the character limit
    // Don't allow over 76, as that will make servers and MUAs barf
    // all over quoted-printable data
    if ($charlim == '' OR $charlim > '76')
    {
        $charlim = '200';
    }

关于php - codeigniter html电子邮件更改字符,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14916834/

10-16 14:55