Codeigniter从HTML电子邮件中删除字符

Noo*_*zai 4 html php email codeigniter

我开发了一个CMS,当用户忘记他/她的密码/系统将生成一个新的随机密码并通过电子邮件发送给用户但是当我打开电子邮件时它会自动从我的电子邮件正文中删除一些字符替换它们(= ).

这是发送后的电子邮件,您可以用粗体看到混乱的部分

亲爱的努尔Shirzai这封电子邮件是SE = T到你为了通知您,您的密码已被= N复位.Bellow是您的新密码:您的用户名是:mohib您的新Pas =单词是:IOODiGhcYYrL请在登录系统后立即更改您的<= trong>新密码以避免任何安全问题.

注意:当我使用Pure PHP邮件功能发送它时,它工作正常.

bellow是我的电子邮件功能和电子邮件配置文件代码:

我将非常感谢我得到的任何帮助.谢谢

我发送邮件的功能:

if (! function_exists('send_password'))
{
    function send_password($user_info, $password)
    {
        $CI =& get_instance();

        $username           = $user_info['username'];
        $name               = $user_info['firstname'].' '.$user_info['lastname'];
        $email              = $user_info['email'];

        $subject            = 'Your New Password : Noor CMS |'.$CI->config->item('site_name');
        //email body
        $message            = '';

        $message            .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
        $message            .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
        $message            .= '<meta content="text/html; charset=utf-8" http-equiv="Content-type">';
        $message            .= '<head>';
        $message            .= '<title> Your New Password : Noor CMS | '.$CI->config->item('site_name').' </title>';
        $message            .= '</head>';
        $message            .= '<body>';
        $message            .= 'Dear '.trim($name);
        $message            .= 'This Email was sent to you in order to inform you that your <strong>Password</strong> has been reset.<br/>';
        $message            .= 'Bellow is your <strong> New Password :</strong><br/>';
        $message            .= 'Your <strong>Username </strong>is : <strong> '.trim($username).'</strong><br/>';
        $message            .= 'Your <strong>New Password </strong>is : <strong> '.trim($password).'</strong><br/>';
        $message            .= 'Please change your <strong>New Password</strong> as soon as you login to the system in order to avoid any security issues.<br/>';
        $message            .= '</body></html>';

        //prepare email and send
        $CI->email->from($CI->config->item('admin_email'), $CI->config->item('admin_name'));
        $CI->email->to($email);
        $CI->email->subject($subject);
        $CI->email->message($message);

        if ($CI->email->send())
        {
            return TRUE;
        }

        return FALSE;
    }
}
Run Code Online (Sandbox Code Playgroud)

而email.php配置文件如下:

$config['useragent']            = 'NoorCMS';
$config['protocol']         = 'mail';
$config['mailpath']         = '/usr/sbin/sendmail';
$config['smtp_host']            = '';
$config['smtp_user']            = '';
$config['smtp_pass']            = '';
$config['smtp_port']            = 25;
$config['smtp_timeout']         = 10;
$config['wordwrap']         = FALSE;
$config['wrapchars']            = 100;
$config['mailtype']         = 'html';
$config['send_multipart']       = FALSE;
$config['charset']          = 'utf-8';
$config['validate']         = FALSE;
$config['priority']         = 1;
$config['crlf']             = '\n';
$config['newline']          = '\n';
$config['bcc_batch_mode']   = FALSE;
$config['bcc_batch_size']       = 200;
Run Code Online (Sandbox Code Playgroud)

小智 7

我有这个问题 - 您需要更新您的电子邮件配置:

$config['newline']  = "\r\n";
$config['crlf'] = "\r\n";
Run Code Online (Sandbox Code Playgroud)