Results 1 to 3 of 3
Thread: sms gateway with code
- 01-28-2009, 06:23 AM #1
Member
- Join Date
- Jan 2009
- Location
- India,Gujarat - Ahmedabad
- Posts
- 5
- Rep Power
- 0
sms gateway with code
hi Peppem
actualy i am working with the application of sending message.
Message application have some options like write message, inbox, sent message etc.
i want to connect sms gateway when i write message and click send button.
its a web application and i am using this sms gateway code into servlet.
i am using following code....
{code}
var NowSMSServerAddress =
var NowSMSUserName = "test";
var NowSMSPassword = "test";
function HTTPGET(strURL)
{
var strResult;
try
{
// Create the WinHTTPRequest ActiveX Object.
var WinHttpReq = new ActiveXObject("Msxml2.XMLHTTP" /* or "WinHttp.WinHttpRequest.5 "*/);
// Create an HTTP request.
var temp = WinHttpReq.Open("GET", strURL, false);
// Send the HTTP request.
WinHttpReq.Send();
// Retrieve the response text.
strResult = WinHttpReq.ResponseText;
}
catch (objError)
{
strResult = objError + "\n"
strResult += "WinHTTP returned error: " + (objError.number & 0xFFFF).toString() + "\n\n";
strResult += objError.description;
}
// Return the response text.
return strResult;
}
var strRequest;
if (WScript.Arguments.Count() < 2)
{
WScript.Echo ("Usage: " + WScript.ScriptName + " PhoneNumber1[,PhoneNumber2,...] NowSMSURLParameter1=Value1 [NowSMSURLParameter2=Value2] NowSMSURLParameterN=ValueN]\r\n");
WScript.Quit();
}
strRequest = NowSMSServerAddress + "/?PhoneNumber=" + encodeURIComponent (WScript.Arguments(0)) + "&User=" + encodeURIComponent(NowSMSUserName) + "&password=" + encodeURIComponent(NowSMSPassword) ;
for (i=1; i<WScript.Arguments.Count(); i++)
{
var strTemp = WScript.Arguments(i);
while (strTemp.indexOf("^") >= 0)
{
var temp = strTemp.indexOf("^");
if (temp >= 0) {
strTemp = strTemp.substr(0, temp) + strTemp.substr(temp+1);
}
}
var equPos = strTemp.indexOf("=");
if (equPos >= 0)
{
strRequest += "&";
strRequest += strTemp.substr(0,equPos+1);
strRequest += encodeURIComponent(strTemp.substr(equPos+1));
}
else
{
strRequest += "%20";
strRequest += encodeURIComponent(strTemp);
}
}
/* WScript.Echo(strRequest); */
WScript.Echo(HTTPGET(strRequest));
{code}
this script is not working and error is not displaying.
i have add sms server address bt here i cant shoewthat because its display as link.
so i removed it.
please give some idea.Last edited by Kavit Gamot; 01-28-2009 at 06:28 AM.
- 10-17-2012, 11:02 AM #2
Member
- Join Date
- Oct 2012
- Posts
- 1
- Rep Power
- 0
Re: sms gateway with code
Hi,
Which gateway are you using? I use Ozeki NG SMS Gateway, and I find it reliable and versatile, and it provides the high capacity that I need. When I had any problems, I just wrote them an e-mail, to which I always got a quick and helpful response, so my company can always run smoothly with this gateway. Their website might provide more useful information for you: [Moderator edit: Link removed] . That's all I could say, but I hope I could help you.
MaxLast edited by DarrylBurke; 10-17-2012 at 11:54 AM. Reason: Removed spammy link
- 10-17-2012, 11:20 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,479
- Rep Power
- 16
Similar Threads
-
Sms Gateway
By Kavit Gamot in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 11-06-2009, 03:24 AM -
Sms GateWay
By Kavit Gamot in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 01-27-2009, 10:00 AM -
Gateway 4.6.1
By JavaBean in forum Java SoftwareReplies: 0Last Post: 03-14-2008, 06:12 PM -
Untangle Gateway Platform 5.0.3
By JavaBean in forum Java SoftwareReplies: 0Last Post: 11-09-2007, 10:34 PM -
Gateway 3.0_beta2
By JavaBean in forum Java SoftwareReplies: 0Last Post: 07-17-2007, 05:50 PM


LinkBack URL
About LinkBacks

Bookmarks