我使用Codeigniter发送电子邮件,我在视图中创建了html并将其用作消息。将这些设置用于我的配置
$config = Array(
'useragent' => 'GDS GIS',
'protocol' => 'smtp',
'smtp_host' => 'localhost',
'smtp_port' => 25,
'mailtype' => 'html',
'priority' => 1,
'charset' => 'iso-8859-1',
'wordwrap' => TRUE,
'wrapchars' => 70
);
以下是我视图中html代码前几行的示例:
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0" marginwidth="0" marginheight="0" width="100%" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%; height: 100%; -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; line-height: 100%;
background-color: #F0F0F0;
color: #000000;" bgcolor="#F0F0F0" text="#000000">
但是当我使用它来发送电子邮件时,它会将HTML分解为:
<body topmargin=3D"0" rightmargin=3D"0" bottommargin=3D"0" leftmargin=3D"0"=
marginwidth=3D"0" marginheight=3D"0" width=3D"100%" style=3D"border-collap=
se: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%; height=
: 100%; -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -ms-te=
xt-size-adjust: 100%; -webkit-text-size-adjust: 100%; line-height: 100%;
background-color: #F0F0F0;
color: #000000;" bgcolor=3D"#F0F0F0" text=3D"#000000">
在我的测试环境中,我使用smtp4dev,当我在Outlook中预览它时似乎很好。
但是当我在客户端的服务器上安装它时,返回的html就像破坏的那样,一切都是错误的。我尝试将文本包装到较小的数字但没有成功。
有一件事看起来似乎有效,如果我自己打破了这个问题,这个问题就解决了但是我必须经历1000行html并将其分解为更小的块,这不是最好的做法。
我试图从公司发送的电子邮件标题中获取一些信息,可能会有帮助。
Delivered-To: //EMAIL
Received: by 10.107.18.230 with SMTP id 99csp196343ios;
Mon, 10 Oct 2016 19:30:00 -0700 (PDT)
X-Received: by 10.194.106.169 with SMTP id gv9mr1454160wjb.129.1476153000519;
Mon, 10 Oct 2016 19:30:00 -0700 (PDT)
Return-Path: //Sender Email
Received: from smtptc4.repsol.com (smtptc4.repsol.com. [195.53.125.138])
by mx.google.com with ESMTPS id bd4si1616304wjb.242.2016.10.10.19.29.59
for //MY EMAIL
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Mon, 10 Oct 2016 19:30:00 -0700 (PDT)
Received-SPF: pass (google.com: domain of //Sender Email designates 195.53.125.138 as permitted sender) client-ip=195.53.125.138;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of //Sender Email designates 195.53.125.138 as permitted sender) smtp.mailfrom=//Sender Email
X-IronPort-AV: E=Sophos;i="5.31,327,1473112800";
d="xls'32?scan'32,208,217,32";a="119964443"
Received: from unknown (HELO msge-2a-p1n1.tlm.com) ([172.26.224.31])
by sltcapliron02b.repsolypf.com with ESMTP/TLS/AES128-SHA; 11 Oct 2016 04:29:51 +0200
Received: from MSGH-2A-P1N1.tlm.com (10.144.36.90) by msge-2a-p1n1.tlm.com (10.110.1.98) with Microsoft SMTP Server (TLS) id 14.3.266.1; Mon, 10 Oct 2016 20:31:01 -0600
Received: from MSGX-MYCBJ-P1N2.tlm.com (10.105.100.6) by MSGH-2A-P1N1.tlm.com (10.144.36.90) with Microsoft SMTP Server (TLS) id 14.3.266.1; Mon, 10 Oct 2016 20:29:49 -0600
Received: from MSGX-MYCBJ-P1N1.tlm.com ([fe80::b0b6:e222:e7bd:c274]) by MSGX-MYCBJ-P1N2.tlm.com ([::1]) with mapi id 14.03.0195.001; Tue, 11 Oct 2016 10:29:44 +0800
From: //Sender email
To: "Bardia Heshmati //MY EMAIL " //MY EMAIL
Subject:
Thread-Topic: Vessel Backcharging.xls
Thread-Index: AdIjZ1J7nPayUpoXRAWDw15u+jpBYg==
Date: Tue, 11 Oct 2016 02:29:42 +0000
Message-ID: <364E4469C9AFCE4E8D3DDAB7CB8BE65884CA861D@MSGX-MYCBJ-P1N1.tlm.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-originating-ip: [10.123.30.8]
Content-Type: multipart/mixed; boundary="_005_364E4469C9AFCE4E8D3DDAB7CB8BE65884CA861DMSGXMYCBJP1N1tl_"
MIME-Version: 1.0
Return-Path: //Sender Email
有什么建议吗?