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 and SMS Object utilizing your gmail account and an application password created within your Google account.

import pysendsms

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

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

CARRIERS is 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', pysendsms.CARRIERS['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.5.tar.gz (5.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pysendsms-0.1.5.tar.gz
  • Upload date:
  • Size: 5.5 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.5.tar.gz
Algorithm Hash digest
SHA256 8e52760d3adb060d44df528852d4eecd73839324b81834e07397eadf65ad9d83
MD5 a7d98704026fea652d42e0f1881b24db
BLAKE2b-256 26090c06e9e35414fe2123930660edd32e91e2f6efcff025986844c913ab86c8

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