2013-03-05 102 views
1

我目前正在开发一个应用程序,通过电子邮件或彩信向用户发送选定的优惠券。我遇到的问题是客户收到MMS时显示MMS。在Android上,图像以视频的形式显示,而在iOS上,信息的一切都是错误的。带CodeIgniter电子邮件类的彩信

这里是正在发送的报头的例子:

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: "[email protected]" 
X-Sender: [email protected] 
X-Mailer: none 
X-Priority: 3 (Normal) 
Message-ID: <[email protected]> 
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('[email protected]'); 
$this->email->to('[email protected]_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 

有谁知道是否有可能使用内置的邮件类来完成这,还是我需要编写特定的标题,使图片信息正确显示?

也有一个适当的消息格式为MMS:文本或HTML?,有没有一种适当的方式来附加图像的iOS查看?

回答

1

尝试使用电子邮件地址(例如@ mms.att.com)从网络发送mms,最终会让您被网络阻止。没有一个干净的方法来解决这个问题,而没有网络或MMS合作伙伴的支持。现在最好的解决方案是发送一条短信到网络上的移动广告链接。

顺便说一下,我建议像cdyne或twilio这样的供应商发短信(不要试图通过电子邮件地址发送短信!),你也可以尝试简单地连接一个3G/4G调制解调器并修改驱动程序以编程方式拍摄短信/彩信。请自行承担风险。