3

现在数据库中的数据如下所示:

Hej [indtaster_navn]<br><br>我禁止 med noget på ændring af xxxxxx er der behov for opfølgning på:<br><br>- xxxx<br>- xxxx<br>- xxxx<br><br>Jeg vil gerne have en tilbagemelding, når du har set på ovenstående.<br/><br/>Venlig hilsen<br/>[behandler_navn]<br/>TestGuy<br/><br/>[lokal_tlf] - lokal<br >00 00 00 00 - 电话<br>[behandler_email]<br><br>这个 S<br>东西<br>变形金刚 1234<br>3434 BubbleJ<br><br>​​​​​</p>

所以我在发送邮件时有以下代码,重要的是要注意我使用html_entity_decode

    $config['mailtype'] = 'html';
    $config['priority'] = 1;
    $config['charset'] = 'utf-8';
    $this->email->initialize($config);
    $this->email->from($this->auth_data->user_email, $this->auth_data->user_firstname . ' ' . $this->auth_data->user_lastname);
    $this->email->reply_to($this->auth_data->user_email, $this->auth_data->user_firstname . ' ' . $this->auth_data->user_lastname);
    $this->email->to('test@test.com'); 
    $this->email->subject($feedback_title_temp);
    $this->email->message(html_entity_decode($feedback_temp));  
    $this->email->send();

=当我收到电子邮件时,它会随机插入符号,在某些情况下<br>甚至不会发生。

例如:

- xxxx<=r>- xxxx

应该:

- xxxx
- xxxx

当我在智能手机上查看电子邮件时,编码问题似乎只出现在æåø字符上,而 Outlook 则完全不同。

收到的邮件标题::

**Microsoft Mail Internet Headers Version 2.0
Subject: =?utf-8?Q?(ID:_418)?=
To: some@one.com
X-PHP-Originating-Script: 0:Email.php
User-Agent: CodeIgniter
Date: Wed, 7 Nov 2012 00:31:54 +0100
From: <mat@damn.com>
Return-Path: <mat@damn.com>
Reply-To: "Johnny Bravo" <mat@damn.com>
X-Sender: damn@test.com
X-Mailer: CodeIgniter
X-Priority: 1 (Highest)
Message-ID: <50999deab797d@test.com>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_50999deab798e"
X-OriginalArrivalTime: 06 Nov 2012 23:31:54.0823 (UTC) FILETIME=[E8022570:01CDBC76]

--B_ALT_50999deab798e
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

--B_ALT_50999deab798e
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable


--B_ALT_50999deab798e--
**

收到的邮件,根据内容不同,但错误很明显:

Det her er en m=sse tekst, det er bare en test fra en hæææst.


- Hehe
- Heh<=br>
- Wee


A=l these things

- Lots of text
4

1 回答 1

10
$this->email->set_crlf( "\r\n" );

修复了问题!

于 2012-11-08T17:34:52.933 回答