Send sms from php using way2sms [part2]

22 Jan 2010

This post is updated in and you can download from Github

How to use which i provided in my last blog

In the you can see
  • 2 files(classSms.php and sendsms.php) 
  • Folder named nusoap 
   main class file for sending sms

    demo file

Let me consider you have two files in your application
  1. The form to enter the recepiants number and message
  2. The action page of the form
 In the action page
  • Include the sms class
  • Create an object for the kitesSms class in classSms.php
                    The constructor of the kitesSms class  takes two argument
                    1.  way2sms username
                    2.   way2sms  password
                    $ob = new kitesSms("9895012345","password");
  • Call the sendSMSToMany function with the object created in the previous step
                 the sendSMSToMany function takes two arguments
                  1. The recipients  phone number/numbers
                            if more than one recipient seperate each  numbers using  ;(semicolon)
                  2. The message you want to send

                            $message=$ob->sendSMSToMany("989512345","This is a testing message");
                 3. The function returns "done" if message send is successfull
                         the return type will be stored in $message variable

That it you have done it

note:- the username and password is used is for demo purpose only
If you particularly enjoy my work, I appreciate donations via PayPal.
comments powered by Disqus