CodeIgniter SMTP电子邮件 - 用等号替换的字符 [英] CodeIgniter SMTP email message - characters replaced with equal signs

查看:147
本文介绍了CodeIgniter SMTP电子邮件 - 用等号替换的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CodeIgniter电子邮件库使用我们的Exchange服务器发送电子邮件。我得到的问题是电子邮件的内容被弄乱了。

I'm using the CodeIgniter email library to send emails using our Exchange server. The problem I get is that the content of the email gets messed up.

有一些字符被替换为等号=,我尝试了两个不同的Exchange服务器(他们在不同的地方,没有任何关系,所以如此),我仍然得到同样的问题。如果我使用任何其他服务器作为SMTP服务器发送电子邮件,一切正常,内容保持不变,不变。

There are some words that get replaced with equal signs "=", I tried 2 different Exchange servers (they are in different locations and have no relation what so ever) and I still get the same issue. If I use any other server as an SMTP server to send emails everything works fine and the content stays intact and unchanged.

发送前的内容:

Dear Customer

Please find attached a comprehensive explanation of how to get our brochure of Angola. This has been sent to you at the request of Alex.

The information has been taken from www.example.co.uk  "Company name" is one of the leading tile and marble companies in the UK. 

通过Microsoft Exchange发送后的内容:

Content after sending it through the Microsoft Exchange:

Dear Customer

Please find attached a comprehensive explanation of how to get our brochure of A=gola. This has been sent to you at the request of Alex.

The information has been taken from www.example.co.uk  "Company name" is one of the leadi=g tile and marble companies in the UK. 

正如您所看到的,由于某些原因,某些n字符被替换为等号= (例如:安哥拉> A = gola)

As you can see for some reason some of the "n" characters were replaced with equal signs "=" (Example: Angola > A=gola)

我的电子邮件配置:

$this->load->library('email');
$config['charset']      = 'utf-8';
$config['mailtype']     = 'html';


// SMTP
$config['protocol']     = 'smtp';
$config['smtp_host']    = 'exchange.example.com'; //ssl://
$config['smtp_user']    = 'email@example.com';
$config['smtp_pass']    = 'password';
$config['smtp_port']    = 25;

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

$this->email->initialize( $config );

$this->email->clear();

......

$this->email->from( $frome, $fromn );
$this->email->to( $email );

$this->email->subject( $subject );
$this->email->message( $send_message );


$this->email->send();

有谁知道为什么微软的交换行为这样吗?或者有什么样的设置我应该使用

Does anyone know why is the Microsoft exchange behaving this way? or is there some sort of setting I should use?

推荐答案

这很奇怪,特别是因为不是所有的 n s是音译的,不在特定的位置。

That's odd, specially since not all the ns are transliterated and not at a specific position.

尝试调用 $ this-> email-> set_crlf(\r\\\
);
。查看Exchange中的邮件详细信息,并检查内容类型和Charset / Encoding - 将原始邮件发送到此处,以便我们检查。

Try calling $this->email->set_crlf( "\r\n" ); as well. Look up the message details in Exchange and inspect the Content-Type and Charset / Encoding - post the raw thing here so we can inspect it.

我在 Microsoft知识库中发现这一点:


Microsoft Exchange使用增强字符集。 Microsoft Exchange的默认MIME
字符集是ISO 8859-1。一些网关做
不支持这个字符集发行线
的软返回的方式。当这种情况发生时,每行都以等号
终止,显示网关的线路长度支持结束的换行符。

Microsoft Exchange uses an enhanced character set. The default MIME character set for Microsoft Exchange is ISO 8859-1. Some gateways do not support the way this character set issues a soft return for line feeds. When this occurs, each line is terminated with an equal sign showing the line break where the gateway's line-length support ends.

这篇关于CodeIgniter SMTP电子邮件 - 用等号替换的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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