PHP Classes

PHP SMS Sender: Send, receive and delete SMS messages using Gammu

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-07-13 (2 months ago) RSS 2.0 feedNot enough user ratingsTotal: 66 This week: 1All time: 10,242 This week: 102Up
Version License PHP version Categories
php-sms 1.0.0MIT/X Consortium ...5.6PHP 5, Wireless and Mobile
Description 

Author

This package can send, receive and delete SMS messages using Gammu.

It can execute the Gammu program installed in the same computer on which PHP runs to perform several operations with SMS messages associated with a given phone number.

Currently, it can:

- Retrieve the phone device connected to the current computer that Gammu is accessing

- Send a given text message via SMS

- Delete a given SMS message or all messages that were received by the phone device

- Get all the contacts and numbers of the phone device

Picture of Juan Camacho
  Performance   Level  
Name: Juan Camacho <contact>
Classes: 5 packages by
Country: Spain Spain
Innovation award
Innovation award
Nominee: 2x

Details

SMS Library

This is a PHP library for interacting with SMS functionality using Gammu.

Table of Contents

Installation

Requirements

  • Runs on PHP 5.6 or above
  • Recomended PHP 7 or above
  • Gammu installed and configured
  1. Clone the repository:

    git clone https://github.com/your-username/sms-library.git
    
  2. Install the library dependencies using Composer:
    composer install
    
    ## Usage
    ### Initialize the SMS object
    
    use SMS\SMS;

$sms = new SMS('/path/to/gammu', '/path/to/config', 'section_name');

### Send an SMS

$number = '+1234567890'; $message = 'Hello, World!';

$response = ''; $sms->send($number, $message, $response);

if ($response) {

echo "SMS sent successfully!\n";

} else {

echo "Failed to send SMS.\n";

}

### Delete an SMS

$folder = 'inbox'; $start = 1; $stop = 10;

$response = ''; $sms->delete($folder, $start, $stop, $response);

if ($response) {

echo "SMS deleted successfully!\n";

} else {

echo "Failed to delete SMS.\n";

}

### Get SMS Messages

$messages = $sms->getMessages();

// Process and display the messages foreach ($messages as $folder => $messageList) {

foreach ($messageList as $messageId => $message) {
    // Process individual message data
}

}

### Get Phonebook Contacts

$contacts = $sms->getPhoneBook();

// Process and display the contacts foreach ($contacts as $index => $contact) {

// Process individual contact data

}

## Features
- Send SMS messages
- Delete SMS messages
- Retrieve SMS messages
- Access phonebook contacts

## Contributing
Contributions are welcome! Here's how you can contribute:

1. Fork the repository.
2. Create a new branch.
3. Make your changes.
4. Test your changes.
5. Submit a pull request.

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file SMS.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:66
This week:1
All time:10,242
This week:102Up