Skip to main content

Send SMS via Gmail SMTP servers.

Project description

pysendsms

pysendsms is a quick and simple way to use python to send SMS via Gmail SMTP servers to known a cell carrier.

Installation

Use the package manager pip to install pysendsms.

pip install pysendsms

Requires

  • A Gmail account with app specific password enabled for use. Manage Google Apps
  • Knowledge of which cell carrier provider the receiving party uses.

Usage

Import the library and create an SMS Object utilizing your gmail account and an application password created within your Google account.

import pysendsms

sms = pysendsms.SMS('<username>@gmail.com', '<app-password>')

Create an Contact object using the persons phone number and select a carrier from the available options.

CARRIERS is a dictionary loaded from a json file in the project that can be checked for available carriers that can be used for messaging.

contact = pysendsms.Contact('311-555-2368', 'AT&T')

Use the SMS.send() method of your SMS object, passing the Contact and the message you would like to send as a string.

sms.send(contact, 'Hello, World!')

SMS.send() can also accept a list of contacts for sending out group messages.

group = [contact, contact, contact, contact]

sms.send(group, 'Everyone gets a message!')

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysendsms-0.1.8.tar.gz (7.1 kB view details)

Uploaded Source

File details

Details for the file pysendsms-0.1.8.tar.gz.

File metadata

  • Download URL: pysendsms-0.1.8.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for pysendsms-0.1.8.tar.gz
Algorithm Hash digest
SHA256 eee278feb596fd482f1134a1cfc9bdd67dc459d1a90d946c82587ba281487f44
MD5 4eb5640a2a6fd23e14e89ed3cefda055
BLAKE2b-256 023e353b13afe4af684fa28a2816e8bed1159f219e40e698c599b5eec5ca700e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page