You are here: Help Needed with Cell Phone MMS Protocol « PHP Language « IT news, forums, messages
Help Needed with Cell Phone MMS Protocol

Posted by ralphNOSPAM on 09/21/05 02:46

I'm trying to write a php script to send a .jpg image to my MMS cell
phone but need some help. I can get the MMS message to arrive at my
phone but when I open up the message there is no image - it's empty!!

Here is my code:

$boundary = '----=' . md5( uniqid ( rand() ) );
$theFile = "radar.jpg";
$message .= "Content-Type: image/pjpeg; name=\"$theFile\"\n";
$message .= "Content-Transfer-Encoding: base64\n";
$message .= "Content-Disposition: inline; filename=\"$theFile\"\n\n";

$path = "/home/public_html/radar.jpg";
$fp = fopen($path, 'r');
do //we loop until there is no data left
{
$data = fread($fp, 1024);
if (strlen($data) == 0) break;
$content .= $data;
} while (true);

$content_encode = chunk_split(base64_encode($content));
$message .= $content_encode . "\n";
$message .= "--" . $boundary . "\n";

$headers = "From: cellphone@mydomain.com\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"";
mail($myMMSaddress, "MMS Image Test", $message, $headers);

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация