“=?utf-8?Q”抓取电子邮件时附加 [英] "=?utf-8?Q?" appended while fetching emails

查看:1729
本文介绍了“=?utf-8?Q”抓取电子邮件时附加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用codeigniter电子邮件库发送电子邮件,并使用imap函数获取它们。发送电子邮件时,我已经编写了codeigniter内置电子邮件图书馆:

I am sending emails using codeigniter email library and fetching them using imap function. While sending the email, I have edited the codeigniter inbuilt Email library as:

$mailtype       = "html";

我创建了一个文本框,询问电子邮件主题,并使用富文本编辑器输入消息。
我的邮件正在成功发送,我可以使用Imap获取我的电子邮件。但问题是,当我发送电子邮件给自己和获取它,主题文本包含字母=?utf-8?Q?之前和?=之后。虽然邮件主题在我的原始邮箱中是正确的。我知道这是由于mailtype = html,因为当我使用

I have created a textbox which asks for the subject of email and I am using a rich text editor for typing the message. My mails are being sent successfully and I am able to fetch my emails using Imap. But the problem is that when I am sending the email to myself and fetching it, the subject text contains letters "=?utf-8?Q?" before and "?=" after.Although the mail subject is correct in my original mailbox. I know this is due to mailtype=html, because when I send the email using the

$mailtype       = "text";

邮件有正确的主题。但我想发送电子邮件为html,因为富文本编辑器包含html标签。我需要关于主题的帮助。提前感谢。

the mails have the correct subject.But I want to send the mails as html because the rich text editor contains html tags. I need help regarding the subject thing. Thanks in advance.

推荐答案

为什么要对主题使用富文本编辑器。因为,主题不会以粗体,itaclics,blah,blah等显示。它将只显示为任何电子邮件客户端的正常文本。

Why you are using rich text editor for the subject thing. Because, the subject is not going to show in bold, itaclics, blah, blah, etc.. Its will only show as normal text in any email clients.

如果您正在寻找邮件正文作为html,我认为你不需要破解的核心文件。您可以使用set_mailtype()函数设置它。

If you are looking for the message body as html, i think you don't need to hack the core files. you can set it using set_mailtype() function.

$this->load->library('email');
$this->email->clear(TRUE);

$this->email->set_mailtype("html"); // Set the email type as 'html'

$this->email->from('your@email.com', 'Your Name');
$this->email->to('to@email.com');
$this->email->subject('Your email subject');
$this->email->message('Your email message including <b>Bold</b> html tags');
$this->email->send();

这篇关于“=?utf-8?Q”抓取电子邮件时附加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆