Garage & Updates

Learn about the newest features, products and client updates for all platforms

Share

Automating Skype SMS

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:

skype:+46739206106?sms

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

Share

9 thoughts on “Automating Skype SMS

  1. cbuenger said 2459 days ago

    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

  2. peter.kalmstrom.nu said 2459 days ago

    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

  3. alok-compaq said 2459 days ago

    Thanks Peter, for creating this blog. This will help me a lot to.

  4. alok-compaq said 2459 days ago

    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

  5. smohank said 2399 days ago

    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?

  6. pault7 said 2306 days ago

    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?

  7. pault7 said 2306 days ago

    Hi again,
    My bad, the ‘Reply To’ number needs to be verified before it can be used.

  8. tristanbrotherton said 2103 days ago

    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

  9. alexander.dau said 2096 days ago

    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 ?

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s