O'Reilly logo

Twilio Cookbook Second Edition by Roger Stringer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sending picture messages from a website

Sending picture messages to phones is handy. Allowing people to send a photo from a website can be great for the purpose of sharing and getting the message out about on-going events and sales deals.

Sending these MMS messages works similar to SMS messages. The key difference is that we include a URL to our image files.

The new URL field is named MediaUrl, which may sound familiar because we look for a similar field when we receive our messages.

We're going to use the TwilioMMS class to send our MMS message with an image as shown in the following code snippet:

<?php class TwilioMMS{ public $sid; public $token; public function __construct($sid,$token){ $this->sid = $sid; $this->token = $token; } public function ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required