Monday, June 30, 2008

Today we needed a low cost way of sending bulk SMS messages.   With the advent of low and even free message deals,  I thought what about just hooking up an old Windows Mobile device to send messages on our behalf.

Hooking a phone up to a PC with a USB cable and a bit of socket programming to listen to request to send messages.   So on the device we have this listener.

 

image

We send messages on a TCP port in the form PHONENUMBERS|MESSAGE

Phone picks up the message and sends the SMS using this bit of code.

 

                           OutlookSession currentSession = new OutlookSession();
                            SmsMessage smsmess = new SmsMessage();
                            smsmess.Body = message;
                            foreach (string num in numbers)
                                smsmess.To.Add(new Recipient(num));
                            currentSession.SmsAccount.Send(smsmess);
                            currentSession.Dispose();

 

The whole process is invoked by a command line application on the PC, which takes the following command line -

SMSIT <ip address of phone> <phonenumbers> <message>

This application just opens a TCP socket connection to the phone and squirts down the PHONENUMBER|MESSAGE

Job done,  I can now send SMS from lots of different desktop and server applications

Monday, June 30, 2008 4:18:40 PM UTC  #    Comments [0]  | 

Theme design by Jelle Druyts

Pick a theme: