Java is one of most popular programming languages used by developers for the development of application software in a cross-platform environment. Decidedly, using JAVA programming language for developing your website or mobile app, you will experience total satisfaction.
Therefore, BroadNet Java Sample SMS Code helps you connect to our gateway using your most favorite and well-known programming language JAVA. We encourage you to bring the following JAVA Sample SMS Code into use; you will see for yourself how easy, and fast it is to send SMS using BroadNet SMS Gateway!
Example of Java Sample SMS code
This example of Java SMS Sample Code utilizes a clichéd Java Object API.
//Android SMS API integration code //Your application url String ApiUrl = "ApiUrl"; //Your User Id String user = "user"; //Your password String pass = "****"; //Multiple mobiles numbers separated by comma String mobiles = "9999999"; //Sender ID,While using route4 sender id should be 6 characters long. String sid = "102234"; //Your message to send, Add URL encoding here. String message = "Test message"; URLConnection myURLConnection=null; URL myURL=null; BufferedReader reader=null; //encoding message String encoded_message=URLEncoder.encode(message); //Send SMS API String mainUrl="https://broadnet.mme/api/xxxx.php?"; //Prepare parameter string StringBuilder sbPostData= new StringBuilder(mainUrl); sbPostData.append("user="+user); sbPostData.append("&pass="+pass); sbPostData.append("&mobiles="+mobiles); sbPostData.append("&message="+encoded_message); sbPostData.append("&sid="+sid); //final string mainUrl = sbPostData.toString(); try { //prepare connection myURL = new URL(mainUrl); myURLConnection = myURL.openConnection(); myURLConnection.connect(); reader= new BufferedReader(new InputStreamReader(myURLConnection.getInputStream())); //reading response String response; while ((response = reader.readLine()) != null) //print response Log.d("RESPONSE", ""+response); //finally close connection reader.close(); } catch (IOException e) { e.printStackTrace(); }
The aforesaid Java Sample SMS Code connects to our BroadNet Technologies' server and sends a request to the same web server for sending a message.
If you still have any doubt and/or have any query regarding the implementation of the Java Sample SMS Code into your Software, feel free to contact us at info@broadnetme.com or if you want to have a demo account to test our server, please send email to info@broadnetme.com
PHP is the abbreviation of Hypertext Preprocessor, a well-known programming script extensively used by programmers for Web development. As time passes, its utilization is becoming progressively extensive in the domain.
BroadNet Technologies furnishes you with a variety of PHP Sample SMS code examples and programming objects, and assist you in connecting to our gateway via the PHP script. Sending your messages via our designed PHP SMS Sample Code is easier than you guess!
Example of PHP Sample SMS code
This following example of PHP SMS Sample code utilizes a ready-made object related to the HTTP API.
//PHP SMS API integration code //Your application url $ApiUrl ="ApiUrl";) //Your User Id $user ="user"; //Your password $pass ="****"; //Multiple mobiles numbers separated by comma $mno = "9999999"; //Sender ID,While using route4 sender id should be 6 characters long. $sid = "102234"; //Your message to send, Add URL encoding here. $text = "Test message"; // Message Type (1,2,3,4) 1- English,2-Unicode,3- Special Character,4-Arabic $type = "type"; //Prepare parameter string $url = "$ApiUrl?user=$user&pass=$pass&sid=$sid&mno=$mno&text=$text&type=$type"; //prepare connection $ch = curl_init($url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false); //reading response $body = curl_exec($ch); //finally close connection curl_close($ch); //print response echo $body;
The aforesaid PHP Sample SMS Code connects to BroadNet's server and sends a request to the same web server for sending a message.
If you still have any doubt and/or have any query regarding the implementation of the PHP Sample SMS Code into your Software, feel free to contact us at info@broadnetme.com or if you want to have a demo account to test our server, please send email to info@broadnetme.com
Python is a sophisticated, universal, interpreted and powerful programming language, which is all the rage among both inexperienced and experienced programmers as a result of its easy to read syntaxes and codes.
BroadNet features a spectrum of Python sample SMS code examples in order to aid you link up to our gateway via this simple programming language. Just try the following Python Sample SMS Code scripts and you will find that sending SMS to your contact via this programming script is fun!
Python example code
The following example of Python sample SMS code utilizes an expedient object, having a basis on the HTTP API.
class SmsAPI(object): # <summary> # Specify complete Url of SMS gateway # </summary> def get_ApiUrl(self): def set_ApiUrl(self, value): ApiUrl = property(fget=get_ApiUrl, fset=set_ApiUrl) # <summary> # User name supplied by provider # </summary> def get_user(self): def set_user(self, value): user = property(fget=get_user, fset=set_user) # <summary> # Password supplied by provider # </summary> def get_pass(self): def set_pass(self, value): pass = property(fget=get_pass, fset=set_pass) # <summary> # SID supplied by provider # </summary> def get_sid(self): def set_sid(self, value): sid = property(fget=get_sid, fset=set_sid) def __init__(self, ApiUrl, user, pass, sid): self.ApiUrl = ApiUrl self.user = user self.pass = pass self.sid = sid def __init__(self, ApiUrl, user, pass, sid): self.ApiUrl = ApiUrl self.user = user self.pass = pass self.sid = sid def SendSMS(self, Recipient, MessageData): if self.ApiUrl.Trim() == "" or self.user.Trim() == "" or self.pass.Trim() == "" or self.sid.Trim() == "": raise Exception("All Properties were required") #Status = SMS(User, SURL, SPort, Passw, number, MessageData, MessageType); //Sending SMS #///// string createdURL = "http://78.108.164.67" + ":" + "8080" + "/websmpp/websms" + #/////"?user=" + "SPDDLC" + #/////"&pass=" + "s@KJ8QH9" + #/////"&sid=" + "SPDDLC" + #/////"&mno=" + Recipient + #/////"&text=" + MessageData + #/////"&type=" + "1" + #/////"&esm=" + "0" + #/////"&dcs=" + "0"; # MessageBox.Show(createdURL); createdURL = self.ApiUrl + "?user=" + self.user + "&pass=" + self.pass + "&sid=" + self.sid + "&mno=" + Recipient + "&text=" + MessageData + "&type=" + "1" + "&esm=" + "0" + "&dcs=" + "0" try: myReq = WebRequest.Create(createdURL) #MessageBox.Show("2"); # Get response from SMS Gateway Server and read the answer myResp = myReq.GetResponse() # MessageBox.Show("21"); respStreamReader = System.IO.StreamReader(myResp.GetResponseStream()) # MessageBox.Show("22"); responseString = respStreamReader.ReadToEnd() # MessageBox.Show("2"); respStreamReader.Close() myResp.Close() except Exception, ex: raise ex finally: return "success"
The aforesaid Python Sample SMS Code connects to our BroadNet Technologies' server and sends a request to the same web server for sending a message.
If you still have any doubt and/or have any query regarding the implementation of the Java Sample SMS Code into your Software, feel free to contact us at info@broadnetme.com or if you want to have a demo account to test our server, please send email to info@broadnetme.com
C# is one of the distinguished object-based programming language which is widely used to build a range of failsafe and effective applications compatible with the Microsoft .NET Framework.
BroadNet Technologies furnishes you with code examples and programming objects with the intent to connect to our gateway by dint of the programming language you take a fancy for. We encourage you to try the below-mentioned C# sample SMS code.
C# example code
The following example of C# sample SMS code uses an expedient object, contingent on the HTTP API
public class SmsAPI { /// <summary> /// Specify complete Url of SMS gateway /// </summary> public string ApiUrl { get; set; } /// <summary> /// User name supplied by provider /// </summary> public string user { get; set; } /// <summary> /// Password supplied by provider /// </summary> public string pass { get; set; } /// <summary> /// SID supplied by provider /// </summary> public string sid { get; set; } public SmsAPI() { } public SmsAPI(string ApiUrl, string user, string pass, string sid) { this.ApiUrl = ApiUrl; this.user = user; this.pass = pass; this.sid = sid; } public string SendSMS(string Recipient, string MessageData) { if (ApiUrl.Trim() == "" || user.Trim() == "" || pass.Trim() == "" || sid.Trim() == "") throw new Exception ("All Properties were required"); //Status = SMS(User, SURL, SPort, Passw, number, MessageData, MessageType); //Sending SMS //////// string createdURL = "http://78.108.xxx.xx" + ":" + "8080" + "/websmpp/websms" + ////////"?user=" + "SPDDLC" + ////////"&pass=" + "s@KJ8QH9" + ////////"&sid=" + "SPDDLC" + ////////"&mno=" + Recipient + ////////"&text=" + MessageData + ////////"&type=" + "1" + ////////"&esm=" + "0" + ////////"&dcs=" + "0"; // MessageBox.Show(createdURL); string createdURL = ApiUrl + "?user=" +user + "&pass=" + pass + "&sid=" + sid + "&mno=" + Recipient + "&text=" + MessageData + "&type=" + "1" + "&esm=" + "0" + "&dcs=" + "0"; try { HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(createdURL); //MessageBox.Show("2"); // Get response from SMS Gateway Server and read the answer HttpWebRequest myResp = (HttpWebRequest)myReq.GetResponse(); // MessageBox.Show("21"); System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream()); // MessageBox.Show("22"); string responseString = respStreamReader.ReadToEnd(); // MessageBox.Show("2"); respStreamReader.Close(); myResp.Close(); } catch (Exception ex) { throw ex; } finally { } return "success"; } } }
The aforesaid C# Sample SMS Code connects to our BroadNet Technologies' server and sends a request to the same web server for sending a message.
If you still have any doubt and/or have any query regarding the implementation of the C# Sample SMS Code into your Software, feel free to contact us at info@broadnetme.com or if you want to have a demo account to test our server, please send email to info@broadnetme.com .
Designed and released by Microsoft in 2012, Windows 8 is a well-known and widely used operating system in Personal Computers as well as Windows-based Smartphone Mobile Devices
In the age of mobile tablets and laptops, sending a text to your contact is not only feasible but also very easy! So whether you use Windows 8 or Windows 10 PC or tablet, BroadNet helps you effectively in sending/receiving text messages via the following Windows 8 sample SMS code.
Windows 8 example code
The following example of Windows 8 sample SMS code utilizes an expedient object, having a basis on the HTTP API. If you want to use this Windows 8 sample SMS code, just sign up our website now.
public class SmsAPI { /// <summary> /// Specify complete Url of SMS gateway /// </summary> public string ApiUrl { get; set; } /// <summary> /// User name supplied by provider /// </summary> public string user { get; set; } /// <summary> /// Password supplied by provider /// </summary> public string pass { get; set; } /// <summary> /// SID supplied by provider /// </summary> public string sid { get; set; } public SmsAPI() { } public SmsAPI(string ApiUrl, string user, string pass, string sid) { this.ApiUrl = ApiUrl; this.user = user; this.pass = pass; this.sid = sid; } public string SendSMS(string Recipient, string MessageData) { if (ApiUrl.Trim() == "" || user.Trim() == "" || pass.Trim() == "" || sid.Trim() == "") throw new Exception ("All Properties were required"); //Status = SMS(User, SURL, SPort, Passw, number, MessageData, MessageType); //Sending SMS //////// string createdURL = "http://78.108.164.67" + ":" + "8080" + "/websmpp/websms" + ////////"?user=" + "SPDDLC" + ////////"&pass=" + "s@KJ8QH9" + ////////"&sid=" + "SPDDLC" + ////////"&mno=" + Recipient + ////////"&text=" + MessageData + ////////"&type=" + "1" + ////////"&esm=" + "0" + ////////"&dcs=" + "0"; // MessageBox.Show(createdURL); string createdURL = ApiUrl + "?user=" +user + "&pass=" + pass + "&sid=" + sid + "&mno=" + Recipient + "&text=" + MessageData + "&type=" + "1" + "&esm=" + "0" + "&dcs=" + "0"; try { HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(createdURL); //MessageBox.Show("2"); // Get response from SMS Gateway Server and read the answer HttpWebRequest myResp = (HttpWebRequest)myReq.GetResponse(); // MessageBox.Show("21"); System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream()); // MessageBox.Show("22"); string responseString = respStreamReader.ReadToEnd(); // MessageBox.Show("2"); respStreamReader.Close(); myResp.Close(); } catch (Exception ex) { throw ex; } finally { } return "success"; } } }
The aforesaid Windows Sample SMS Code connects to our BroadNet's server and sends a request to the same web server for sending a message.
If you still have any doubt and/or have any query regarding the implementation of the Windows Sample SMS Code into your Software, feel free to contact us at info@broadnetme.com or if you want to have a demo account to test our server, please send email to info@broadnetme.com .
Windows Phone (WP) is a class of mobile operating systems designed and developed by Microsoft for Smartphones as the stand-in successor to Windows Mobile and Zune. Windows Phone sports a state-of-the-art user interface, which stems from Metro design language.
In the era of mobile tablets and laptops, sending a text to your contact is like shooting fish in a barrel; moreover, it is very easy too! So whether you use Windows7, Windows 8 or Windows 10 PC or tablet, BroadNet Technologies helps you effectively in sendingtext messages via the following Windows phone sample SMS code using your current mobile phone number.
Windows Phone example code
The following example of Windows Phone sample SMS code makes use of an expedient object, with a basis on the HTTP API.
namespace BroadNetWPSMSLib { public class RequestState { // This class stores the State of the request. const int BUFFER_SIZE =1024 ; public StringBuilder requestData; public byte[] BufferRead; public System.Net.HttpWebRequest request; public System.Net.HttpWebResponse response; public System.Net.Stream streamResponse; public RequestState { BufferRead = new byte[BUFFER_SIZE]; requestData = newStringBuilder("");; request = null; streamResponse = null; } } public class SmsAPI { // <summary> // Specify complete Url of SMS gateway // </summary> public string ApiUrl { get; set; } // <summary> // User name supplied by provider // </summary> public string user { get; set; } // <summary> // Password supplied by provider // </summary> public string pass { get; set; } // <summary> // SID supplied by provider // </summary> public static System.Threading.ManualResetEventallDone = new System.Threading.ManualResetEvent(false); const int BUFFER_SIZE = 1024; public SmsAPI() { } public SmsAPI(string ApiUrl, string user, string pass, string sid) { this.ApiUrl = ApiUrl; this.user = user; this.pass = pass; this.sid = sid; } public string SendSMS(string Recipient, string MessageData) { if (ApiUrl.Trim() == "" || user.Trim() == "" || pass.Trim() == "" || sid.Trim() == "") throw new Exception ("All Properties were required"); //Status = SMS(User, SURL, SPort, Passw, number, MessageData, MessageType); //Sending SMS // string createdURL = "http://78.108.164.67" + ":" + "8080" + "/websmpp/websms" + //"?user=" + "SPDDLC" + //"&pass=" + "s@KJ8QH9" + //"&sid=" + "SPDDLC" + //"&mno=" + Recipient + //"&text=" + MessageData + //"&type=" + "1" + //"&esm=" + "0" + //"&dcs=" + "0"; // MessageBox.Show(createdURL); string createdURL = ApiUrl + "?user=" +user + "&pass=" + pass + "&sid=" + sid + "&mno=" + Recipient + "&text=" + MessageData + "&type=" + "1" + "&esm=" + "0" + "&dcs=" + "0"; try { System.Uri uri = new Uri(createdURL); //Create a HttpWebrequest object to the desired URL. System.Net.HttpWebRequest myHttpWebRequest1 = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(uri); // Create an instance of the RequestState and assign the previous myHttpWebRequest1 // object to it's request field. RequestState myRequestState = new RequestState(); myRequestState.request = myHttpWebRequest1; // Start the asynchronous request. IAsyncResult result = (IAsyncResult)myHttpWebRequest1.BeginGetResponse(new AsyncCallback(RespCallback), myRequestState); allDone.WaitOne(); // Release the HttpWebResponse resource. myRequestState.response.Close(); } catch (System.Net.WebException e) { throw e; } catch (Exception e) { throw e; } return "success"; } private static void RespCallback(IAsyncResult asynchronousResult) { try { // State of request is asynchronous. RequestState myRequestState = (RequestState)asynchronousResult.AsyncState; System.Net.HttpWebRequest myHttpWebRequest2 = myRequestState.request; myRequestState.response = (System.Net.HttpWebResponse )myHttpWebRequest2.EndGetResponse(asynchronousResult); // Read the response into a Stream object. System.IO.Stream responseStream = myRequestState.response.GetResponseStream(); myRequestState.streamResponse = responseStream; // Begin the Reading of the contents of the HTML page and print it to the console. IAsyncResult asynchronousInputRead = responseStream.BeginRead(myRequestState.BufferRead, 0, BUFFER_SIZE, new AsyncCallback(ReadCallBack), myRequestState); } catch (System.Net.WebException e) { throw e; } } private static void ReadCallBack(IAsyncResult asyncResult) { try { RequestState myRequestState = (RequestState)asyncResult.AsyncState; System.IO.Stream responseStream = myRequestState.streamResponse; int read = responseStream.EndRead(asyncResult); // Read the HTML page and then do something with it if (read > 0) { myRequestState.requestData.Append(Encoding.UTF8.GetString(myRequestState.BufferRead, 0, read)); IAsyncResult asynchronousResult = responseStream.BeginRead(myRequestState.BufferRead, 0, BUFFER_SIZE, new AsyncCallback(ReadCallBack), myRequestState); } else { if(myRequestState.requestData.Length > 1) { string stringContent; stringContent = myRequestState.requestData.ToString(); // do something with the response stream here } responseStream.Close(); allDone.Set(); } } catch (System.Net.WebException e) { throw e; } } } }
The aforesaid Windows Phone Sample SMS Code connects to our BroadNets' server and sends a request to the same web server for sending a message.
If you still have any doubt and/or have any query regarding the implementation of the Windows Phone Sample SMS Code into your Software, feel free to contact us at info@broadnetme.com or if you want to have a demo account to test our server, please send email to info@broadnetme.com .
Android phone is presumably the latest and most popular version of all Smartphones sporting innovative technology. It operates on the Android operating system (OS), which is developed by Google and is used by a maximum number of users around the world.
When it comes to sending text messages via an Android mobile device, it is all easy and great fun for every person. No matter which version of an Android mobile device you are using, BroadNet is a reliable partner for you in sending messages to your contacts via the following Android phone sample SMS code.
Android Phone example code
The following example of Android Phone sample SMS code employs user-friendly object, with a basis on the HTTP API.
//Android SMS API integration code //Your application url String ApiUrl = "YourAuthKey"; //Your User Id String user = "user"; //Your password String pass = "*****"; //Multiple mobiles numbers separated by comma String mobiles = "9999999"; //Sender ID,While using route4 sender id should be 6 characters long. String sid = "102234"; //Your message to send, Add URL encoding here. String message = "Test message"; URLConnection myURLConnection=null; URL myURL=null; BufferedReader reader=null; //encoding message String encoded_message=URLEncoder.encode(message); //Send SMS API String mainUrl="https://broadnet.me/api/xxxx.php?"; //Prepare parameter string StringBuilder sbPostData= new StringBuilder(mainUrl); sbPostData.append("user="+user); sbPostData.append("&pass="+pass); sbPostData.append("&mobiles="+mobiles); sbPostData.append("&message="+encoded_message); sbPostData.append("&sid="+sid); //final string mainUrl = sbPostData.toString(); try { //prepare connection myURL = new URL(mainUrl); myURLConnection = myURL.openConnection(); myURLConnection.connect(); reader= new BufferedReader(new InputStreamReader(myURLConnection.getInputStream())); //reading response String response; while ((response = reader.readLine()) != null) //print response Log.d("RESPONSE", ""+response); //finally close connection reader.close(); } catch (IOException e) { e.printStackTrace(); }
The above-mentioned Android Phone Sample SMS Code connects to our BroadNet'sserver and sends a request to the same web server to send a message.
If you still have any doubt and/or have any query regarding the implementation of the Android Sample SMS Code into your Software, feel free to contact us at info@broadnetme.com or if you want to have a demo account to test our server, please send email to info@broadnetme.com.
iOS is a sophisticated and chic mobile operating system created and developed by Apple Inc. iOS is the operating system that is embedded in all the mobile devices created by Apple, including the iPhone, iPad, and iPod touch.
Sending bulk SMS from iOS mobile device is a facile and fun process that is a hard to be possessed. Regardless of the iOS device and version you are using, BroadNet Technologies lends a great help to you in sending messages to your contacts via the following iOS phone sample SMS code.
iOS Phone example code
The following example of iOS Phone sample SMS code employs user-friendly object, with a basis on the HTTP API.
//IOS SMS API integration code //Create Objects NSMutableData * responseData; NSURLConnection * connection; // In your viewDidLoad method add this lines -(void)viewDidLoad { [super viewDidLoad]; //Your application url NSString * ApiUrl = @"ApiUrl"; //Multiple mobiles numbers separated by comma NSString * user = @"uname"; NSString * pass = @"******"; NSString * mobiles = @"9999999"; //Sender ID,While using route4 sender id should be 6 characters long. NSString * sid = @"102234"; //Your message to send, Add URL encoding here. NSString * message = @"Test message"; // Prepare your url to send sms with this parameters. NSString * url = [[NSString stringWithFormat:@"https://broadnet.me/api/xxxxx.php?user=%@&pass=%@&mobiles=%@&message=%@&sid=%@", user, pass, mobiles, message, sid] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; } // implement URLConnection Delegate Methods as follow -(void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { //Get response data responseData = [NSMutableData data]; } -(void) connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [responseData appendData:data]; } -(void) connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"message:error.localizedDescription delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil]; [alert show]; } -(void) connectionDidFinishLoading:(NSURLConnection *)connection { // Get response data in NSString. NSString * responceStr = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; }
The above-mentioned iOS Phone Sample SMS Code connects to our BroadNet's server and sends a request to the same web server to send a message.
If you still have any doubt and/or have any query regarding the implementation of theiOSPhone Sample SMS Code into your Software, feel free to contact us at info@broadnetme.com or if you want to have a demo account to test our server, please send email to info@broadnetme.com .
Created by Microsoft, Visual Basic (VB) is a programming language in which a programmer utilizes a graphical user interface (GUI) to choose and revise preselected sections of codes written in the BASIC programming language.
BroadNet Technologies furnishes you with a spectrum of VB6 sample SMS code examples with the intent to help you hook up to our gateway via the programming language you like very much. Just try the following VB6 Sample SMS Code scripts and you will find that sending SMS to your contact via this programming script is so fast and easy!
VB6 example code
The following example of VB6 sample SMS code uses an expedient object, contingent on the HTTP API.
Imports System.Net Public Class SmsAPI // <summary> // Specify complete Url of SMS gateway // </summary> Public Property ApiUrl() As String Get Return m_ApiUrl End Get Set(value As String) m_ApiUrl = value End Set End Property Private m_ApiUrl As String // <summary> // User name supplied by provider // </summary> Public Property user() As String Get Return m_user End Get Set(value As String) m_user = value End Set End Property Private m_user As String // <summary> // Password supplied by provider // </summary> Public Property pass() As String Get Return m_pass End Get Set(value As String) m_pass = value End Set End Property Private m_pass As String // <summary> // SID supplied by provider // </summary> Public Property sid() As String Get Return m_sid End Get Set(value As String) m_sid = value End Set End Property Private m_sidAs String Public Sub New() End Sub Public Sub New(ApiUrl As String, user As String, pass As String, sid As String) Me.ApiUrl = ApiUrl Me.user = user Me.pass = pass Me.sid = sid End Sub Public Function SendSMS(Recipient As String, MessageData As String) As String If ApiUrl.Trim() = "" OrElse user.Trim() = "" OrElse pass.Trim() = "" OrElse sid.Trim() = "" Then Throw New Exception("All Properties were required") End If 'Status = SMS(User, SURL, SPort, Passw, number, MessageData, MessageType); //Sending SMS '''///// string createdURL = "http://78.108.164.67" + ":" + "8080" + "/websmpp/websms" + '''/////"?user=" + "SPDDLC" + '''/////"&pass=" + "s@KJ8QH9" + '''/////"&sid=" + "SPDDLC" + '''/////"&mno=" + Recipient + '''/////"&text=" + MessageData + '''/////"&type=" + "1" + '''/////"&esm=" + "0" + '''/////"&dcs=" + "0"; ' MessageBox.Show(createdURL); Dim createdURL As String = ApiUrl & "?user=" & user & "&pass=" & pass & "&sid=" & sid & "&mno=" & Recipient & "&text=" & MessageData & "&type=" & "1" & "&esm=" & "0" & "&dcs=" & "0" Try Dim myReq As HttpWebRequest = DirectCast(WebRequest.Create(createdURL), HttpWebRequest) 'MessageBox.Show("2"); ' Get response from SMS Gateway Server and read the answer Dim myResp As HttpWebResponse = DirectCast(myReq.GetResponse(), HttpWebResponse) ' MessageBox.Show("21"); Dim respStreamReader As New System.IO.StreamReader(myResp.GetResponseStream()) ' MessageBox.Show("22"); Dim responseString As String = respStreamReader.ReadToEnd() ' MessageBox.Show("2"); respStreamReader.Close() myResp.Close() Catch ex As Exception Throw ex Finally End Try Return "success" End Function End Class
The aforesaid VB6 Sample SMS Code connects to our BroadNet Technologies' server and sends a request to the same web server for sending a message.
If you still have any doubt and/or have any query regarding the implementation of the VB6 Sample SMS Code into your Software, feel free to contact us at info@broadnetme.com or if you want to have a demo account to test our server, please send email to info@broadnetme.com .