HomeAPI & DevSend SMS with ASP.NET

Send SMS with 🏗️ ASP.NET

Send SMS from your ASP.NET Web API or MVC controller using HttpClient with async/await — compatible with ASP.NET Core and ASP.NET Framework.

ASP.NET · HttpClient HTTPS POST v2.0
ℹ️
Before using the API, register a free iSMS account and purchase SMS credits. See the full SMS API docs for all parameters and error codes.
API Endpoints
HTTPS Endpoints — use all 3 for high availability
// Primary
https://smtpapi.vocotext.com/isms_send_all_id.php

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

// Mirror 3
https://www.isms.com.my/isms_send_all_id.php
Send SMS — ASP.NET Controller Example
ASP.NET Core · Web API Controller
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;

[ApiController]
[Route("api/[controller]")]
public class SmsController : ControllerBase
{
    // Register IHttpClientFactory in Program.cs: builder.Services.AddHttpClient();
    private readonly IHttpClientFactory _clientFactory;

    public SmsController(IHttpClientFactory clientFactory)
        => _clientFactory = clientFactory;

    [HttpPost("send")]
    public async Task<IActionResult> SendSms(string mobile, string message)
    {
        var payload = new Dictionary<string, string>
        {
            { "un",         "your_username" },
            { "pwd",        "your_password" },
            { "dstno",      mobile          },  // Full international format
            { "msg",        message         },
            { "type",       "1"             },  // 1 = ASCII, 2 = Unicode
            { "agreedterm", "YES"           },
            { "sendid",     "MyBrand"       }   // Optional, max 11 chars
        };

        var client   = _clientFactory.CreateClient();
        var response = await client.PostAsync(
            "https://smtpapi.vocotext.com/isms_send_all_id.php",
            new FormUrlEncodedContent(payload));

        var result = await response.Content.ReadAsStringAsync();

        if (result.StartsWith("2000"))
        {
            var trxId = result.Split(':')[1];
            return Ok(new { success = true, transactionId = trxId });
        }

        return BadRequest(new { success = false, error = result });
    }
}
✅ Success
2000 = SUCCESS:1143007207
// Save the transaction ID for delivery tracking
❌ Error
-1001 = AUTHENTICATION FAILED
-1003 = IP NOT ALLOWED
-1004 = INSUFFICIENT CREDITS
-1008 = MISSING PARAMETER
-1013 = INVALID TERM AGREEMENT
⚠️
Delivery Status Note (Malaysia): A 2000 response confirms submission to Telco SMSC only — not delivery to handset. For confirmed Sent → Received → Read tracking, consider WhatsApp Business API.

Ready to Integrate?

Register free, get your 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