accountName parameter must be a verified email address registered in your iSMS account. Complete the Domain Setup steps before your first API call.🚀 Overview
What You Can Send
Send one-time passwords and email verification codes securely.
Transactional emails triggered automatically by your billing system.
Bulk promotional emails to opted-in customer lists.
Automated alerts for system events, error logs, or threshold triggers.
Regular subscriber newsletters with HTML content and images.
Send PDFs, reports, and documents as email attachments.
🔗 API Endpoint
| Setting | Value |
|---|---|
| Method | POST |
| Content-Type | multipart/form-data |
| Attachments | Supported |
multipart/form-data encoding for all requests, especially when sending attachments. Standard application/x-www-form-urlencoded is sufficient for text-only emails.🔧 Domain Setup Requirements
Prepare Your Domain
Ensure you have a dedicated domain for sending emails — e.g. yourcompany.com or mail.yourcompany.com. A dedicated domain improves sender reputation.
Verify Domain Ownership
Add a verification TXT record to your domain's DNS settings. Contact iSMS support for your specific verification token.
Configure DNS Records
Set up SPF, DKIM, DMARC, MX, and CNAME records as provided by iSMS to authenticate your sending domain.
Create Sender Email
Configure the verified sender email address and display name (fromAlias) in your iSMS account. Use this as the accountName parameter.
accountName parameter must be a verified email address registered in your iSMS account. Unverified addresses will be rejected. Contact us to set up your sending domain.🧩 Request Parameters
multipart/form-data POST fields. The attachment field is optional.| Parameter | Type | Required | Description |
|---|---|---|---|
| un | String | Required | Your iSMS account username |
| pwd | String | Required | Your iSMS account password |
| toEmail | String | Required | Recipient's email address — e.g. recipient@domain.com |
| subject | String | Required | Email subject line |
| body | String | Required | Email body content — supports plain text or HTML |
| accountName | String | Required | Verified sender email address (registered in your iSMS account) — e.g. noreply@yourcompany.com |
| fromAlias | String | Required | Display name shown to the recipient — e.g. My Company Notifications |
| agreedterm | String | Required | Must be set to YES to confirm acceptance of iSMS Terms & Conditions |
| attachment | File | Optional | File attachment — submitted as a multipart file upload. Supports PDF, images, documents, etc. |
🐘 PHP Example — Text/HTML Email
http_build_query() for simple form-encoded POST when no file attachment is needed.<?php $url = 'https://smtpapi.vocotext.com/isms_send_email_smtp_api.php'; $postData = [ 'un' => 'your_username', 'pwd' => 'your_password', 'toEmail' => 'recipient@domain.com', 'subject' => 'Your Invoice #INV-2024-001', 'body' => '<h2>Thank you for your order</h2> <p>Your invoice is ready. Please find the details below.</p>', 'accountName' => 'noreply@yourcompany.com', // Must be verified 'fromAlias' => 'My Company Billing', 'agreedterm' => 'YES' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'cURL error: ' . curl_error($ch); } else { echo 'Response: ' . $response; } curl_close($ch); ?>
📎 PHP Example — With File Attachment
CURLFile to properly encode the file in a multipart request. Do not use http_build_query() — pass the array directly to CURLOPT_POSTFIELDS.Attachment Notes
- ✦ Use
CURLFile(PHP 5.5+) for file uploads — avoid deprecated@filepathsyntax - ✦ Do not use
http_build_query()when sending attachments — it does not handle file uploads - ✦
mime_content_type()auto-detects the MIME type of the file - ✦ Maximum attachment size depends on your server's PHP
post_max_sizeandupload_max_filesizesettings
<?php $url = 'https://smtpapi.vocotext.com/isms_send_email_smtp_api.php'; // File attachment — can be a path from $_FILES or a server-side path $attachmentPath = '/path/to/invoice.pdf'; $attachmentName = 'invoice_2024.pdf'; $postData = [ 'un' => 'your_username', 'pwd' => 'your_password', 'toEmail' => 'client@domain.com', 'subject' => 'Your Invoice is Attached', 'body' => '<p>Please find your invoice attached.</p> <p>Thank you for your business!</p>', 'accountName' => 'noreply@yourcompany.com', 'fromAlias' => 'My Company Billing', 'agreedterm' => 'YES' ]; // Attach file using CURLFile (PHP 5.5+) if (file_exists($attachmentPath)) { $postData['attachment'] = new CURLFile( $attachmentPath, mime_content_type($attachmentPath), // Auto-detect MIME $attachmentName ); } $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Pass array directly — NOT http_build_query() — so CURLFile works curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'cURL error: ' . curl_error($ch); } else { echo 'Response from API: ' . $response; } curl_close($ch); ?>
Handling File Upload from Web Form
<?php if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Get file details from uploaded form $_FILES $attachmentPath = $_FILES['attachment']['tmp_name'] ?? null; $attachmentName = $_FILES['attachment']['name'] ?? null; $url = 'https://smtpapi.vocotext.com/isms_send_email_smtp_api.php'; $postData = [ 'un' => $_POST['un'], 'pwd' => $_POST['pwd'], 'toEmail' => $_POST['toEmail'], 'subject' => $_POST['subject'], 'body' => $_POST['body'], 'accountName' => $_POST['accountName'], 'fromAlias' => $_POST['fromAlias'], 'agreedterm' => 'YES' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if ($attachmentPath && $attachmentName) { $postData['attachment'] = new CURLFile( $attachmentPath, mime_content_type($attachmentPath), $attachmentName ); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); // Array — NOT encoded } else { curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); } $response = curl_exec($ch); curl_close($ch); echo 'Response: ' . $response; } ?>
🔷 C# Example — Windows Forms / .NET
HttpClient and MultipartFormDataContent. Compatible with .NET Framework and .NET Core.using System; using System.IO; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; public class EmailSender { private static readonly string apiUrl = "https://smtpapi.vocotext.com/isms_send_email_smtp_api.php"; public static async Task<string> SendEmailAsync( string username, string password, string toEmail, string subject, string body, string accountName, string fromAlias, string attachmentPath = null) { using var client = new HttpClient(); using var formData = new MultipartFormDataContent(); // Required fields formData.Add(new StringContent(username), "un"); formData.Add(new StringContent(password), "pwd"); formData.Add(new StringContent(toEmail), "toEmail"); formData.Add(new StringContent(subject), "subject"); formData.Add(new StringContent(body), "body"); formData.Add(new StringContent(accountName), "accountName"); formData.Add(new StringContent(fromAlias), "fromAlias"); formData.Add(new StringContent("YES"), "agreedterm"); // Optional attachment if (!string.IsNullOrEmpty(attachmentPath) && File.Exists(attachmentPath)) { var fileContent = new ByteArrayContent( File.ReadAllBytes(attachmentPath)); fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse("multipart/form-data"); formData.Add(fileContent, "attachment", Path.GetFileName(attachmentPath)); } var response = await client.PostAsync(apiUrl, formData); return await response.Content.ReadAsStringAsync(); } } // Usage: // var result = await EmailSender.SendEmailAsync( // "your_username", "your_password", // "client@domain.com", "Your Invoice", // "<p>Please find attached.</p>", // "noreply@yourcompany.com", "My Company", // @"C:\invoices\inv001.pdf" // optional // );
Need Email API Access or Domain Setup Help?
Our team will help you verify your sending domain, configure DNS records, and test your first email delivery.