HomeAPI & DevSend SMS with PHP

Send SMS with PHP

Integrate iSMS bulk SMS into your PHP application using our HTTPS API. Send single or multiple SMS messages with cURL — no SDK required.

PHP · cURL HTTPS POST v2.0
ℹ️
Before using the API, register a free iSMS account and purchase SMS credits. See the full SMS API documentation for all parameters and error codes.
Step 1 — API Endpoint
HTTPS Endpoint (use any mirror)
// Primary
https://smtpapi.vocotext.com/isms_send_all_id.php

// Mirror 2
https://smtpapi2.vocotext.com/isms_send_all_id.php

// Mirror 3 (fallback)
https://www.isms.com.my/isms_send_all_id.php
Step 2 — Send a Single SMS
PHP · cURL POST
<?php

$apiUrl = 'https://smtpapi.vocotext.com/isms_send_all_id.php';

$params = [
    'un'          => 'your_username',    // iSMS account username
    'pwd'         => 'your_password',    // iSMS account password
    'dstno'       => '601X-XXXXXXX',     // Recipient — full international format
    'msg'         => 'Hello from iSMS!', // Message body (URL-encoded auto by http_build_query)
    'type'        => '1',               // 1 = ASCII (English/BM), 2 = Unicode (Chinese/Arabic)
    'agreedterm'  => 'YES',             // Must be YES
    'sendid'      => 'MyBrand',         // Optional: Sender ID (max 11 chars, alphanumeric)
];

$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_POST,            true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_TIMEOUT,        30);
curl_setopt($ch, CURLOPT_POSTFIELDS,     http_build_query($params));

$response = curl_exec($ch);
$curlError = curl_error($ch);
curl_close($ch);

if ($curlError) {
    echo 'Connection error: ' . $curlError;
} elseif (strpos($response, '2000') !== false) {
    // Success — extract transaction ID
    $trxId = explode(':', $response)[1] ?? '';
    echo 'SMS sent! Transaction ID: ' . trim($trxId);
} else {
    echo 'Failed: ' . $response; // e.g. -1004 = Insufficient credits
}
Step 3 — Send to Multiple Recipients
Separate multiple numbers with semicolons ; — recommended max 30 numbers per API call for reliability.
PHP · Multiple Recipients
$recipients = ['601X-XXXXXXX', '601X-XXXXXXX', '601X-XXXXXXX'];

$params['dstno'] = implode(';', $recipients); // Semicolon-separated
$params['msg']   = 'Dear customer, your order is confirmed!';

// ... same cURL setup as above
API Response
✅ Success
2000 = SUCCESS:1143007207

// 2000 = accepted by Telco SMSC
// 1143007207 = Transaction ID (save for delivery tracking)
❌ Error
-1001 = AUTHENTICATION FAILED
-1003 = IP NOT ALLOWED
-1004 = INSUFFICIENT CREDITS
-1008 = MISSING PARAMETER
-1013 = INVALID TERM AGREEMENT
⚠️
Delivery Status Note: A 2000 response confirms submission to the Telco SMSC only — not delivery to the recipient's handset. Malaysian telcos do not provide handset-level DLR by default. For confirmed handset delivery tracking, consider WhatsApp Business API (WABA).

Ready to Integrate?

Register free, get API credentials, and start sending in minutes.

📱 SMS Coverage — All Countries Worldwide

A B C D E F G H I J K L M N O P Q R S T U V Y Z