Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Send SMS with Twilio 5.x helper library with manually created TwilioRestClient
using System;
using Twilio.Clients;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;
namespace ConsoleApplication32
class Program
static void Main(string[] args)
// Your Account SID from
var accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
// Your Auth Token from
var authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");
var client = new TwilioRestClient(accountSid, authToken);
var message = MessageResource.Create(
to: new PhoneNumber("+15558675309"),
from: new PhoneNumber("+15017250604"),
body: "Hello from C#",
client: client);
Console.Write("Press any key to continue.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.