ASP.NET: Send SMS using asp.net MVC using Red Oxygen

Standard

Sending SMS from asp.net mvc application using Red Oxygen service is pretty easy.

Benefits

  • Reach people near-instantly, wherever they’re at
  • Send SMS to specific individuals or entire lists
  • Save time & money, compared with phone calls
  • Schedule SMS to automatically send at a specified time
  • Send urgent alerts with just the click of a button
  • Easily reach people all over the world

Get Free Trial Account:

  • Fill form at Sign up for free
  • Trial Account Specifics:
    1. Includes 25 SMS credits
    2. Trial is completely free – no third-party billing
    3. No credit card info collected
    4. Live customer support
  • Create trial account signing in to website using Email and Password. You will receive Account ID.

Code:

public String TestRedOxygen(SmsModel obj)
{
   var client = new WebClient();
 
   const string requestUrl = "https://redoxygen.net/sms.dll?Action=SendSMS";
 
   string requestData = "AccountId=" + "account id"
                                 + "&Email=" + System.Web.HttpUtility.UrlEncode("sign-in email")
                                 + "&Password=" + System.Web.HttpUtility.UrlEncode("sign-in password")
                                 + "&Recipient=" + System.Web.HttpUtility.UrlEncode(obj.Reciever)
                                 + "&Message=" + System.Web.HttpUtility.UrlEncode(obj.Message);
 
   byte[] postData = Encoding.ASCII.GetBytes(requestData);
   byte[] clientResponse = client.UploadData(requestUrl, postData);
 
   String result = Encoding.ASCII.GetString(clientResponse);
   int resultCode = System.Convert.ToInt32(result.Substring(0, 4));
 
   return resultCode.ToString();
}

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s