Re: sending SMS messages to mobile phones from PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can send an SMS via kapow easily using PHP.
Here are a few examples of how you can send (via HTTP Get/Post & email).

assuming you have defined a couple of variables;

$user = "youruser";
$pass = "yourpass";
$mob = "447971325173";
$message = urlencode("This is just a test SMS message from kapow.co.uk");

You can send the message via HTTP Get using the fopen() function, like this;

fopen("http://www.kapow.co.uk/scripts/sendsms.php?username=$user&password=$pass&mobile=$mob&sms=$message","r";)

That's it... your message will be on it's way (and should arrive within about 10 seconds).

Alternatively you could send via email by using the mail() function;

mail("$mob@xxxxxxxxxxx","$message","$user\n$pass");

If you have set-up your account to automatically trust your sending address then you don't need to include the user/pass details in the email, so it'd work with just;

mail("$mob@xxxxxxxxxxx","$message","");

You can also make an HTTP Post. The best way to do this is by writing a quick HTTP Post function using sockets... you should be able to find an example on this mailing list. If not then I'll happily send you one.

Best regards,

Andy

Andrew Cowles
====================================
KAPOW! SMS Communication Solutions
WEB: http://www.kapow.co.uk/
EMAIL: andrew.cowles@xxxxxxxxxxx
TEL: 0870 757 1610 or FAX: 0870 757 1615
====================================
Cygnet Internet Services Ltd ( http://www.cygnet.co.uk/ )
====================================

Thanks. Your SMS service looks ideal for what I need but how do I make an
HTTP request from PHP to kapow?
Can I just use fopen()?
Please can you give a PHP example.

We operate an SMS Gateway service (http://www.kapow.co.uk/) which would do
exactly what you need.
It's been reliably sending SMS since 1995 - and MANY of our clients use
PHP.

What you'd probably want to do is make an HTTP Get / Post request directly
from your script to our servers, alternatively you can use our
Email-to-SMS
interface and then just generate an email.

Using either method with PHP should get you up and running in a few
minutes.

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux