0
Thanks

A few words of thanks would be greatly appreciated.

Sending messages to mobile phones in PHP


Ask a question



Intro


We will try to forward a mail as such number@isp.com
  • Number:the phone number assigned to the mobile phone
  • ISP: your Internet service provider. E.g @free.fr, @orange.fr etc

Schematization


Here's how it should look like:
  • The message is written with the web application that runs on the HTTP server
  • E-mail is received by the SMSG server (SMS gateway) which converts it into SMS
  • The message is finally transmitted to the recipient on his mobile phone.

PHP: The mail() function


We simply use the mail() function of PHP for this. Here's an example of a code to send an SMS in php:



$to = "055xxxxxxx@nedjma.dz";
$message = "Ceci a été envoyé en PHP !"

if( mail($to, ' ', $message) ) {
echo "Message envoyé !";
}

Note and image source


Note: Please note that the SMS can take several minutes (58 minutes when tested) to reach the recipient.
  • Image source: Net.tutsplus
    Jean-François Pillou

    CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

    Learn more about the CCM team

Published by jak58. Latest update on February 21, 2011 at 07:57 AM by jak58.

This document, titled "Sending messages to mobile phones in PHP," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).
Add comment

Comments

Respond to Anonymous User