Skip to main content

A simple commandline application for sending mails quickly

Project description

Quick Mail CLI

A command line interface to send mail without any hassle.

Why this tool?

Sending last minute mails using conventional tools can get annoying and tiresome. This CLI helps in such situation since it makes sending mail hassle-free and very quick. Use this tool to send mails quickly without leaving your terminal.

Installation

Install quick-mail from the Python Package Index (PyPi)

$ pip install quick-mail

Or manually from this repository.

$ git clone https://github.com/avikumar15/quick-mail-cli

* add line export PYTHONPATH=/path/to/project/quick-email-cli to ~/.bashrc *

$ cd quick-mail-cli/

* activate virtual environment *

$ pip install -r requirements.txt
$ pip install .

Check installation by running

$ quickmail --version

Usage

To use this:

$ quickmail --help

usage: quickmail [-h] [-v] {clear,init,send,template} ...

A command line interface to send mail without any hassle

positional arguments:
  {clear,init,send,template}
    clear               clear the body of message from local or even the token if
                        --justdoit argument is added
    init                initialise token and set your email id
    send                send the mail
    template            manage templates of mail body

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         print current cli version

Create your OAuth client ID and select app type as Desktop App and download the credentials.json file.

Then run the init command to authenticate gmail, and generate token. This command is required to be run only once.

$ quickmail init <path/to/credentials.json>

Now you are all set. Use the send command to send mail.

$ quickmail send --help

usage: quickmail send [-h] -r RECEIVER -sub SUBJECT [-t TEMPLATE] [-b BODY]
                      [-a ATTACHMENT] [-l]

Use the send command to send mail. Body can be passed as an argument, or typed in
a nano shell. Use optional --lessgo command for sending mail without confirmation

optional arguments:
  -h, --help            show this help message and exit
  -r RECEIVER, --receiver RECEIVER
                        receiver's email address, eg. '-r "xyz@gmail.com"'
  -sub SUBJECT, --subject SUBJECT
                        email's subject, eg. '-sub "XYZ submission"'
  -t TEMPLATE, --template TEMPLATE
                        template of email body, eg. '-t="assignment_template"'
  -b BODY, --body BODY  email's body, eg. '-b "Message Body Comes Here"'
  -a ATTACHMENT, --attachment ATTACHMENT
                        email's attachment path, eg. '~/Desktop/XYZ_Endsem.pdf'
  -l, --lessgo          skip confirmation before sending mail

Body and attachments are optional arguments. Body can be either passed as an argument otherwise it can also be typed in the nano shell (Use -t argument to use a template body). Use the --lessgo (shorthand -l) to skip confirmation of mail, for quicker mail deliveries.

To clear the cli storage, use the clear command. Use --justdoit (shorthand -j) to even remove the credential and token files from project directory, this extra argument would allow you to change your primary email address.

$ quickmail clear --help

usage: quickmail clear [-h] [-j]

Use the clear command to clear all email body that are saved in your home
directories. Additionally, pass --justdoit to remove the credential files as well

optional arguments:
  -h, --help      show this help message and exit
  -j, --justdoit  clear storage including the credentials and token

To manage templates use the template command.

$ quickmail template --help

usage: quickmail template [-h] {add,listall,edit} ...

manage mail templates

positional arguments:
  {add,listall,edit}
    add               add a new template
    listall           list all templates
    edit              edit a particular template

optional arguments:
  -h, --help          show this help message and exit

Following is a recording of the terminal session which records the usage of quickmail from init command till send command.

asciicast

Improvements and Bugs

Found any bugs? Or have any suggestions, feel free to open an issue.

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

quick-mail-1.0.4.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

quick_mail-1.0.4-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file quick-mail-1.0.4.tar.gz.

File metadata

  • Download URL: quick-mail-1.0.4.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5

File hashes

Hashes for quick-mail-1.0.4.tar.gz
Algorithm Hash digest
SHA256 753bf1c2367aa21fc87f34425e032b1bc24597020c0dbe404ed51e93371f7257
MD5 b9ee0955ed8dcf56eae8fdf3693c4eeb
BLAKE2b-256 1bde64e6b20fe972d5ae176a547b4596e28d239cc459879d696adeed688967d0

See more details on using hashes here.

File details

Details for the file quick_mail-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: quick_mail-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5

File hashes

Hashes for quick_mail-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f3ce37c2981551f4bf676bdee75b30edfed5a085916bed56420063cd01c051e8
MD5 051dd54940991a426f5c50a0d910ad84
BLAKE2b-256 71456badf61a46d8ad5c8fddc613d434142ad47045c9da944956ddb23fddc3e0

See more details on using hashes here.

Supported by

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