0

I am currently trying to send a MMS message to a cell phone (via a MMS gateway address) with a PHP script using the mail() function. I want to include a picture in the message.

I haven't found any information specific to sending MMS messages with PHP, and the information that I have found that dealt with sending email attachments was split, with some advising that I use an external package such as Mail_Mime. What would be the best way to send a picture message to a cell phone with a PHP script?

Any help would be greatly appreciated.

smf7293
  • 55
  • 3
  • 9
  • Are you sure the MMS protocol is a subset of the mail trainsfer protocol? Or that the MMS gateway accepts receival of emails and converts them into MMS protocol for you? – Mihai Stancu Jun 23 '12 at 22:47
  • Yes, if you send a message from an e-mail address to a cell phone mms gateway, then it gets delivered as a picture message (if that answers your question) – smf7293 Jun 23 '12 at 22:48

2 Answers2

1

If your carrier supports receiving email messages and forward them to the handset as MMS, then simply sending an email with MIME image attachment is sufficient.

However, if you're dealing with an MMS centre (MMSC), then industry standard protocol for application<->MMSC is MM7

Community
  • 1
  • 1
poncha
  • 7,726
  • 2
  • 34
  • 38
1

Ricky from Twilio here.

I know this is an old question, but for anyone landing here that's looking to accomplish this you can send MMS using our PHP helper library:

<?php

// this line loads the library 
require('/path/to/twilio-php/Services/Twilio.php'); 

$account_sid = '[AccountSid]'; 
$auth_token = '[AuthToken]'; 
$client = new Services_Twilio($account_sid, $auth_token); 

$client->account->messages->create(array( 
    'To' => "+16518675309", 
    'From' => "+14158141829", 
    'Body' => "Hey Jenny! Good luck on the bar exam!", 
    'MediaUrl' => "http://farm2.static.flickr.com/1075/1404618563_3ed9a44a3a.jpg",  
));

You can find a few more examples in our API docs. Hope that helps!

rickyrobinett
  • 1,224
  • 10
  • 13
  • Can you clarify what the max upload size is for a video? In the docs is states `Total message size must be under 5MB. An API request with media or collection of media larger than 5MB will fail with an error.`. I'm getting an error in my twilio debugger that states `Retrieved content exceeded the maximum allowed content size.` with a selected solution of `Verify that the specified media is less than 500 KB`. The video I'm attempting to send is about 2MB. Any info would be appreciated, thank you! – domdambrogia May 29 '17 at 23:02