Smartbooth.com SMSCMD V1.0 — Code Samples

Call smscmd.exe from your program (VB / Java / C# / C++). SMSCMD prints server response to STDOUT.

Recommended path: C:\\smscmd\\smscmd.exe Password file: smscmd.key or smscmdfile.txt Phones separated by comma

Command line usage

Usage 1: credentials from file (smscmd.key preferred)

smscmd "text" "phone1,phone2,phone3"

Usage 2: credentials from arguments

smscmd "text" "phone1,phone2,phone3" "email" "password"
If your text contains UTF-8/Unicode or special characters, keep it inside quotes. The newer builds handle UTF‑16 console input and convert to UTF‑8 before sending.

VB / VB6 sample (Shell)

Usage 1 (credentials from file):

' SendSMS function
Public Function SendSMS(ByVal smstext As String, ByVal phone As String) As Variant
    Dim cmd As String
    cmd = """" & smstext & """ """ & phone & """"
    SendSMS = Shell("C:\\smscmd\\smscmd.exe " & cmd, vbNormalFocus)
End Function

' Example
Dim Totext As String
Dim Tophone As String
Dim Ret As Variant

Totext = "Put your text here"
Tophone = "07123456789,+85212345678"
Ret = SendSMS(Totext, Tophone)

Usage 2 (pass email/password):

Public Function SendSMS2(ByVal smstext As String, ByVal phone As String, ByVal email As String, ByVal password As String) As Variant
    Dim cmd As String
    cmd = """" & smstext & """ """ & phone & """ """ & email & """ """ & password & """"
    SendSMS2 = Shell("C:\\smscmd\\smscmd.exe " & cmd, vbNormalFocus)
End Function

Java sample

Sample 1 — execute only (no output capture):

import java.io.IOException;

public class SendSms {
  public static void main(String[] args) throws IOException {
    String exe = "C:\\\\smscmd\\\\smscmd.exe";
    String text = "YOUR SMS Message Here";
    String phones = "+447121027123,+12048991234";

    // Usage 1: password from file
    new ProcessBuilder(exe, text, phones).start();
  }
}

Sample 2 — capture response (stdout):

import java.io.*;
import java.nio.charset.StandardCharsets;

public class SendSmsWithOutput {
  public static void main(String[] args) throws Exception {
    String exe = "C:\\\\smscmd\\\\smscmd.exe";
    Process p = new ProcessBuilder(exe, "Hello", "+16615561234").redirectErrorStream(true).start();

    try (BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream(), StandardCharsets.UTF_8))) {
      String line;
      while ((line = br.readLine()) != null) {
        System.out.println(line);
      }
    }
    p.waitFor();
  }
}

C# sample

using System;
using System.Diagnostics;

class SendSms {
  static void Main() {
    var exe = @"C:\\smscmd\\smscmd.exe";
    var text = "Hello World!";
    var phones = "+447121027123,+16615454321";

    var psi = new ProcessStartInfo {
      FileName = exe,
      Arguments = $"\\\"{text}\\\" \\\"{phones}\\\"",
      UseShellExecute = false,
      RedirectStandardOutput = true,
      RedirectStandardError = true,
      CreateNoWindow = true
    };

    using (var p = Process.Start(psi)) {
      Console.WriteLine(p.StandardOutput.ReadToEnd());
      Console.Error.WriteLine(p.StandardError.ReadToEnd());
      p.WaitForExit();
      Console.WriteLine("ExitCode=" + p.ExitCode);
    }
  }
}

C++ sample (ShellExecute)

#include <windows.h>
#include <shellapi.h>

int main() {
  const char* exe = "C:\\\\smscmd\\\\smscmd.exe";
  const char* args = "\\\"Hello\\\" \\\"+447121027123\\\"";
  ShellExecuteA(NULL, "open", exe, args, NULL, SW_HIDE);
  return 0;
}
Prefer CreateProcess if you need to capture output; ShellExecute is the simplest fire‑and‑forget method.

Notes

  • If you see garbled UTF-8/Unicode language in your own console, set codepage to UTF‑8: chcp 65001 (optional). SMSCMD still sends correctly.
  • For secure deployment: use smscmd.key instead of plaintext smscmdfile.txt.
  • Use -debug to validate arguments without sending SMS (if enabled in your build).