Git Product home page Git Product logo

termux-send-sms-script's Introduction

Termux Send SMS Script

A quick script to send an SMS message to a list of recipients using Termux-API and Python3 on an Android device.

No Longer WORKS with Latest Android PIE Updates.

Installation Instructions

  1. Install the Termux app from the Google Play Store: https://play.google.com/store/apps/details?id=com.termux

  2. Once installed, run Termux

  3. Update Apt

apt-get update
  1. Install Termux-API
apt-get install termux-api
  1. Test the SMS send command in Termux and allow Android to access the SMS functions on the phone
termux-sms-send -n [replace with phone number] [SMS message]
  1. Install Python
apt-get install python
  1. Install Nano text editor
apt-get install nano
  1. Create the python Script
nano sendsms.py
  1. Write the script
import subprocess

# Add Entries to the address book dictionary. Key = Name, Value = Phone Number
addressbook = {"Name1" : "+15551234567"
                "Name2" : "+15551234568"
                }
                
# Loop through the addressbook dictionary and send each number the message
for (k,v) in addressbook.items():
    
    # SMS Message Template (try to keep to within 150 characters)
    smsmessage = str("Hi " + k + " your phone number is " + v)
    
    # Use Subprocess Run Function to send SMS
    subprocess.run(["termux-sms-send", "-n", phonenumber, smsmessage])
    
    # Print confirmation of each send
    print("Sent Message to " + k + " via " + v)


# Print end of process message
print("Message sending complete")
  1. Save the python script and exit nano by pressing CTRL+X in Nano

  2. Run the script in Termux

python sendsms.py

The termux terminal will display the following

Sent Message to Name1 via +15551234567
Sent Message to Name2 via +15551234568
Message sending complete

termux-send-sms-script's People

Contributors

mauricecyril avatar

Forkers

kiniamogh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.