Send SMS via Php

Asked

Viewed 1,179 times

6

I was using a gateway for texting (nowsms) however the evaluation period ended and I went to buy the license, U$995 to send 12 sms per minute, I did not find viable.

Searching found a Php-Serial class (https://github.com/Xowap/PHP-Serial) but I can’t send anything to the modem, always gives error when indicating the baud rate.

Has anyone ever done anything like that to help me ?

  • Are you using linux? If so, first try talking to the modem via minicom. minicom -s to configure the port. I suggest BAUD RATE 9600 8N1 to talk to the modem. If it is a USB modem, you will need to install a kernel module called usbserial .

  • 1

    Unfortunately the company I’m working for uses windows server. I’m still cracking my skull to solve this. Grateful in every way :)

  • One option is Twilio SMS. It costs US$ 0.06 per message for Brazil and US$ 0.04 for Portugal. Their API is very simple. If you’re not sending too many text messages, it might be worth it. https://www.twilio.com

  • Since they mentioned Twilio, you can use Pagueveloz. It works very well and the price is much below Twilio mainly because of the dollar and IOF price of the international transaction. API all REST, and if registering there already earn 30 SMS to test the service.

1 answer

3


The message baud rate seems to me only part of the error, you must be more specific of which error occurs.

An example you can use to detect the fault is:

  1. Open the CMD
  2. Check which port your modem uses (let’s assume it’s COM17)
  3. Execute command by CMD:

    mode COM17 xon=on BAUD=9600
    

    If the door was COM20 then the command would be:

    mode COM20 xon=on BAUD=9600
    

With this you can detect the error (if the modem has support for example)

How to check which device port (modem)

  1. Open the run or cmd
  2. Typo %SystemRoot%\system32\control.exe or open the control panel
  3. Go to "driver manager"
  4. Click on the Details tab, the name should appear and then the port, for example Modem (COM 17)

In case if the port is 17 the script should look something like:

<?php
include 'PhpSerial.php';

$serial = new PhpSerial;

$serial->deviceSet('COM17');
...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.