2013-03-05 101 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調制解調器並修改驅動程序以編程方式拍攝短信/彩信。請自行承擔風險。