使用CodeIgniter的电子邮件编码不正确 - php

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center。

7年前关闭。

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

Hej [indtaster_navn]

我为xxxxxx er der behov进行操作,以便进行以下操作:

-xxxx
-xxxx
-xxxx
Jeg vil gerne en tilbage融化了,没有烤箱。

Venlig hilsen
[behandler_navn]
TestGuy

[lokal_tlf]-lokal
00 00 00 00-telefon
[behandler_email]

此S
东西
Transformer 1234
3434 BubbleJ

因此,在发送邮件时,我有以下代码,需要注意的是我使用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('[email protected]'); 
    $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: [email protected]
X-PHP-Originating-Script: 0:Email.php
User-Agent: CodeIgniter
Date: Wed, 7 Nov 2012 00:31:54 +0100
From: <[email protected]>
Return-Path: <[email protected]>
Reply-To: "Johnny Bravo" <[email protected]>
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 1 (Highest)
Message-ID: <[email protected]>
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

参考方案

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

解决了问题!

php:将分钟取整到最近的四分之一小时,然后执行更多操作 - php

最初的问题是这样的:取分钟数->转换为四分之一小时-> 1个四分之一小时为1个单位->输出单位我今天整天都在整理页面,几分钟前我的大脑就停止工作了,我只是不知道如何输出单位数量。我知道在此网站上发布问题会有所帮助。因此,用户输入的分钟数(不是小时和分钟,而是数分钟),站点需要输出单位数量。单位是一个刻钟。分钟总是四舍五入到最近的四分之一小时…

php Singleton类实例将在多个会话中保留吗? - php

举一个简单的例子,如果我想计算一个不使用磁盘存储的脚本的命中次数,我可以使用静态类成员来执行此操作吗?用户1:<?php $test = Example::singleton(); $test->visits++; ?> 用户2:<?php $test = Example::singleton(); $test->visits+…

CodeIgniter:“无法重新声明类” - php

诚然,我的OOPHP有点不稳定,但是我看不出这是怎么回事。在我的一个控制器中,我包括一个utils工作表,该表与该控制器一样,扩展了基本的CI_Controller类。这将引发致命错误:Fatal error: Cannot redeclare class Utils in {file path}\utils.php on line 88 控制器:class…

PHP OOP概念付诸实践 - php

目前,我所拥有的是一份以程序庄园形式编写的审查表。我想更改一些内容,并希望在此过程中,根据过去的经验,在OOP中,网站的整个审核部分会更好。数据流如下:HTML表单=>提交=> jQuery验证=>? => PHP验证=>添加记录我的问题是要了解将POST数据传递给类的正确方法是使用AJAX / jQuery或使用具有标准感谢页…

阻止执行控制器 - php

我有一个在MY_Controller中运行的ACL。如果权限被拒绝,那么目前,我只是执行redirect('denied')-这是一个非常基本的控制器,它加载了一个非常基本的视图,显示“权限被拒绝”。但是,我想做的仍然是加载最初请求的uri,但加载“拒绝”视图而不是默认视图。我可以在MY_Controller中执行此操作,并且拒绝视图加载…