You can send an MMS message to any phone number. Businesses can make messages more meaningful by using MMS instead of SMS and including images, audio, and video to provide context. Here’s how to use Plivo’s SMS APIs to send outbound MMS text messages.
How it works
Prerequisites
To get started, you need a Plivo account — sign up with your work email address if you don’t have one already. If this is your first time using Plivo APIs, follow our instructions to set up a Java development environment.
Create the send MMS application
Once you have the above prerequisites set, You can follow the below instructions to create an app to send an outbound MMS to deliver your message.
Create a Java class called SendMMS and paste into it this code.
Replace the auth placeholders with your authentication credentials from the Plivo console. Replace the phone number placeholders with actual phone numbers in E.164 format (for example, +12025551234). In countries other than the US and Canada you can use a sender ID for the message source. You must have a Plivo phone number to send messages to the US or Canada; you can buy a Plivo number from Phone Numbers > Buy Numbers on the Plivo console or via the Numbers API.
Note: We recommend that you store your credentials in the auth_id and auth_token environment variables to avoid the possibility of accidentally committing them to source control. If you do this, you can initialize the client with no arguments and Plivo will automatically fetch the values from the environment variables. You can use System.getenv() to store and retrieve environment variables when initializing the client.
Test
Save the file and run it.
Note: If you’re using a Plivo Trial account, you can make calls only to phone numbers that have been verified with Plivo. You can verify (sandbox) a number by going to the console’s Phone Numbers > Sandbox Numbers page.
Haven’t tried Plivo yet? Getting started is easy and only takes minutes. Sign up today.