Overview
This guide shows how to 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 .NET development environment.
Create the send MMS application
In Visual Studio, in the CS project, open the file Program.cs
and paste into it this code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;
namespace SdkTestDotnet
{
class Program
{
static void Main(string[] args)
{
var api = new PlivoApi("<auth_id>","<auth_token>");
try
{
var response = api.Message.Create(
src:"<sender_id>",
dst:"<destination_number>",
text:"Hello, from .NET!",
type:"mms",
media_urls: new string[]{"https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif"},
media_ids: new String[]{"801c2056-33ab-499c-80ef-58b574a462a2"}
);
Console.WriteLine(response);
}
catch (PlivoRestException e)
{
Console.WriteLine("Exception: " + e.Message);
}
}
}
}
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.
Test
Save the file and run it.
Haven’t tried Plivo yet? Getting started is easy and only takes minutes. Sign up today.