locked
Need to send a free SMS from my asp.net application RRS feed

  • Question

  • User-1171089525 posted

    Hi All,

    Please provide a free webservices for sending a SMS with in indeia.

    also Please suggesst is there any other way.

     

    Regards,

    R.Vetrivelan.

     

    Friday, June 28, 2013 8:40 AM

Answers

  • User281315223 posted

    You'll likely need to use some type of service or SMS Gateway to handle sending SMS messages, which may not always be free (much like sending text messages or phone calls often aren't).

    I'll list a few options for highly recommended SMS Gateways for .NET as well as the code for sending messages for one in particular.

    Overview and Suggestions

    I would recommend checking out the following Stack Overflow discussion on SMS Gateways, which recommended Clickatell. However, there are tons of them out there, so I would suggest doing some research and figuring out what works best for you : 

    Wikipedia also features a fairly comprehensive listing of SMS Gateways as well. 

    An Actual Example

    You will need to use some type of service most likely to perform this, especialy if you are going to be performing it on a large scale.

    SMSified appears to have quite an extensive and friendly API for performing this very task.

    A fully featured example on sending outbound SMS messages using SMSified can be found here.

    Example

    // SMSified API endpoint.
    string webTarget = "https://api.smsified.com/v1/smsmessaging/outbound/{0}/requests";
                           
    // Parameters to send with API request.
    string webPost = "address={0}&message={1}";
                           
    // SMSified credentials.
    string userName = "";
    string password = "";
    string senderNumber = "";
                           
    // Create new HTTP request.
    string url = String.Format(webTarget, senderNumber);
    HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
    req.Method = "POST";
    req.ContentType =  "application/x-www-form-urlencoded";
    byte[] postData = Encoding.ASCII.GetBytes(String.Format(webPost, "14075551212", "This is a test from C#"));
    req.ContentLength = postData.Length;
                           
    // Set HTTP authorization header.
    string authInfo = userName + ":" + password;
    authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
    req.Headers["Authorization"] = "Basic " + authInfo;
                           
    // Send HTTP request.
    Stream PostStream = req.GetRequestStream();
    PostStream.Write(postData, 0, postData.Length);
    HttpWebResponse res = (HttpWebResponse)req.GetResponse();

    As mentioned earlier - these services are likely not free (as mobile messaging typically isn't) so you may be required to create an account with and enter in specific information to handle actually sending the SMS messages.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 28, 2013 8:58 AM

All replies

  • User-1598965247 posted

    I can suggest you an other way. Check the below link

    http://datawebcoder.com/codeByLanguage/1488/Sending_SMS_through_VB_Net_Application.aspx

    You can send sms from your NOKIA phone connected to pc from using data cable

    I have tested it and it works perfectly.

    Friday, June 28, 2013 8:47 AM
  • User-1171089525 posted

    Hi Thanks, but i need to host my asp.net application in web server, how I can use my Mobile ?

    Please help me.

    Friday, June 28, 2013 8:53 AM
  • User-1598965247 posted

    Then better you can choose any webservices for that

    Friday, June 28, 2013 8:54 AM
  • User281315223 posted

    You'll likely need to use some type of service or SMS Gateway to handle sending SMS messages, which may not always be free (much like sending text messages or phone calls often aren't).

    I'll list a few options for highly recommended SMS Gateways for .NET as well as the code for sending messages for one in particular.

    Overview and Suggestions

    I would recommend checking out the following Stack Overflow discussion on SMS Gateways, which recommended Clickatell. However, there are tons of them out there, so I would suggest doing some research and figuring out what works best for you : 

    Wikipedia also features a fairly comprehensive listing of SMS Gateways as well. 

    An Actual Example

    You will need to use some type of service most likely to perform this, especialy if you are going to be performing it on a large scale.

    SMSified appears to have quite an extensive and friendly API for performing this very task.

    A fully featured example on sending outbound SMS messages using SMSified can be found here.

    Example

    // SMSified API endpoint.
    string webTarget = "https://api.smsified.com/v1/smsmessaging/outbound/{0}/requests";
                           
    // Parameters to send with API request.
    string webPost = "address={0}&message={1}";
                           
    // SMSified credentials.
    string userName = "";
    string password = "";
    string senderNumber = "";
                           
    // Create new HTTP request.
    string url = String.Format(webTarget, senderNumber);
    HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
    req.Method = "POST";
    req.ContentType =  "application/x-www-form-urlencoded";
    byte[] postData = Encoding.ASCII.GetBytes(String.Format(webPost, "14075551212", "This is a test from C#"));
    req.ContentLength = postData.Length;
                           
    // Set HTTP authorization header.
    string authInfo = userName + ":" + password;
    authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
    req.Headers["Authorization"] = "Basic " + authInfo;
                           
    // Send HTTP request.
    Stream PostStream = req.GetRequestStream();
    PostStream.Write(postData, 0, postData.Length);
    HttpWebResponse res = (HttpWebResponse)req.GetResponse();

    As mentioned earlier - these services are likely not free (as mobile messaging typically isn't) so you may be required to create an account with and enter in specific information to handle actually sending the SMS messages.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 28, 2013 8:58 AM
  • User-1171089525 posted

    Thanks for your detailed information Rion,  I will check and use it.

    Sunday, July 14, 2013 1:11 AM