# sendpy
--------
## Overview
sendpy is a command line email and text notification program that makes use
of external and local SMTP servers to send messages.
However, sendpy is much more than that. sendpy is rich in features and use cases.
For example, using this program, one may:
* Attach files to a message
* Send Unicode characters/emojis in the Subject or Body of a message
* Digitally sign a message with S/MIME or PGP encryption
* Send a notification when a long running process (LRP) has finished execution
* Delay the sending of an email until a specific time
* And more!
Help for sending an e-mail and understanding this program can be found using `sendpy --help`, `sendpy --examples`, `sendpy --smtp-servers`, and `sendpy --gateways`.
## Quick Start in 4 Easy Steps
To expedite the ability for users to send a message, here is a quick setup and example:
1. Install: `pip3 install sendpy` or `python3 -m pip install sendpy`.
2. Set the default configuration file to store repetitive commands (e.g., username, password): `sendpy --config`.
3. If necessary, create an App Password or enable less secure app access with your external email service (ex. [Gmail](https://myaccount.google.com/lesssecureapps)).
4. Send a basic message: `sendpy --subject "Employment Opportunity" --to "connellyd2050@gmail.com" --message "Hello,\n\n When is a good time to talk about an open position we have for you?"`.
## Dependencies
The following libraries are used in this program:
* [OpenSSL](https://www.openssl.org/)
* [GNU Privacy Guard](https://gnupg.org/) (GPG)
OpenSSL and GPG, are installed on most Linux
distributions by default and may easily be installed on Windows and macOS.
However, so long as a user is not signing emails (the `--passphrase` and `--certificate` flags),
one may use this program without any additional installations on Windows or
macOS.
## Help
```
$ sendpy --help
usage: [-h] [-v] [-s SUBJECT] [-m MESSAGE] [--message-file MESSAGE_FILE] [-a ATTACHMENTS] [-t TOEMAILS] [-c CCEMAILS] [-b BCCEMAILS] [-f FROMEMAIL] [-S SMTP] [--tls] [--starttls] [-u USERNAME]
[-p PASSWORD] [-P {5 Lowest),4 (Low),Normal,2 (High),1 (Highest}] [-r] [-C CERT] [-k PASSPHRASE] [-z ZIPFILE] [-l] [-U] [-T TIME] [-d] [-n NOTIFY] [-V] [--config] [--examples]
[--smtp-servers] [--gateways]
One or more To, CC or BCC e-mail addresses are required. Send text messages by using the mobile providers e-mail to SMS or MMS gateway (see the --gateways option). See examples with the --examples
option.
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s SUBJECT, --subject SUBJECT
Subject. Escape sequences are expanded. Supports Unicode characters.
-m MESSAGE, --message MESSAGE
Message body. Escape sequences are expanded. Supports Unicode characters.
--message-file MESSAGE_FILE
Message body from a file or standard input if the filename is '-'.
-a ATTACHMENTS, --attachment ATTACHMENTS
Attachment filename. Use multiple times for multiple attachments. Supports Unicode characters in filename.
-t TOEMAILS, --to TOEMAILS
To e-mail address. Use multiple times for multiple To e-mail addresses.
-c CCEMAILS, --cc CCEMAILS
CC e-mail address. Use multiple times for multiple CC e-mail addresses.
-b BCCEMAILS, --bcc BCCEMAILS
BCC e-mail address. Use multiple times for multiple BCC e-mail addresses.
-f FROMEMAIL, --from FROMEMAIL
From e-mail address
-S SMTP, --smtp SMTP SMTP server. Optionally include a port with the "hostname:port" syntax. Defaults to port 465 with --ssl/--tls and port 25 otherwise. Use "localhost" if running a mail
server on this device.
--tls Use a secure connection with SSL/TLS (Secure Socket Layer/Transport Layer Security)
--starttls Upgrade to a secure connection with StartTLS
-u USERNAME, --username USERNAME
SMTP server username
-p PASSWORD, --password PASSWORD
SMTP server password. For security, use the --config option instead for it to prompt you for the password and then store in the configuration file.
-P {5 (Lowest),4 (Low),Normal,2 (High),1 (Highest)}, --priority {5 (Lowest),4 (Low),Normal,2 (High),1 (Highest)}
Priority. Supported priorities: "5 (Lowest)", "4 (Low)", "Normal", "2 (High)" and "1 (Highest)"
-r, --receipt Request Return Receipt
-C CERT, --certificate CERT
S/MIME Certificate filename for digitally signing the e-mails. It will ask you for the password the first time you run the script with this option.
-k PASSPHRASE, --passphrase PASSPHRASE
PGP secret key passphrase for digitally signing the e-mails with PGP/MIME. For security, use 'config' for it to prompt you for the passphrase and then store in the
configuration file.
-z ZIPFILE, --zip ZIPFILE
Compress attachment(s) with zip
-l, --language Set Content-Language. Uses value of LANG environment variable on Linux.
-U, --sanitize-date Uses Coordinated Universal Time (UTC) and rounds date down to whole minute.
-T TIME, --time TIME Time to delay sending of the e-mail
-d, --dry-run Dry run, do not send the e-mail
-n NOTIFY, --notify NOTIFY
Run provided command and then send an e-mail with resulting output and exit code.
-V, --verbose Verbose, show the client-server communication
--config Store the --from, --smtp, --tls, --starttls, --username and --password option values in a '.sendpy.ini' configuration file as defaults for future use. It will prompt for
any values that are not provided.
--examples Show example usages of this script and exit
--smtp-servers Show a list of the SMTP servers for common e-mail services, then exit
--gateways Show a list the of SMS and MMS Gateways for common mobile providers in the United States and Canada, then exit
```
## Examples
```
$ sendpy --examples
Sendpy Examples (assumes config file is used):
Send e-mail
$ sendpy --subject "Example" --to "User <user@example.com>"
Send e-mail with message
$ sendpy --subject "Example" --message 'This is an example!' --to "User <user@example.com>"
Send e-mail with message and single attachment
$ sendpy --subject "Example" --message 'This is an example!' --attachment example.txt --to "User <user@example.com>"
Send e-mail with message and multiple attachments
$ sendpy --subject "Example" --message 'This is an example!' --attachment example1.txt --attachment example2.txt --to "User <user@example.com>"
Send e-mail to a CC address
$ sendpy --subject "Example" --to "User 1 <user1@example.com>" --cc "User 2 <user2@example.com>"
Set config file with external SMTP server
$ sendpy --from "Example <example@example.com>" --smtp "mail.example.com" --tls --username "example" --config
Send high priority e-mail
$ sendpy --subject "Example" --priority "1 (Highest)" --to "User <user@example.com>"
Send e-mail digitally signed with an S/MIME Certificate
$ sendpy --subject "Example" --certificate "cert.p12" --to "User <user@example.com>"
Send e-mail digitally signed with PGP/MIME
$ sendpy --subject "Example" --passphrase "config" --to "User <user@example.com>"
```
## Donate
[PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NJ4PULABRVNCC)
Raw data
{
"_id": null,
"home_page": "https://github.com/tdulcet/Send-Msg-CLI",
"name": "sendpy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "sendpy email e-mail send text notification g-mail",
"author": "Daniel Connelly and Teal Dulcet",
"author_email": "connellyd2050@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e9/9c/c1b69992c4ff225b66452ea63218371922a26e5b1ea76ded2337372a46f3/sendpy-1.0.tar.gz",
"platform": null,
"description": "# sendpy\n--------\n## Overview\nsendpy is a command line email and text notification program that makes use\nof external and local SMTP servers to send messages.\n\nHowever, sendpy is much more than that. sendpy is rich in features and use cases. \nFor example, using this program, one may:\n\n* Attach files to a message\n* Send Unicode characters/emojis in the Subject or Body of a message\n* Digitally sign a message with S/MIME or PGP encryption\n* Send a notification when a long running process (LRP) has finished execution\n* Delay the sending of an email until a specific time\n* And more!\n\nHelp for sending an e-mail and understanding this program can be found using `sendpy --help`, `sendpy --examples`, `sendpy --smtp-servers`, and `sendpy --gateways`.\n\n## Quick Start in 4 Easy Steps\n\nTo expedite the ability for users to send a message, here is a quick setup and example:\n\n1. Install: `pip3 install sendpy` or `python3 -m pip install sendpy`.\n\n2. Set the default configuration file to store repetitive commands (e.g., username, password): `sendpy --config`.\n\n3. If necessary, create an App Password or enable less secure app access with your external email service (ex. [Gmail](https://myaccount.google.com/lesssecureapps)).\n\n4. Send a basic message: `sendpy --subject \"Employment Opportunity\" --to \"connellyd2050@gmail.com\" --message \"Hello,\\n\\n When is a good time to talk about an open position we have for you?\"`.\n\n## Dependencies\nThe following libraries are used in this program:\n* [OpenSSL](https://www.openssl.org/)\n* [GNU Privacy Guard](https://gnupg.org/) (GPG)\n\nOpenSSL and GPG, are installed on most Linux \ndistributions by default and may easily be installed on Windows and macOS.\nHowever, so long as a user is not signing emails (the `--passphrase` and `--certificate` flags),\none may use this program without any additional installations on Windows or\nmacOS.\n\n## Help\n```\n$ sendpy --help\nusage: [-h] [-v] [-s SUBJECT] [-m MESSAGE] [--message-file MESSAGE_FILE] [-a ATTACHMENTS] [-t TOEMAILS] [-c CCEMAILS] [-b BCCEMAILS] [-f FROMEMAIL] [-S SMTP] [--tls] [--starttls] [-u USERNAME]\n [-p PASSWORD] [-P {5 Lowest),4 (Low),Normal,2 (High),1 (Highest}] [-r] [-C CERT] [-k PASSPHRASE] [-z ZIPFILE] [-l] [-U] [-T TIME] [-d] [-n NOTIFY] [-V] [--config] [--examples]\n [--smtp-servers] [--gateways]\n\nOne or more To, CC or BCC e-mail addresses are required. Send text messages by using the mobile providers e-mail to SMS or MMS gateway (see the --gateways option). See examples with the --examples\noption.\n\noptional arguments:\n -h, --help show this help message and exit\n -v, --version show program's version number and exit\n -s SUBJECT, --subject SUBJECT\n Subject. Escape sequences are expanded. Supports Unicode characters.\n -m MESSAGE, --message MESSAGE\n Message body. Escape sequences are expanded. Supports Unicode characters.\n --message-file MESSAGE_FILE\n Message body from a file or standard input if the filename is '-'.\n -a ATTACHMENTS, --attachment ATTACHMENTS\n Attachment filename. Use multiple times for multiple attachments. Supports Unicode characters in filename.\n -t TOEMAILS, --to TOEMAILS\n To e-mail address. Use multiple times for multiple To e-mail addresses.\n -c CCEMAILS, --cc CCEMAILS\n CC e-mail address. Use multiple times for multiple CC e-mail addresses.\n -b BCCEMAILS, --bcc BCCEMAILS\n BCC e-mail address. Use multiple times for multiple BCC e-mail addresses.\n -f FROMEMAIL, --from FROMEMAIL\n From e-mail address\n -S SMTP, --smtp SMTP SMTP server. Optionally include a port with the \"hostname:port\" syntax. Defaults to port 465 with --ssl/--tls and port 25 otherwise. Use \"localhost\" if running a mail\n server on this device.\n --tls Use a secure connection with SSL/TLS (Secure Socket Layer/Transport Layer Security)\n --starttls Upgrade to a secure connection with StartTLS\n -u USERNAME, --username USERNAME\n SMTP server username\n -p PASSWORD, --password PASSWORD\n SMTP server password. For security, use the --config option instead for it to prompt you for the password and then store in the configuration file.\n -P {5 (Lowest),4 (Low),Normal,2 (High),1 (Highest)}, --priority {5 (Lowest),4 (Low),Normal,2 (High),1 (Highest)}\n Priority. Supported priorities: \"5 (Lowest)\", \"4 (Low)\", \"Normal\", \"2 (High)\" and \"1 (Highest)\"\n -r, --receipt Request Return Receipt\n -C CERT, --certificate CERT\n S/MIME Certificate filename for digitally signing the e-mails. It will ask you for the password the first time you run the script with this option.\n -k PASSPHRASE, --passphrase PASSPHRASE\n PGP secret key passphrase for digitally signing the e-mails with PGP/MIME. For security, use 'config' for it to prompt you for the passphrase and then store in the\n configuration file.\n -z ZIPFILE, --zip ZIPFILE\n Compress attachment(s) with zip\n -l, --language Set Content-Language. Uses value of LANG environment variable on Linux.\n -U, --sanitize-date Uses Coordinated Universal Time (UTC) and rounds date down to whole minute.\n -T TIME, --time TIME Time to delay sending of the e-mail\n -d, --dry-run Dry run, do not send the e-mail\n -n NOTIFY, --notify NOTIFY\n Run provided command and then send an e-mail with resulting output and exit code.\n -V, --verbose Verbose, show the client-server communication\n --config Store the --from, --smtp, --tls, --starttls, --username and --password option values in a '.sendpy.ini' configuration file as defaults for future use. It will prompt for\n any values that are not provided.\n --examples Show example usages of this script and exit\n --smtp-servers Show a list of the SMTP servers for common e-mail services, then exit\n --gateways Show a list the of SMS and MMS Gateways for common mobile providers in the United States and Canada, then exit\n```\n\n## Examples\n```\n$ sendpy --examples\nSendpy Examples (assumes config file is used):\n Send e-mail\n $ sendpy --subject \"Example\" --to \"User <user@example.com>\"\n\n Send e-mail with message\n $ sendpy --subject \"Example\" --message 'This is an example!' --to \"User <user@example.com>\"\n\n Send e-mail with message and single attachment\n $ sendpy --subject \"Example\" --message 'This is an example!' --attachment example.txt --to \"User <user@example.com>\"\n\n Send e-mail with message and multiple attachments\n $ sendpy --subject \"Example\" --message 'This is an example!' --attachment example1.txt --attachment example2.txt --to \"User <user@example.com>\"\n\n Send e-mail to a CC address\n $ sendpy --subject \"Example\" --to \"User 1 <user1@example.com>\" --cc \"User 2 <user2@example.com>\"\n\n Set config file with external SMTP server\n $ sendpy --from \"Example <example@example.com>\" --smtp \"mail.example.com\" --tls --username \"example\" --config\n\n Send high priority e-mail\n $ sendpy --subject \"Example\" --priority \"1 (Highest)\" --to \"User <user@example.com>\"\n\n Send e-mail digitally signed with an S/MIME Certificate\n $ sendpy --subject \"Example\" --certificate \"cert.p12\" --to \"User <user@example.com>\"\n\n Send e-mail digitally signed with PGP/MIME\n $ sendpy --subject \"Example\" --passphrase \"config\" --to \"User <user@example.com>\"\n\n```\n\n## Donate\n[PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NJ4PULABRVNCC)\n",
"bugtrack_url": null,
"license": "GPL",
"summary": "Email and text notification program",
"version": "1.0",
"project_urls": {
"Bug Reports": "https://github.com/tdulcet/Send-Msg-CLI",
"Funding": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NJ4PULABRVNCC",
"Homepage": "https://github.com/tdulcet/Send-Msg-CLI",
"Source": "https://github.com/tdulcet/Send-Msg-CLI"
},
"split_keywords": [
"sendpy",
"email",
"e-mail",
"send",
"text",
"notification",
"g-mail"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2405c06bb58bc5d69fe81e9f932210749a7da2def7e3952e42d95c0dfa1503a3",
"md5": "a4b48efe9877c8cc83d7a80b7508efc0",
"sha256": "2e4899fa218cc3676b08ff3ac5a2baeef5fe33f4f77a9ef33d254c5ce4082753"
},
"downloads": -1,
"filename": "sendpy-1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a4b48efe9877c8cc83d7a80b7508efc0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 28610,
"upload_time": "2024-01-20T00:11:12",
"upload_time_iso_8601": "2024-01-20T00:11:12.123901Z",
"url": "https://files.pythonhosted.org/packages/24/05/c06bb58bc5d69fe81e9f932210749a7da2def7e3952e42d95c0dfa1503a3/sendpy-1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e99cc1b69992c4ff225b66452ea63218371922a26e5b1ea76ded2337372a46f3",
"md5": "9f1ce6062f7f19a5d8a84f41c562e229",
"sha256": "8b01e5a1136b952ed07aa3890fccfae77f0781af1496d2e633267370ebce9abb"
},
"downloads": -1,
"filename": "sendpy-1.0.tar.gz",
"has_sig": false,
"md5_digest": "9f1ce6062f7f19a5d8a84f41c562e229",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 28796,
"upload_time": "2024-01-20T00:11:13",
"upload_time_iso_8601": "2024-01-20T00:11:13.891576Z",
"url": "https://files.pythonhosted.org/packages/e9/9c/c1b69992c4ff225b66452ea63218371922a26e5b1ea76ded2337372a46f3/sendpy-1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-20 00:11:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tdulcet",
"github_project": "Send-Msg-CLI",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "sendpy"
}