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 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.6.tar.gz (5.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pysendsms-0.1.6.tar.gz
  • Upload date:
  • Size: 5.7 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.6.tar.gz
Algorithm Hash digest
SHA256 b094b3ee6c1cfa04a18bb9eca70b3e8e9c5582f0b4c7b8c8b029025391681386
MD5 74c5a29626bc27b4e8676cb3cd19d83f
BLAKE2b-256 b5a62281c41d7b2db32b0f4aa0122323c551a6002e81e1b29071b86ae02d88f3

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