### Send SMS with ASP.NET Source: https://www.isms.com.my/isms-downloads.php This article provides code examples for sending SMS using ASP.NET. ```ASP.NET Send SMS with ASP.NET ``` -------------------------------- ### Send SMS with C++ Source: https://www.isms.com.my/isms-downloads.php This article provides code examples for sending SMS using C++. ```C++ Send SMS with C++ ``` -------------------------------- ### Send SMS With PHP Code Source: https://www.isms.com.my/isms-downloads.php This article provides code examples for sending SMS using PHP. ```PHP Send SMS With PHP Code ``` -------------------------------- ### Send SMS with C# Source: https://www.isms.com.my/how-to-send-sms-c-sharp.php This code example shows how to send an SMS message using C#. Replace placeholders with your actual username, password, recipient number, and message content. ```csharp using System; using System.Net; using System.IO; public class SendSMS { public static void Main(string[] args) { string strUrl = "https://isms.com.my/ismsapi/sendSms.php?username=YourUsername&apipassword=YourPassword&senderid=YourSenderID&recipient=RecipientNumber&message=YourMessage"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strUrl); request.Method = "GET"; request.ContentType = "application/x-www-form-urlencoded"; try { HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string strResult = reader.ReadToEnd(); Console.WriteLine(strResult); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } ``` -------------------------------- ### Send SMS with VB.net Source: https://www.isms.com.my/bulk-sms-faq.php Send an SMS message using VB.NET. This example requires an API key, sender ID, recipient number, and message text. ```vb.net Imports System.Net Imports System.Text Public Module SmsSender ' Function to send a single SMS Function SendSms(apiKey As String, senderId As String, recipient As String, message As String) As Boolean ' Implementation details for sending SMS via API ' Replace with actual API endpoint and request logic Console.WriteLine($"Sending SMS to {recipient}...") ' ... (API call to send SMS) ... Return True ' Indicate success End Function Sub Main() Dim apiKey As String = "YOUR_API_KEY" ' Replace with your actual API key Dim senderId As String = "iSMS" ' Your sender ID Dim recipient As String = "+1234567890" ' Recipient's phone number Dim message As String = "Hello from iSMS!" If SendSms(apiKey, senderId, recipient, message) Then Console.WriteLine("SMS sent successfully.") Else Console.WriteLine("Failed to send SMS.") End If End Sub End Module ``` -------------------------------- ### Create Bulk SMS Task Scheduler using PHP Source: https://www.isms.com.my/isms-downloads.php This article covers how to create a bulk SMS task scheduler using PHP. ```PHP Create Bulk SMS Task Scheduler using PHP ``` -------------------------------- ### Send Multiple SMS via HTTPS Source: https://www.isms.com.my/sms_api.php Example of sending SMS messages to multiple recipients via HTTPS. Recipients should be separated by semicolons. ```http https://www.isms.com.my/isms_send_all_id.php?un=isms&pwd=isms&dstno=phone1;phone2;phone3&msg=Hello%20World&type=1&sendid=12345 ``` -------------------------------- ### Send SMS with C# Demo Source: https://www.isms.com.my/isms-downloads.php Download the C# demo script to implement SMS sending features in your C# applications. ```C# Send SMS with C# ``` -------------------------------- ### Send SMS with Java Source: https://www.isms.com.my This snippet shows how to send SMS using the iSMS API with Java. Ensure you have Java Development Kit (JDK) installed. ```java import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.util.LinkedHashMap; import java.util.Map; public class SmsSender { public static void main(String[] args) { try { String username = "your_username"; String password = "your_password"; String url = "https://isms.my/sms_api/send_sms.php"; URL obj = new URL(url); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); Map params = new LinkedHashMap<>(); params.put("username", username); params.put("password", password); params.put("to_number", "601123456789"); params.put("message", "This is a test message from Java."); StringBuilder postData = new StringBuilder(); for (Map.Entry param : params.entrySet()) { if (postData.length() != 0) postData.append('&'); postData.append(URLEncoder.encode(param.getKey(), "UTF-8")); postData.append('='); postData.append(URLEncoder.encode(param.getValue(), "UTF-8")); } byte[] postDataBytes = postData.toString().getBytes("UTF-8"); con.setDoOutput(true); OutputStream os = con.getOutputStream(); os.write(postDataBytes); int responseCode = con.getResponseCode(); System.out.println("POST Response Code :: " + responseCode); if (responseCode == HttpURLConnection.HTTP_OK) { //success BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString()); } else { System.out.println("POST request not worked."); } } catch (Exception e) { e.printStackTrace(); } } } ``` -------------------------------- ### Check SMS Balance with C# (Version 1) Source: https://www.isms.com.my/isms-downloads.php Download the C# demo script for checking SMS balance using Version 1 of the C# integration. ```C# Check SMS balance with C# Version 1 ``` -------------------------------- ### Send Single SMS via HTTPS Source: https://www.isms.com.my/sms_api.php Example of sending a single SMS message using the iSMS API via HTTPS. Includes all necessary parameters. ```http https://www.isms.com.my/isms_send_all_id.php?un=isms&pwd=isms&dstno=60123456789&msg=Hello%20World&type=1&sendid=12345 ``` -------------------------------- ### Send SMS with Java Demo Source: https://www.isms.com.my/isms-downloads.php Download the Java demo script to integrate SMS sending functionality into your Java applications. ```Java Send SMS with Java ``` -------------------------------- ### Send SMS with ASP.NET Source: https://www.isms.com.my/bulk-sms-faq.php Example of sending an SMS within an ASP.NET application. This typically involves using an HTTP client to interact with an SMS gateway API. ```csharp using System; using System.Net.Http; using System.Threading.Tasks; using System.Web; public class AspNetSmsSender { private readonly string _apiKey; private readonly string _apiEndpoint; public AspNetSmsSender(string apiKey, string apiEndpoint) { _apiKey = apiKey; _apiEndpoint = apiEndpoint; } public async Task SendSmsAsync(string recipient, string message) { using (var client = new HttpClient()) { // Construct the request payload var payload = new FormUrlEncodedContent(new[] { new KeyValuePair("apikey", _apiKey), new KeyValuePair("to", recipient), new KeyValuePair("message", message) }); try { HttpResponseMessage response = await client.PostAsync(_apiEndpoint, payload); response.EnsureSuccessStatusCode(); // Throw if not successful // Process the response if needed return true; } catch (HttpRequestException e) { Console.WriteLine($"Error sending SMS: {e.Message}"); return false; } } } // Example usage within an ASP.NET context (e.g., a controller) public async Task SendSmsExample() { string apiKey = "YOUR_API_KEY"; string apiEndpoint = "https://api.isms.com.my/send"; // Example API endpoint var smsSender = new AspNetSmsSender(apiKey, apiEndpoint); string recipient = "+60123456789"; string message = "Test SMS from ASP.NET"; bool success = await smsSender.SendSmsAsync(recipient, message); if (success) { // Handle success } else { // Handle failure } } } ``` -------------------------------- ### Send SMS with Java Source: https://www.isms.com.my/how-to-send-sms-java.php This snippet shows how to send an SMS message using Java. Ensure you have the necessary API credentials and have imported the required classes. ```java import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; public class SendSMS { public static void main(String[] args) { try { // Construct the URL for the SMS API request URL url = new URL("http://isms.my/smsapi/http_api.php"); URLConnection connection = url.openConnection(); HttpURLConnection httpConn = (HttpURLConnection) connection; httpConn.setRequestMethod("POST"); httpConn.setDoOutput(true); httpConn.setDoInput(true); httpConn.setUseCaches(false); // Prepare the data to be sent to the API String data = "username=your_username&password=your_password&to=recipient_number&message=Your+SMS+message+here&from=sender_id"; OutputStreamWriter wr = new OutputStreamWriter(httpConn.getOutputStream()); wr.write(data); wr.flush(); // Read the response from the API BufferedReader in = null; StringBuilder response = new StringBuilder(); String line; in = new BufferedReader(new InputStreamReader(httpConn.getInputStream())); while ((line = in.readLine()) != null) { response.append(line); } in.close(); // Print the API response System.out.println("Response: " + response.toString()); } catch (Exception e) { System.out.println("Error sending SMS: " + e.getMessage()); e.printStackTrace(); } } } ``` -------------------------------- ### Send SMS with PHP Code Source: https://www.isms.com.my This is a fundamental example of sending SMS using PHP and the iSMS API. It shows the basic structure for making the API call. ```php $username, "password" => $password, "to_number" => "601123456789", "message" => "Hello from PHP!" ); $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if ($result === FALSE) { die('Error'); } var_dump($result); ?> ``` -------------------------------- ### Check SMS Balance with C# (Version 2) Source: https://www.isms.com.my/isms-downloads.php Download the C# demo script for checking SMS balance using Version 2 of the C# integration. ```C# Check SMS balance with C# Version 2 ``` -------------------------------- ### Add SE Contact Verification Form Shortcode Source: https://www.isms.com.my/how-to-setup-sms-verification-one-time-password-form-in-wordpress.php Use this shortcode to display the SMS verification contact form on your WordPress pages. Ensure the plugin is installed and activated. ```shortcode [secontactverificationform] ```