Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP (http://www.go4expert.com/articles/asp-tutorials/)
-   -   TO SEND Text message or URL through Clickatell (http://www.go4expert.com/articles/send-text-message-url-clickatell-t5243/)

hanusoftware 13Jul2007 12:31

TO SEND Text message or URL through Clickatell
 
The sample code sends a text message or URL through Clickatell.
Code: ASP

WebClient wbcRingtone = new WebClient();

// Add a user agent header in case the requested URI contains a query.

wbcRingtone.Headers.Add("user-agent","Mozilla/4.0(compatible;MSIE 6.0;Windows NT 5.2; .NET CLR 1.0.3705;)");
wbcRingtone.QueryString.Add("user","xxxxxxxx");
wbcRingtone.QueryString.Add("password","xxxxxxxx");
wbcRingtone.QueryString.Add("api_id", "xxxxxxxxxx");

//wbcRingtone.QueryString.Add("msg_type", "SMS_NOKIA_RTTL");
wbcRingtone.QueryString.Add("to", cellNo);

////wbcRingtone.QueryString.Add("text", "Flintstone:d=4,o=5,b=200:g#,c#,8p,c#6,8a#,g#,c#,8p,g#,8f#,8f,8f,8f#,8g#,c#,d#,2f,2p,g#,c#,8p,c#6,8a#,g#,c#,8p,g#,8f#,8f,8f,8f#,8g#,c#,d#,2c#");

wbcRingtone.QueryString.Add("from", "xxxxxxxxx");
wbcRingtone.QueryString.Add("mms_subject", "xxxxxxxxx");
wbcRingtone.QueryString.Add("mms_class", "xxxxxx");
wbcRingtone.QueryString.Add("mms_expire", "xxxxxxx");
wbcRingtone.QueryString.Add("mms_from", "xxxxxxxxx");
wbcRingtone.QueryString.Add("mms_url", "http://www.some.com/folder/mms.mms");

//string baseURL = "http://api.clickatell.com/http/sendmsg";

string baseURL = "http://api.clickatell.com/mms/ind_push.php";
Stream data = wbcRingtone.OpenRead(baseURL);
StreamReader reader = new StreamReader(data);

string s = reader.ReadToEnd();
data.Close();
reader.Close();

string queryURL = GetQueryForMMS(s);

return queryURL;


sasancenter 29Oct2007 20:45

Re: TO SEND Text message or URL through Clickatell
 
hello,
I have an account with clickatell, but i don't know how can I put their C# sample code in my web site that when my users want to register in my website,they must receive one SMS when they click submit button.
would u guide my what can i do ?
thanks a lot

shakir 17Nov2007 17:06

Re: TO SEND Text message or URL through Clickatell
 
If you subscribe in clickatel, can get the sample code. M using clickatel but script is asp


All times are GMT +5.5. The time now is 17:16.