我目前正在开发一个应用程序,该应用程序将通过电子邮件或彩信向用户发送选定的优惠券。我遇到的问题是客户收到彩信时的显示。在 Android 上,图像显示为视频,而在 iOS 上,消息的所有内容都是错误的。
这是正在发送的标头的示例:
User-Agent: none
Date: Tue, 5 Mar 2013 10:45:12 -0500
From:
Return-Path:
Subject: =?utf-8?Q?Your_Requested_Coupon?=
To: ##########@txt.att.net
Reply-To: "webadministrator@domain.com"
X-Sender: webadministrator@domain.com
X-Mailer: none
X-Priority: 3 (Normal)
Message-ID: <51361308f1651@domain.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="B_ATC_51361309002f2"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ATC_51361309002f2
Content-Type: multipart/alternative; boundary="B_ALT_51361308f3595"
--B_ALT_51361308f3595
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
--B_ALT_51361308f3595
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
--B_ALT_51361308f3595--
--B_ATC_51361309002f2
Content-type: image/jpeg; name="promo3.jpg"
Content-Disposition: attachment;
Content-Transfer-Encoding: base64
....
IMAGE ENCODING HERE
....
--B_ATC_51361309002f2--
和 CI 代码:
$this->email->from('webadministrator@domain.com');
$this->email->to('XXXXXXXXXX@PHONE_MESSAGE_CENTER.COM');
$this->email->subject('Your Requested Coupon');
$this->email->message($this->load->view('sms_email', '', TRUE));
$this->email->attach('/path/to/image.jpg'); //I've also tried passing a second param 'inline' to change the Content-Disposition to inline
有谁知道是否可以使用内置的电子邮件类来完成此操作,还是我需要编写特定的标题才能正确显示图片消息?
彩信是否有适当的消息格式:文本或 html?,是否有适当的方法附加图像供 iOS 查看?