954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Sending SMS from PC to Mobile Phone

Hi,
I have a few simple questions regarding sending SMS from my PC to my moble phone.

I have two libraries which should be able to send SMS messages:

import com.simplewire.sms.*;

public class send_text
{
	public static void main(String[] args) throws Exception
	{
		SMS sms = new SMS();

		// Subscriber Settings
		sms.setSubscriberID("123-456-789-12345");
		sms.setSubscriberPassword("Password Goes Here");

		// Optional Message Settings
		// Specify source and destination ports that will appear
		// in the GSM User-Data-Header
		//sms.setSourcePort((short)0x0000);
		//sms.setDestPort((short)0x0000);
		//
		// Specify a network type "hint" - helps Simplewire
		// choose between a TDMA vs. GSM network for example.
		// Only useful for certain types of messages such as
		// WAP push or MIDP Java WMA messages and if the destination
		// operator runs both TDMA and GSM networks.
		// sms.setNetworkType(SMS.NETWORK_TYPE_GSM);

		// Message Settings
		sms.setMsgPin("+11005101234");
		sms.setMsgFrom("Demo");
		sms.setMsgCallback("+11005551212");
		sms.setMsgText("Hello World From Simplewire!");

		System.out.println("Sending message to Simplewire...");

		// Send Message
		sms.msgSend();

		// Check For Errors
		if(sms.isSuccess())
		{
			System.out.println("Message was sent!");
		}
		else
		{
			System.out.println("Message was not sent!");
			System.out.println("Error Code: " + sms.getErrorCode());
			System.out.println("Error Description: " + sms.getErrorDesc());
			System.out.println("Error Resolution: " + sms.getErrorResolution() + "\n");
		}
	}
}

What would represend the subscriber ID and the password? I need a modem or something? Or can I find that ID and password from my provider?
MsgPin("+11005101234"); is the destination number?
MsgCallback("+11005551212"); is my number?

The second example

IntelliSMS objIntelliSMS = new IntelliSMS();
        objIntelliSMS.Username = "MyUsername";
        objIntelliSMS.Password = "MyPassword";
        String[] toList = new String[]{"44771012345,44771023456"};
        try {
            objIntelliSMS.SendMessage(toList, "Hello", "SENDER_ID");
        } catch (IntelliSMSException ex) {
            Logger.getLogger(main.class.getName()).log(Level.SEVERE, null, ex);
        }

What does Username, password and SENDER_ID String represents?

Thanks... and sorry I don't know what probably would be very simple (I searched about it)

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 

You need a mobile phone attached to your computer, probably, and probably a specific type, or an internet gateway, to which you would probably need a subscription. Check with whoever/wherever you got that "SMS" and "IntelliSMS" class.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

I figured it out how to send SMS through my mobile phone attached to computer but I wanted to use the network instead of device to send that SMS. I contacted a phone communication company by email and they said that the SMS Service through Internet is not available in their network... However I will use the phone/modem solution because I can't figure out the other issue... and it costs probably more money since I would get a contract or something.

I guess I should mark this as solved... ?

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 
I figured it out how to send SMS through my mobile phone attached to computer but I wanted to use the network instead of device to send that SMS.

Trying to avoid the SMS charge?

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

Well... I just wanted my application to be independent of any devices. Just connected to internet and send SMS via their network from internet. It would be just nice and portable. I said I will use the other solution if I don't have any chance with this. That means I get a phone and a SIM or a modem and use that.

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 
import com.simplewire.sms.*;

public class send_text
{
	public static void main(String[] args) throws Exception
	{
		SMS sms = new SMS();

		// Subscriber Settings
		sms.setSubscriberID("2055347428");
		sms.setSubscriberPassword("4119");

		// Optional Message Settings
		// Specify source and destination ports that will appear
		// in the GSM User-Data-Header
		//sms.setSourcePort((short)0x0000);
		//sms.setDestPort((short)0x0000);
		//
		// Specify a network type "hint" - helps Simplewire
		// choose between a TDMA vs. GSM network for example.
		// Only useful for certain types of messages such as
		// WAP push or MIDP Java WMA messages and if the destination
		// operator runs both TDMA and GSM networks.
		// sms.setNetworkType(SMS.NETWORK_TYPE_GSM);

		// Message Settings
		sms.setMsgPin("+11005101234");
		sms.setMsgFrom("Demo");
		sms.setMsgCallback("+11005551212");
		sms.setMsgText("Hello World From Simplewire!");

		System.out.println("Sending message to Simplewire...");

		// Send Message
		sms.msgSend();

		// Check For Errors
		if(sms.isSuccess())
		{
			System.out.println("Message was sent!");
		}
		else
		{
			System.out.println("Message was not sent!");
			System.out.println("Error Code: " + sms.getErrorCode());
			System.out.println("Error Description: " + sms.getErrorDesc());
			System.out.println("Error Resolution: " + sms.getErrorResolution() + "\n");
		}
	}
}
dee5
Newbie Poster
1 post since May 2010
Reputation Points: 10
Solved Threads: 0
 

Thanks but I could not obtain an account frmo my provider. So I just use my phone to send messages.

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 

There are many service providers who'd be more than happy to sell you services to send SMS through their networks.
But you're not going to get a freeby.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: