microsoft.public.sqlserver.notificationsvcs
[Top] [All Lists]

Re: how hard to set up cellphone delivery channel

Subject: Re: how hard to set up cellphone delivery channel
From: "Mana"
Date: 26 Dec 2005 06:18:54 -0800
Newsgroups: microsoft.public.sqlserver.notificationsvcs
I have used an external service for this. There is a site called
Clickatell.com. They have 10-messages free trial. Subscribe for it and
then u can download a dll using which u can send SMS.

Following is the sample code

//click on button to send sms
private void button1_Click(object sender, EventArgs e)
                {
                        HttpWebRequest webRequest = null;
                        HttpWebResponse webResponse = null;
                        string uri;

                        try
                        {
                                uri = "http://api.clickatell.com/http/sendmsg?";;
                                uri += "api_id=" + "123456";//given when u 
subscribe
                                uri += "&user=" + "testuser";
                                uri += "&password=" + "passtest";
                                uri += "&to=" + "912345678905";//cell no with 
country code
                                uri += "&text=" + "Merry Christmas";
                                uri += "&from=" + "Santa";

                                webRequest = 
(HttpWebRequest)WebRequest.Create(new Uri(uri));
                                webRequest.ContentLength = uri.Length;
                                webRequest.KeepAlive = false;
                                webRequest.Method = "POST";
                                webResponse = 
(HttpWebResponse)webRequest.GetResponse();
                                Stream responseStream = 
webResponse.GetResponseStream();
                                StreamReader responseStreamReader = new
StreamReader(responseStream);
                                string response = 
responseStreamReader.ReadToEnd();
                                responseStreamReader.Close();
                                responseStream.Close();
                                webResponse.Close();
                        }
                        catch (Exception exception)
                        {
                                MessageBox.Show(exception.ToString());
                                return;
                        }
                        finally
                        {
                                if (webRequest != null)
                                        webRequest.Abort();
                                webRequest  = null;
                                webResponse = null;
                        }
                }


<Prev in Thread] Current Thread [Next in Thread>