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

查看:188
本文介绍了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.

有一些字被替换为等号=,我试过2个不同的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?

推荐答案

这很奇怪,特别是因为不是所有的

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

尝试拨打 $ this-> email-> set_crlf(\r\\\
);
。在Exchange中查找消息详细信息,并检查 Content-Type 和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。一些网关做
不支持这个字符集发出一个软回报的线
feed。当这种情况发生时,每一行以等号
结束,表示网关的行长度支持结束的换行符。

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天全站免登陆