Automating Skype SMS
By
Peter Kalmström on August 31, 2006 in .
Just got a question from Alok in India. He wanted to build a system for sending sms messages confirming parcels sent to his customers. Thought this would be something quite useful for others also.
There are several ways of doing this.
The simplest way is to do it semi-manually using the Skype URI syntax. A link such as this works:
That kind of link works for anyone with Skype (and Skype Credits). Nothing needs to be installed, no authentication etc. However, that actually doesn't send the message, it just opens up a sms window with the phone number filled in. Can be useful but if you want to go a few steps further you need to automate Skype using the Skype API. First you need to reference the Skype COM API in C# as seen here:
Next step is to add a few controls to the form:
Then you would write some code like the following (in C#):
...
public partial class Form1 : Form
{
private SKYPE4COMLib.SkypeClass objSkype = new SKYPE4COMLib.SkypeClass();
public Form1()
{
InitializeComponent();
}private void button1_Click(object sender, EventArgs e)
{
objSkype.SendSms(txtPhoneNumber.Text, txtSMSText.Text , "+46739206106");
}
}
The above code sends the message in the txtSMSText textbox. No dialogs - the message just gets sent. From code you also get a verification that the message was actually sent successfully. Note that the third parameter, the ReplyToNumber only works for numbers that are already validated. The validation is done by going into Tools-Options-SMS in Skype:
Of course, the above simply gives you a replacement for the Skype Send SMS dialog but of course you could automate sending sms messages from your order entry system, crm system etc ...
Hope that gives you some ideas for how you can use sms in your development








Comments
very cool. we have just added this to our next update of mcePhone for Skype: http://thegreenbutton.com/forums/thread/129974.aspx .
Now you can send SMS from your TV
cbuenger | Thursday, Aug 31
Thanks Christophe,
Very nice - have to get myself a MCE soon! Yours might just be the killer app that decides for me!
Best of luck to you!
Peter
peter.kalmstrom.nu | Thursday, Aug 31
Thanks Peter, for creating this blog. This will help me a lot to.
alok-compaq | Thursday, Aug 31
Peter,
From yesterday updates I like to bring some issues I found while testing the SMS.
In order to authenticate your mobile it works file with that and it sends a SMS to your mobile phone with PIN Code. Then using that code I am able to authenticate too.
But when you try to sent SMS out to other mobile phone it did not delivered. I tried to sent it to US number from my India connection.
Same thing happened when my friend from US tried.
Thanks
Alok
alok-compaq | Thursday, Aug 31
Does skype support 2 way sms. ie. I would like to send an sms from my application and the application should also be able to recieve the response sms.
Is that possible?
smohank | Monday, Oct 30
Hi,
I have copied the code, but when I includethe 'Reply To' number I get the error "SMS: SET SMS: failed".
It works fine without the 'Reply To' number (ie a blank string "")
Any ideas?
pault7 | Wednesday, Jan 31
Hi again,

My bad, the 'Reply To' number needs to be verified before it can be used.
pault7 | Wednesday, Jan 31
I would love to have the ability to forward some emails I recieve to my phone via SMS.
I could create a rule in OSX mail, but does anyone suggest the most effeciant way to interface with skype? I am guessing I could not do it with applescript.
It would be neat if the OSX skype had SMS as an automater action
tristanbrotherton | Wednesday, Aug 22
the SKPYE SMS UIR works fne but I need a uri with the message data, so that i can send the complete sms from a application to skype. May be like this:
skype:+46739206106?sms&text="this is the demo text".
Does this work currently ?
alexander.dau | Wednesday, Aug 29