Download the PHP package pratiksahu2003/smscountry-php-sdk without Composer

On this page you can find all versions of the php package pratiksahu2003/smscountry-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smscountry-php-sdk

SMS Gateway (SMSCountry) — PHP SDK

Package: pratiksahu2003/smscountry-php-sdk
Version: 1.0.0
Last updated: 24 June 2026
Author: Pratik Sahu · [email protected]
Repository: github.com/Pratiksahu2003/smscountry-php-sdk
API reference: SMS Country HTTP API Documentation

Framework-agnostic PHP Composer library to send SMS, check balance, fetch delivery reports, and store every attempt in a database log table. Works in plain PHP, Laravel, Symfony, CodeIgniter, WordPress, and any PHP project.


Table of contents

  1. Features
  2. Requirements
  3. Installation
  4. Environment variables
  5. Quick setup (.env)
  6. Database log table
  7. Implementation guides
    • Plain PHP / Core PHP
    • Laravel
    • CodeIgniter 4
    • Symfony
    • WordPress / WooCommerce
  8. Sending SMS
  9. Balance & delivery reports
  10. Delivery webhook callback
  11. Message types
  12. Delivery status codes
  13. Troubleshooting
  14. Development & testing
  15. License

Features

Feature Description
Single SMS Send to one mobile number
Bulk SMS Same message to many numbers
Personalized SMS Different message per number in one API call
Credit balance Check remaining SMS credits
Delivery reports Pull reports by date range
Auto country code Prefix local numbers with SMS_COUNTRY_DEFAULT_COUNTRY_CODE
Database logging Every send logged to smscountry_logs
Laravel ready Auto-discovery, migration, Eloquent model, Facade
Webhook handler Update delivery status from SMS Country callback

Requirements

Requirement Version
PHP 8.1 or higher
Guzzle HTTP 7.x (installed via Composer)
Database MySQL / MariaDB / PostgreSQL (for SMS logs)
PDO extension Required for plain PHP logging
Laravel 10+ (optional, for Laravel integration)

Installation


Environment variables

Use these variables in any PHP project. They are the standard configuration for the SMS Country gateway.

Variable Required Example Description
SMS_COUNTRY_AUTH_KEY Yes myaccount SMS Country username (API param: User)
SMS_COUNTRY_AUTH_TOKEN Yes your_secret_password SMS Country password (API param: passwd)
SMS_COUNTRY_BASE_URL No https://api.smscountry.com API base URL (endpoints are built from this)
SMS_COUNTRY_SENDER_ID No SUGNTA Approved sender ID (API param: sid)
SMS_COUNTRY_DEFAULT_COUNTRY_CODE No 91 Auto-prefix local numbers (India = 91)
SMS_COUNTRY_DELIVERY_REPORT No true Request delivery report (DR=Y)
SMS_COUNTRY_ENCODE_MESSAGES No true Encode special HTTP characters in message
SMS_COUNTRY_LOGGING No true Save every SMS to database log table
SMS_COUNTRY_LOGS_TABLE No smscountry_logs Custom log table name

Legacy aliases (still supported): SMSCOUNTRY_USERNAME, SMSCOUNTRY_PASSWORD, SMSCOUNTRY_SENDER_ID

How credentials map to the API


Quick setup (.env)

Copy this into your project .env file and replace with your real credentials from SMS Country:

Mobile number examples with SMS_COUNTRY_DEFAULT_COUNTRY_CODE=91:

You send API receives
9876543210 919876543210
09876543210 919876543210
919876543210 919876543210 (unchanged)
+91 98765 43210 919876543210

Database log table

When logging is enabled, every SMS is stored in smscountry_logs.

Create table — plain SQL

Or run manually from database/schema/smscountry_logs.sql.

Create table — Laravel

Log table columns

Column Type Description
id BIGINT Auto-increment primary key
job_id VARCHAR(64) Message ID from API response OK:515789649
mobile_number VARCHAR(255) Destination number(s) with country code
message TEXT SMS body sent
sender_id VARCHAR(32) Sender ID used (SUGNTA)
message_type VARCHAR(8) N, LNG, OL, etc.
delivery_report BOOLEAN Whether DR was requested
send_type ENUM single, bulk, multiple
status ENUM pending → sent or failed
api_response TEXT Raw API response
error_message TEXT Error text on failure
delivery_status TINYINT 0–11 delivery code
delivery_status_label VARCHAR(64) Human-readable delivery status
delivered_at DATETIME Delivery timestamp
created_at / updated_at DATETIME Timestamps

Implementation guides

1. Plain PHP / Core PHP

Step 1 — Install

Step 2 — Set environment variables (Apache/Nginx, .env loader, or server config)

Step 3 — Create log table

Step 4 — Send SMS

Step 5 — Check balance


2. Laravel

Step 1 — Install

Step 2 — Add to .env

Step 3 — Publish config & migration

Step 4 — Send via Facade

Step 5 — Inject in a Service / Controller

Step 6 — View SMS logs


3. CodeIgniter 4

.env

app/Config/Services.php

Controller


4. Symfony

.env

config/services.yaml

Usage in a service


5. WordPress / WooCommerce

wp-config.php or plugin .env

Plugin snippet


Sending SMS

Single SMS

Bulk SMS (same message, many numbers)

Personalized SMS (different message per number)

With custom sender ID per call


Balance & delivery reports

Check SMS credit balance

API endpoint: {BASE_URL}/SMSCwebservice_User_GetBal.asp

Fetch delivery reports (auto-updates log table)

API endpoint: {BASE_URL}/smscwebservices_bulk_reports.aspx


Delivery webhook callback

Register your callback URL with SMS Country. When a delivery update arrives, handle it like this:

Plain PHP

Laravel route


Message types

Per official API documentation:

PHP Enum API mtype Use case
MessageType::Normal N Standard text SMS (max 160 chars)
MessageType::Unicode LNG Unicode — Arabic, Hindi, Chinese, etc. (max 70 chars)
MessageType::Hexadecimal OL Hex-encoded Unicode content
MessageType::Ringtone R Ringtone messages
MessageType::Picture P Picture messages
MessageType::Logo L Logo messages
MessageType::Flash F Flash SMS
MessageType::WapPush WP WAP push
MessageType::LongSms LS Long SMS (multi-part)

Delivery status codes

Code Status Meaning
0 Queued Message in queue
1 SubmittedToCarrier Submitted to carrier
2 Undelivered Not delivered
3 Delivered Successfully delivered
4 Expired Message expired
8 Rejected Rejected by gateway
9 Sent Message sent
10 OptedOut Number opted out
11 InvalidMobile Invalid mobile number

Use in PHP:


Troubleshooting

Error / Issue Cause Fix
Invalid User Name!! Wrong SMS_COUNTRY_AUTH_KEY Verify username in SMS Country account
Invalid Password!! Wrong SMS_COUNTRY_AUTH_TOKEN Reset password in account panel
Insufficient Balance!!! No SMS credits Top up at smscountry.com
Invalid mobile number(s) Missing country code Set SMS_COUNTRY_DEFAULT_COUNTRY_CODE=91
SMS not delivered Unapproved sender ID Use approved ID or set SMS_COUNTRY_SENDER_ID=SUGNTA
Special chars broken Encoding issue Keep SMS_COUNTRY_ENCODE_MESSAGES=true
No log in database Logging disabled Set SMS_COUNTRY_LOGGING=true and run migration

Common API response formats


Development & testing

Package info

Item Value
Author Pratik Sahu · [email protected]
Repository Pratiksahu2003/smscountry-php-sdk
Package pratiksahu2003/smscountry-php-sdk
Namespace SMSCountry\
Version 1.0.0
PHP ^8.1
License MIT

License

MIT — see LICENSE.


Author & support: Pratik Sahu · [email protected] · Report an issue

SMS Country API: Developers · API Documentation


All versions of smscountry-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pratiksahu2003/smscountry-php-sdk contains the following files

Loading the files please wait ...