Click here to Skip to main content
16,016,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir,


This is Xml Code below

XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE MESSAGE SYSTEM "http://127.0.0.1:80/psms/dtd/messagev12.dtd">
<MESSAGE VER="1.2">
<USER USERNAME="" PASSWORD=""/>
<SMS  UDH="0" CODING="1" TEXT="" PROPERTY="0" ID="1">
<ADDRESS FROM="" TO="" SEQ="1" TAG="some clientside random data"/>
</SMS>
<SMS UDH="0" CODING="1" TEXT="Client API version 1.2 testing msg" PROPERTY="0" ID="2">
<ADDRESS FROM="" TO="" SEQ="1" TAG="" />
</SMS>
</MESSAGE>


I want to send sms through above xml code.Above xml code is my api.
I work web application .
I will send sms in asp.net C#.
What is code in asp.net C# and send message in mobile .
This is URL address ="http://api.myvaluefirst.com/psms"


Asp.net Code

String Mob = "91" + txtMobile.Text;
            byte[] data = new byte[2000];
            string msg = "";
            msg = "Congratulation!," + " Dear " + txtAppname.Text + "Distributor ID: " + lblDistributorID.Text + " Password: " + pwd + ".You Successfully Registered ";

            // The encoding.
             ASCIIEncoding encoding = new ASCIIEncoding();
             data = encoding.GetBytes(msg);
             HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://api.myvaluefirst.com/psms?userName=securelynkx1&password=system&To=" + txtMobile.Text + "TEXT=" + msg + " ");

           //  Dim myReq As HttpWebRequest = WebRequest.Create("http://bulksmsindia.mobi/sendurlcomma.asp?user=20023733&pwd=k9ry3i&senderid=ABC&mobileno=" & txtMobNo.Text & "&msgtext=" & msg & "")

             myReq.Method = "POST";
                myReq.ContentLength = data.Length;
                myReq.ContentType = "application/x-www-form-urlencoded";
                 System.IO.Stream myStream;
                //Dim myStream As System.IO.Stream
                myStream = myReq.GetRequestStream();

                myStream.Write(data, 0, data.Length);
                myStream.Close();


Above code is not work.
How will work .
Please Help me.
Thanks
Mahendra Kumar Das
Posted
Updated 29-Nov-11 22:39pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900