SMSNET
Guide

Send SMS From Google Sheets With Your Own Phone

To send an SMS from Google Sheets you add a short Apps Script that posts each new row to the SMSNET API. The text leaves from your own Android phone, so there is no paid SMS add-on to install.

What do I need?

A Google account, a connected phone in SMSNET, and an API key. Install the SMSNET Gateway app on any Android 8.0+ phone with a SIM, sign in, and copy the key from the final setup screen. The Android gateway guide shows every screen. Store the key in Script Properties (never in a cell).

The free plan covers 300 messages a month, 20 a day, and replies are never counted. Recipients must be in E.164 format (+15551234567). Only text people who have agreed to hear from you.

How do I send one SMS from Apps Script?

function sendSms(to, body) {
  const res = UrlFetchApp.fetch('https://smsnet.net/api/v1/messages/send', {
    method: 'post',
    contentType: 'application/json',
    headers: { 'X-API-Key': PropertiesService.getScriptProperties().getProperty('SMSNET_API_KEY') },
    payload: JSON.stringify({ to: to, body: body }),
    muteHttpExceptions: true,
  });
  const data = JSON.parse(res.getContentText() || '{}');
  if (res.getResponseCode() >= 400) throw new Error(res.getResponseCode() + ': ' + (data.error || 'failed'));
  return data;
}

Open Extensions, then Apps Script, paste the function, then open Project Settings (the gear icon), scroll to Script properties, and add SMSNET_API_KEY with your key. Test it in the console:

sendSms('+15551234567', 'Hello from Sheets!');

The response includes message_id and your remaining quota.

How do I text every row in a sheet?

Design the sheet with these columns:

ColumnPurpose
phoneE.164 number, e.g. +15551234567
messageThe text to send
statusLeave blank for pending; script writes queued, sent, failed
message_idFilled by script
sent_atFilled by script

Script that sends rows whose status is empty:

function sendPendingRows() {
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const sheet = ss.getSheetByName('SMS');
  if (!sheet) throw new Error('Sheet "SMS" not found');

  const data = sheet.getDataRange().getValues();
  if (data.length < 2) return; // header only

  const headers = data[0];
  const phoneCol = headers.indexOf('phone');
  const msgCol = headers.indexOf('message');
  const statusCol = headers.indexOf('status');
  const idCol = headers.indexOf('message_id');
  const sentCol = headers.indexOf('sent_at');

  if ([phoneCol, msgCol, statusCol, idCol, sentCol].some(i => i === -1)) {
    throw new Error('Missing required columns');
  }

  const key = PropertiesService.getScriptProperties().getProperty('SMSNET_API_KEY');
  if (!key) throw new Error('SMSNET_API_KEY not set in Script Properties');

  let dailyLimitReached = false;

  for (let r = 1; r < data.length; r++) {
    const row = data[r];
    if (row[statusCol]) continue; // already processed

    const to = String(row[phoneCol]).trim();
    const body = String(row[msgCol]).trim();
    if (!to || !body) {
      sheet.getRange(r + 1, statusCol + 1).setValue('failed: missing phone or message');
      continue;
    }

    try {
      const res = UrlFetchApp.fetch('https://smsnet.net/api/v1/messages/send', {
        method: 'post',
        contentType: 'application/json',
        headers: { 'X-API-Key': key },
        payload: JSON.stringify({ to, body }),
        muteHttpExceptions: true,
      });
      const reply = JSON.parse(res.getContentText() || '{}');
      // 429: the day's or month's allowance is used up. Stop and leave this row
      // (and the rest) blank, so the next trigger run picks them up.
      if (res.getResponseCode() === 429) {
        Logger.log('Allowance reached, stopping: ' + (reply.message || reply.error));
        break;
      }
      if (res.getResponseCode() >= 400) throw new Error(reply.error || 'failed');

      // Check daily quota from response
      const dayUsed = reply.quota?.day?.used;
      const dayLimit = reply.quota?.day?.limit;
      if (dayUsed !== undefined && dayLimit !== undefined && dayUsed >= dayLimit) {
        dailyLimitReached = true;
      }

      sheet.getRange(r + 1, statusCol + 1).setValue('queued');
      sheet.getRange(r + 1, idCol + 1).setValue(reply.message_id);
      sheet.getRange(r + 1, sentCol + 1).setValue(new Date());
      SpreadsheetApp.flush();

      Utilities.sleep(2000); // pacing: 2 seconds between sends

      if (dailyLimitReached) {
        Logger.log('Daily limit reached, stopping');
        break;
      }
    } catch (e) {
      sheet.getRange(r + 1, statusCol + 1).setValue('failed: ' + e.message);
    }
  }
}

Pacing and carrier limits apply. The free plan allows 20 messages a day; the script stops as soon as the response shows the day's limit is used, or the API answers 429, and the rows it did not reach stay blank for the next run. This is built for reminders, confirmations and notifications to people who expect them, not for marketing blasts. See measured carrier limits for what real lines carry.

How do I run it automatically?

Two options, under Triggers (the clock icon) in Apps Script:

  1. Time-driven: every 10 minutes, runs sendPendingRows. Good for batch reminders.
  2. Installable onEdit: runs when a row is edited. Good for instant confirmations.

Apps Script has its own daily limits on run time and URL fetches, and Google changes them, so check Google's current quota page if you send large batches.

How do I record the result in the sheet?

The script above writes queued and the message_id immediately, then sent_at with the timestamp. For delivery status, use a webhook (see below) or poll the API periodically with another function.

What are the limits?

  • Free plan: 300 messages/month, 20/day. Replies free and uncounted.
  • New lines ramp up to 100/day until warmed up.
  • Quiet hours and opt-out keywords (STOP, UNSUBSCRIBE) are handled automatically.
  • Carrier limits apply to personal SIMs. See measured carrier limits.
  • Google Apps Script has its own quotas (execution time, URL fetch calls). Check Google's quota page.

FAQ

How do I send an SMS from Google Sheets?

Add an Apps Script that calls https://smsnet.net/api/v1/messages/send with your API key in the X-API-Key header. The message is sent from the Android phone connected to your SMSNET account. Store the key in Script Properties, not in a cell.

Do I need a Twilio account or paid add-on?

No. SMSNET uses your own Android phone and SIM as the sender. There is no number rental and no carrier account. The free plan includes 300 messages a month and replies are never counted.

Can I send to multiple numbers from a spreadsheet?

Yes. The example script iterates rows where status is empty, sends each message, writes queued and the message_id, and pauses 2 seconds between sends. It stops when the API response shows the daily limit reached.

How do I know if a message was delivered?

Either poll GET /api/v1/messages for status updates, or register a webhook to receive message.status events (sent, delivered, failed). The webhook is signed with HMAC-SHA256; verify it in Apps Script using Utilities.computeHmacSha256Signature.

What happens if I hit the daily limit?

The API returns a 429 with the limit details. The example script checks quota.day.used >= quota.day.limit and stops. Wait for the next day or upgrade the plan.

Can I use this for marketing blasts?

SMSNET is designed for transactional and conversational messages (reminders, confirmations, notifications). Carrier terms apply to personal SIMs. For high-volume marketing, use a registered provider. See Your Own SIM or 10DLC: When Each Is Right for the honest comparison.

This is a spoke of What Is an SMS API and How to Use One. Siblings: Send an SMS from PHP, Send an SMS from Node.js. The phone comes from Turn Your Android Phone into an SMS Gateway; the agent route is What Is an MCP Server for SMS?. For order notifications, see Send Order and Delivery Notifications by SMS.

Send your first message today

Free plan, no card: 400 messages a month from your own number, with the API, webhooks and MCP included.

Get the app See pricing

Get it on Google Play

Written by , who builds SMSNET. Product facts on this page are checked against the live pricing page and the running API on the date shown above.