TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gulpreet Arora
NA
1
1.1k
how to send sms from asp .net with smsgatewayhub
Apr 6 2016 3:12 AM
Hello Team,
this is our Code. ]
using System
”
using System
using System.IO
using System.Net
u
sing System.Text
using System.Web
string s
APIKey
= “
APIKEY
”;
string sNumber = Session["Mobile"].ToString();
string sMessage = “Test SMS From Our Company”;
string sSenderID = “WEBSMS”;
string sURL = “
http://login.smsgatewayhub.com/api/mt/SendSMS?
APIKey
=” + s
APIKEY
+ “&to=” + sNumber
+ “&sid=” + sSenderID + “&msg=” + sMessage + “&fl=0?;
string sResponse = GetResponse(sURL);
Response.Write(sResponse);
public static string GetResponse(string sURL)
{
HttpWebRequest request =
(HttpWebRequest)WebRequest
.Create(sURL);
request.MaximumAutomaticRedirections = 4;
request.Credentials = CredentialCache.DefaultCredentials;
try
{
HttpWebResponse response = (HttpWebResponse)request
.GetResponse();
Stream receiveStream = response.GetResp
onseStream(
);
StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
string sResponse = readStream.ReadToEnd();
response.Close();
readStream.Close();
return sResponse;
}
catch
{
return “”;
}
}
”
Reply
Answers (
4
)
country wise state binding in 3 tier architecture
Web Api