Send Yourself Texts from Apps Script

Updated February 22, 2026

In this tutorial, I will show you how to send yourself text message notifications from Apps Script using Google Voice.

Data flow: Spreadsheet to code to mobile phone message.

Prerequisites

This tutorial assumes the following prerequisites:

  1. You have a Google Voice account with a phone number. Google Voice is free and you can sign up at voice.google.com.
  2. 2. You are familiar with opening the Apps Script editor. If this is your first time, see Introduction to Apps Script.
  3. 3. You understand the basics of sending email with MailApp.sendEmail(). For a refresher, see Send email from a Google Sheet.

3 steps to send yourself text messages from Apps Script

Step 1 — Enable text-to-email forwarding in Google Voice

Google Voice has a setting that forwards every incoming text message to your Gmail inbox as an email. This forwarding mechanism is the foundation of the entire technique, so the first thing we need to do is make sure it is turned on.

Open Google Voice settings in your browser and scroll down to the Messages section. Look for the toggle labeled Forward messages to email and make sure it is enabled. If it was already on, great, move on to the next step. If you just turned it on, send a test text to your Google Voice number from another phone to confirm that a copy arrives in your Gmail inbox.

'Messages settings showing 'Forward messages to email' enabled with a toggle switch.'

Step 2 — Find your Google Voice email address

Every Google Voice number has a corresponding email address in the format {{yourGoogleVoiceNumber}.{yourPhoneNumber}.{UniqueCode}}@txt.voice.google.com. When you send an email to this address, Google Voice delivers it as a text message to the phone linked to your account. The trick is figuring out the exact address, because it includes your full phone number with the country code and no formatting characters.

Here is how to find it. From your personal phone (not your Google Voice number), send a text message to your Google Voice number. Any message will do, even a single word like "test" is fine. Because you enabled forwarding in Step 1, Google Voice will forward that text to your Gmail inbox.

Open Gmail and find the forwarded message. Click on it to open it, then look at the From address. It will look something like this:

15551234567.12364484800.Xgah671sg@txt.voice.google.com

Copy this address and save it somewhere safe, you will use it in the next step.

Step 3 — Send a text message from Apps Script

Open the Apps Script editor by navigating to script.new in your browser. This will create a new standalone script. Delete any placeholder code in the editor and paste the following function:

function sendTextMessage() {
  const phoneEmail = "{{yourGoogleVoiceEmail}}";
  const subject = "";
  const message = "Your script finished running.";
  MailApp.sendEmail(phoneEmail, subject, message);
}

Replace {{yourGoogleVoiceEmail}} with the address you found in Step 2. I am leaving the subject line as an empty string on purpose. Text messages do not have subject lines, and including one can cause the message to appear oddly on some phones.

Click the Run button (the play icon) in the toolbar. The first time you run the script, Google will ask you to authorize it to send email on your behalf. Follow the prompts to grant permission. Within a few seconds, your phone should buzz with a text message that says "Your script finished running."

That is it. It's really that simple.

Things to keep in mind

Before you build this into your scripts, there are two important limitations I want to mention.

First, the Apps Script must run under the same Google account that owns the Google Voice number. If the email originates from a different Google account, Google Voice will not deliver it as a text message. This means this technique works best for personal automations or scripts running in your own Google Workspace account.

Second, I have only tested this with a single phone number linked to my Google Voice account. If your Google Voice account has multiple linked numbers, test carefully before relying on this in production. You do not want to accidentally send automated messages to the wrong phone.

Conclusion

In this tutorial, you learned how to send yourself text message notifications from Google Apps Script using Google Voice and MailApp.sendEmail().

Thanks for reading, and happy automating.

DISCLAIMER: This content is provided for educational purposes only. All code, templates, and information should be thoroughly reviewed and tested before use. Use at your own risk. Full Terms of Service apply.