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

Receiving MMS messages

First, let's learn how to receive picture messages. This is similar to how we receive text messages; the only difference is that picture messages using MMS also include a field named MediaUrl , which contains the URL that was attached to the message.

We will begin by setting up a file named listener.php, which is where we will configure Twilio to send our messages. This script will store all incoming messages in a MySQL database and download the attached image locally. Then we will set up a file named messages.php, which will display the message along with the image.

Getting ready

The complete code for this recipe can be found in the Code/Recipe1/ folder.

How to do it…

Let's set up our listener.php file to store all incoming ...

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