Hi there I am trying to send a sms message using Java with a GSM Modem I am learning from this URL: http://www.codeproject.com/Tips/492716/How-to-send-SMS-using-Java-with-a-HSDPA-Dongle Here is my code:
import com.harshadura.gsm.smsdura.GsmModem;
public class TestSMS {
private static String port = "COM1"; //Modem Port.
private static int bitRate = 9600; //this is also optional. leave as it is.
private static String modemName = "ZTE"; //this is optional.
private static String modemPin = "0000"; //Pin code if any have assigned to the modem.
private static String SMSC = "+9477000003"; //Message Center Number ex. Mobitel
public static void main(String[] args) throws Exception {
GsmModem gsmModem = new GsmModem();
GsmModem.configModem(port, bitRate, modemName, modemPin, SMSC);
gsmModem.Sender("+917350320106", "Test Message"); // (tp, msg)
}
}
I have added the various libraries to the built path of my project:
comm.jar
commons-net-3.0.1.jar
smsdura-1.0.jar
RXTXcomm.jar
However, I get this error when i run the project: Exception in thread main org.smslib.GatewayException: Comm library exception: java.lang.RuntimeException: javax.comm.NoSuchPortException
Please help