SMSCMD Code Sample download smscmd.zip

Update password file sms4mail.txt and run smscmd genkey to encrypted sms4mail.txt to smscmd.key 

  • Usage1 (password from encrypted file) : smscmd "text" "phone1,phone2,phone3" 

  • Usage2 (password from command)       : smscmd "text" "phone1,phone2,phone3" "email" "password"

 

VB Code Sample

Usage1 : smscmd "text" "phone1,phone2"  

'***** SendSMS function

Function sendsms(smstext As String, phone As String) As Variant
Dim pid As Variant
Dim sms As String

sms = """" & smstext & """ " & """" & phone & """"
pid = Shell("c:\smscmd\smscmd.exe " & sms, vbNormalFocus)       'smscmd.exe can be anywhere  
sendsms = pid

End Function

' ******Main Program to call sendsms function (change the green variable text below)

Dim Totext As String
Dim Tophone As String
Dim Retcode As Variant
 

Totext = "Put your text here maximum to 155"    'Sample text
Tophone = "447123456789,85212345678"  'Mobile # is international format with country code
Retcode = sendsms(Totext, Tophone)       'execute fail if Retcode =0

Usage2 : smscmd "text" "phone1,phone2" "email" "password"

'***** SendSMS function

Function sendsms(smstext As String, phone As String, email as String, password as String) As Variant
Dim pid As Variant
Dim sms As String

smstext=Mid(smstext, 1, 155) 'Maximum to 155 character

sms = """" & smstext & """ " & """" & phone & """ " & """" & email & """ " & """" & password & """"
pid = Shell("c:\smscmd\smscmd.exe " & sms, vbNormalFocus)
sendsms = pid

End Function

' ******Main Program to call sendsms function (change the green variable text below)

Dim Totext As String, Email as String, Password as String
Dim Tophone As String
Dim Retcode As Variant
 

Email = "mymail@gmail.com"   'your registered email in sms4mail.com
Password = "Mypassword"      'Your password in sms4mail.com.. Click here to register to get password
Totext = "Put your text here maximum to 155"    'Sample text
Tophone = "447123456789,85212345678"  'Mobile # is international format with country code
Retcode = sendsms(Totext, Tophone,Email,Password) 'execute fail if Retcode =0

  You can  and find lots of samples


JAVA Code Sample

Java Cod Sample1 - Just execute the smscmd.exe . No Catch the response

 

import java.io.IOException;

import java.io.InputStream;

 

public class ExecuteDOSCommand {

   public static void main(String[] args) {

      final String dosCommand = "cmd /c c:\\smscmd\\smscmd.exe";

      final String text = "YOUR SMS Message Here  ..........................";

      final String mobile = "YOUR mobile # here . It is international format with country code.......................";     

      try {

         final Process process = Runtime.getRuntime().exec(

            dosCommand + " " + text + " " + mobile);

           } catch (IOException e) {

         e.printStackTrace();

      }

   }

}

 

Java Cod Sample 2 - Catch the smscmd.exe response back

 

import java.io.IOException;

import java.io.InputStream;

 

public class ExecuteDOSCommand {

   public static void main(String[] args) {

      final String dosCommand = "cmd /c c:\\smscmd\\smscmd.exe";

      final String text = "YOUR SMS Message Here  ..........................";

      final String mobile = "YOUR mobile # here . It is international format with country code.......................";     

      try {

         final Process process = Runtime.getRuntime().exec(

          dosCommand + " " + text + " " + mobile);

         final InputStream in = process.getInputStream();

         int ch;

         while((ch = in.read()) != -1) {

            System.out.print((char)ch);

         }

      } catch (IOException e) {

         e.printStackTrace();

      }

   }

}

  You can  and find lots of samples


 

VC++ sample

#include "shellapi.h"

 VC ++ Code Sample

ShellExecute(NULL,"open","c:\\smscmd\\smscmd.exe",  "text mobile",NULL,SW_HIDE );

  You can  and find lots of samples


C# sample

Process.Start( "C:\\Windows\\system32\\cmd.exe", "/C C:\\smscmd\smscmd.exe  text mobile" );

  You can  and find lots of samples