Wednesday, 20 February 2013

Send SMS To Mobile using way2sms account in asp.net application

public void sendSMS(string uid, string password, string message, string no)
    {
        HttpWebRequest myReq =
      HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://moneycentral.msn.com/investor/StockRating/srstopstocksresults.aspx?sco=1&page=1col=13" + uid + "&pwd=" + password + "&msg=" + message + "&phone=" + no + "&provider=way2sms");

        HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
        System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
        string responseString = respStreamReader.ReadToEnd();
        respStreamReader.Close();
        myResp.Close();
    }



protected void Button1_Click(object sender, EventArgs e)
    {

        try
        {
            if (TextBox1.Text != String.Empty && TextBox2.Text != String.Empty)
            {
                sendSMS("yourmobileno", "yourpassword", TextBox2.Text, TextBox1.Text);
                TextBox1.Text = String.Empty;
                TextBox2.Text = String.Empty;
                Label3.Visible = true;
                Label3.Text = "Message Sented";
            }
            else
            {
                Label3.Visible = true;
                Label3.Text = "Not Sented";
            }
        }
        catch (Exception)
        {

            throw;
        }
    }

40 comments:

  1. It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues.
    Way2sms login

    ReplyDelete
  2. i tried ur code but i am getting an error as

    The remote server returned an error: (503) Server Unavailable.

    please help..

    ReplyDelete
  3. r u entering namespace for your application

    ReplyDelete
  4. name space means.. please help me..

    ReplyDelete
  5. I AM POSTING ANOTHER POST PLZ CHECK IT ONCE I THINK IT PROBABLY WORK K

    ReplyDelete
  6. U WANT ONLY SEND SMS THROUGH WAY2SMS R SMTP

    ReplyDelete
  7. through WAY2SMS .please help me..

    ReplyDelete
  8. is it possible through SMTP..

    ReplyDelete
  9. R U ENTERDE THE NAMESPACE AS
    using System.Net;

    ReplyDelete
  10. yes it is possible through smtp

    ReplyDelete
  11. r u tried my code through smtp

    ReplyDelete
  12. i already post that code check it once

    ReplyDelete
  13. SEND EMAILS FROM YOUR APPLICATIONS

    check this link

    ReplyDelete
  14. actually wats the problem is
    i given this below url in coding for communicator between way2sms and u
    this url temporarly stoped by the administrator so we cant access that site right u use diff url on that place k

    http://ubaid.tk/sms/sms.aspx?uid=

    ReplyDelete
  15. hey use this code on ur code k

    HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://moneycentral.msn.com/investor/StockRating/srstopstocksresults.aspx?sco=1&page=1col=13" + uid + "&pwd=" + password + "&msg=" + message + "&phone=" + no + "&provider=way2sms");

    ReplyDelete
    Replies
    1. That code Run Successfully but Sms Not Delivered to the Recipient

      Delete
  16. This comment has been removed by the author.

    ReplyDelete
  17. yes i am not receiving the message in mobile..

    ReplyDelete
  18. I THINK ITS SERVER DOWN PROBLEM

    ReplyDelete
  19. but when i am sending through way2sms i am receiveing the sms please help..

    ReplyDelete
  20. Hi this is chakradhar can u help me how to send sms through way2sms

    ReplyDelete
  21. hello sir your code is working fine but SMS not get me on my number..

    ReplyDelete
  22. hello sir ,can u send me code,i am not getting message on mobile no and not getting any error so plz send me code on my email id

    ReplyDelete
  23. this code is working but SMS not sent on mobile..please help its very urgent

    ReplyDelete
  24. IS it take time to recieve sms

    ReplyDelete
  25. I have use same code as mentioned above....

    But getting mentioned below error--


    "Error Occured!!!System.Net.WebException: The remote name could not be resolved: 'ubaid.tk' at System.Net.HttpWebRequest.GetResponse() at Message.send(String uid, String password, String message, String MobNo) in d:\User\test\Message.aspx.cs:line 22 at Message.buttonSend_Click(Object sender, EventArgs e) in d:\Ayush\test\Message.aspx.cs:line 40".


    Kindly get resolve this....

    ReplyDelete
  26. I don't get any sms to my mobile, but i got sms sent successfully when i run this page.

    ReplyDelete
  27. i got sms sent succesful message not delevered

    ReplyDelete
  28. plz i want soure code ... plz my mail id swetha8264@gmail.com

    ReplyDelete
  29. sir the code ran.. without showing error eventhough i didnt get any message my number.. what is the reason sir.. is there any valid code pls send me

    email: chithhu15493@gmail.com

    ReplyDelete
  30. i got message sent but not got it
    pls replay source code

    nitingadade15@gmail.com

    ReplyDelete