256 thoughts on “PHP class to send SMS using free SMS gateways

  1. bhavesh

    Hello Kiran (Admin) it would be thankful to you if u help me on using this api in Vb.net or Visual Basic , How can i use the Api in These languages ?

    Reply
    1. admin Post author

      Someone else had asked a similar question through comments sometime back. Please refer to my reply. The comment should be in the first few pages.

      Reply
  2. Bobby

    Hi Kiran

    Im getting this error when using 160by2.com

    Logging in … Sending SMS … Error encountered : Invalid Contact or Group Name 10digitnumber1,98951xxxxx

    Reply
  3. Bobby

    Hi Kiran
    Im getting this error when using 160by2.com
    Logging in … Sending SMS … Error encountered : Invalid Contact or Group Name 10digitnumber1,98564xxxxx

    Reply
    1. admin Post author

      Make the changes in example.php to include the actual mobile numbers. i.e. replace 10digitnumber1 with your own number.

      Reply
    1. admin Post author

      Can you post the exact error message ? Also refer to some of the old comments. Either curl is not enabled, or you might need a proxy.

      Reply
    1. admin Post author

      Please mention the gateway you are using. Also cross check whether you have enterered your username and password for that gateway in example.php

      Reply
  4. Abinav

    Warning: include_once(class.curl.php) [function.include-once]: failed to open stream: No such file or directory in E:\xampp\htdocs\trial5.php on line 2

    Warning: include_once() [function.include]: Failed opening ‘class.curl.php’ for inclusion (include_path=’.;E:\xampp\php\PEAR’) in E:\xampp\htdocs\trial5.php on line 2

    Warning: include_once(class.sms.php) [function.include-once]: failed to open stream: No such file or directory in E:\xampp\htdocs\trial5.php on line 3

    Warning: include_once() [function.include]: Failed opening ‘class.sms.php’ for inclusion (include_path=’.;E:\xampp\php\PEAR’) in E:\xampp\htdocs\trial5.php on line 3

    Fatal error: Class ‘sms’ not found in E:\xampp\htdocs\trial5.php on line 5

    Reply
    1. admin Post author

      Extract all the files in the downloaded zip to a directory. Ensure that the file example.php exists along with class.sms.php class.curl.php etc in the direcotry you have extracted. All the files should be uploaded to your web host or should be present in your local apache directory.

      Reply
    1. admin Post author

      I dont think there is a direct VB script to do this. But you can modify the example.php to read $_POST or $_GET variables so that you can call a single URL from VB script to send SMS.

      Reply
  5. parth

    the following error occurs :

    Warning: fopen(cookie1295172415.txt) [function.fopen]: failed to open stream: Permission denied in /home/vhosts/parth.xp3.biz/class.curl.php on line 42

    Free Web Hosting

    Reply
  6. parth

    how to use this script to add this sms sending for freesmsapi
    in blogger.com account
    i mean how to add this in a blog.

    only freesmsapi is important for me
    160by2 and way2sms are optional

    please help me out …..
    please…

    Reply
    1. chandrakanth

      dude you are awesome..i struggled so much to develop and api for the same and you already have one.. you are simply great dude.can you mail me how did you login into the way2sms using aspx..

      Reply
  7. Ramesh

    The above code is working for one day only in 160by2. The next day it stops in login error though the username and password are correct. Give me a solution to this.

    Reply
  8. Rajesh rohan

    Hii.. i am having website for love quotes.. here i would like to provide free sms service (like 160by2.com & way2sms.com)to my visiters from my website. is it possible for me and please guide me about that Service.

    Reply
  9. Rajesh rohan

    Hii.. i am having website for love quotes.. here i would like to provide free sms service (like 160by2.com & way2sms.com)to my visiters from my website. is it possible for me and please guide me about that SMS API Application.

    Reply
  10. Rajesh rohan

    Hii.. i am having website for love quotes.. here i would like to provide free sms service (like 160by2.com & way2sms.com)to my visiters from my website. is it possible for me and please guide me about that SMS API Application.

    Reply
  11. Shveta

    Curl is enabled and m trying to use 160by2..made all the reqd changes in example.php but it doesnt work. Please help me i really need this piece of code..!!!

    Logging in …
    Notice: Undefined offset: 1 in C:\xampp\htdocs\SMS-API\class.sms.php on line 128
    Sending SMS …
    Notice: Undefined offset: 1 in C:\xampp\htdocs\SMS-API\class.sms.php on line 149
    Error encountered :

    Reply
  12. George

    When i try the code fr freesms8_com this is what i get..m stuck nw..what to do..plz rep asap..!

    Logging in … Sending SMS … Error encountered

    Reply
  13. jayapalreddy

    it’s not workding

    this below error is showing in my local server

    Logging in …
    ( ! ) Fatal error: Call to undefined function curl_init() in C:\wamp\www\api\class.curl.php on line 59
    Call Stack
    # Time Memory Function Location
    1 0.0006 368344 {main}( ) ..\example.php:0
    2 0.0029 476312 sms->login( ) ..\example.php:16
    3 0.0029 476616 call_user_func ( ) ..\class.sms.php:45
    4 0.0029 476632 sms->login_way2sms( ) ..\class.sms.php:0
    5 0.0029 476744 cURL->post( ) ..\class.sms.php:62

    Reply
  14. Vishal

    Hi, this is vishal here.
    I have used your sms script but it doesn’t work, i also checked way2sms demo but it doesnot work steel got msg like ERROR ENCOUNTERED: so could u help me.

    Vishal

    Reply
  15. Macwan

    Logging in … Sending SMS … Error encountered :

    I got this type of output with “Error encoutered” message

    And i have used “freesms8_com” gateway
    plese can any one help me?

    Reply
  16. Madugundu Sandeep Kumar

    Hi Kiran,
    am getting an “Error Encountered…” how to fix this, pl pl pl help me

    with regards,
    Sandeep M

    Reply
  17. linto_c

    160by2 php code changed in previous week, please give instruction – how i create curl script for new chage, please …

    Reply
  18. linto_c

    160by2 php code changed in previous week, please give instruction – how i create curl script for new chage, please …

    Reply
  19. Pingback: press release submission

Leave a Reply to Vishal Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>