Hello frens,
How to send a text message to a selected mobile number..? message should be delivered to the number on a given date..how it can be done through web application..?
Thanks n Regards,
Soumya
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
ArshadRank #2,492 · 564 reputationPosted Jan 3, 2008, 12:46 AM EST
Try this one...............
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
void Page_Load(Object Src, EventArgs E) {
myPage.Text = readHtmlPage(http://www.arshadkhan.com);
}
private String readHtmlPage(string url)
{
String result = "";
String strPost =
uname=youremail@domain.com&pword=yourpass&message=hello&from=ARSHAD"+
"&selectednums=447740101097&info=1";
StreamWriter myWriter = null;
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
objRequest.Method = "POST";
objRequest.ContentLength = strPost.Length;
objRequest.ContentType = "application/x-www.csharpe.com";
try{
myWriter = new StreamWriter(objRequest.GetRequestStream());
myWriter.Write(strPost);
}
catch (Exception e)
{
return e.Message;
}
finally {
myWriter.Close();
}
HttpWebResponse objResponse =
(HttpWebResponse)objRequest.GetResponse();
using (StreamReader sr =
new StreamReader(objResponse.GetResponseStream()) )
{
result = sr.ReadToEnd();
// Close and clean up the StreamReader
sr.Close();
}
return result;
}
Regards
Arshad Khan
soumya p n39 reputationPosted Jan 3, 2008, 1:26 AM EST
ArshadRank #2,492 · 564 reputationPosted Jan 3, 2008, 1:37 AM EST
Hi.just make the changes in the strPost,like &on=DateTime.Now,
I hope it will get you the present time.
Regrads
Arshad Khan
ArshadRank #2,492 · 564 reputationPosted Jan 3, 2008, 2:04 AM EST
ok ok.now i got it that what u waana say,ok,u can do one thing add on Datetimepicker n select any date so it sould open one new form,where user can Enter the Mobile number n can sent the SMS.
And if that mobile number is coming from the Database then u will have to make the Trigger,ok.like when u need to send the mail at that time that Trigger will be fire.n it will sent as the SMS.
Regards
Arshad
Guest UserRank #1,422 · 1.2K reputationPosted Jan 4, 2008, 5:40 PM EST
soumya p n39 reputationPosted Jan 16, 2008, 2:52 AM EST
this was ur last reply 4 my question..
"ok ok.now i got it that what u waana say,ok,u can do one thing add on Datetimepicker n select any date so it sould open one new form,where user can Enter the Mobile number n can sent the SMS.
And if that mobile number is coming from the Database then u will have to make the Trigger,ok.like when u need to send the mail at that time that Trigger will be fire.n it will sent as the SMS."
can u just tel me this in more detail..i don hav much knowledge on triggers..
Thanks,
Soumya
ArshadRank #2,492 · 564 reputationPosted Jan 16, 2008, 7:53 AM EST
Hi,Sorry for late reply,You tell me one thing that
STEP
(1>> User like you are going to select the Date and the Mobilenumber and sending the SMS.
or
(2>>You have to do like on perticular date the SMS should be send to particular number automatically.
Just clear me your requirement,okThanks
Regards
Arshad Khan
soumya p n39 reputationPosted Jan 17, 2008, 6:55 PM EST
i tink its the 1st case..c i ll tel u the problem more clearly.
i have a form in which user can enter his message,phone number and time of delivery..suppose i enter my date and time as tomorrow at 4.00 PM and i giv my message and close the form..all these data will go to the database..tomorrow at 4:00PM i should get that message on my mobile..
How it can be done..? this is wat i wanted..
OR
u can tel me this also..
how to create a text fime on a predefined time..same like above situation..only difference is instead of sending message to the mobile,tomorrow at 4:00PM(predefined time) i want a text file to be created for the given path..
hope u understand my problem..!!!
Thanks,
Soumya
ArshadRank #2,492 · 564 reputationPosted Jan 21, 2008, 5:56 AM EST
Hi,soumya,I got the solution of your post,but still I am trying to do,but there is some problem with my code.I am not Expert in .NET,so it will take some time.ok.I will get you the solution by tomarrow,Thanks
Regards
Arshad Khan
soumya p n39 reputationPosted Jan 23, 2008, 1:57 AM EST
for time being i hav found out the solution..wat i hav done is, i hav written a function which will keep a track of database..i have written this function under page load..for this my application should be open all the time..and i have made the page to be refreshed for every 20 seconds..this works fine..but i dont think so refreshing a page for every 20 seconds and keeping the application open all the time is a good idea..
hope u give me a better solution..
Thanks,
With Regards,
Soumya
ArshadRank #2,492 · 564 reputationPosted Jan 23, 2008, 5:43 AM EST
Hi,ya i have two solution for that yaar,I have written one Thread and it will invoke your Method at the specific Date and time,and i have one Stored procedure to send Mail on the specific time.I will get you that,ok.But i am bit busy these dayz so not getting time for that,I will send you that by mail,
Thanks
Regards
Arshad khan