This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Mail sending Python/CLI interface using markdown or ANSI codes based content

Project Description

Simple interface for sending mails. Turns input formats such as Markdown or console outputs using ANSI colors into nice dual plaintext/html messages.

Module usage

import emili

content = """
# this is a title

Read **this** is very _important_!!

"""

emili.sendmail(
    from  = "me@acme.cat",
    to = [ "abe@acme.cat", "bill@acme.cat" ],
    bcc = [ "me@acme.cat" ],
    subject = "About this email"
    md = content,
    attachments = [ 'onefile.pdf' ],
    config = '../config.py',
    )

Right now a config.py file is required containing the configuration options for the SMTP connection in a dictionary named smtp:

smtp=dict(
    host='smtp.acme.cat',
    port='',
    user='roadrunner@acme.cat',
    password='mecmec',
)

Command line usage

usage: emili.py [-h] -f SENDER -s SUBJECT -t recipient [--body TEXT]
                [--bodyfile BODYFILE] [-C CONFIG.PY] [-c CC] [-b BCC]
                [-r REPLYTO] [--format FORMAT] [--style CSSFILE]
                [--template TEMPLATE] [--dump OUTPUTFILE.eml]
                [FILE [FILE ...]]

Sends an email.

positional arguments:
  FILE                  File to attach

optional arguments:
  -h, --help            show this help message and exit
  -f SENDER, --from SENDER
                        Message sender ('From:' header)
  -s SUBJECT, --subject SUBJECT
                        Message subject ('Subject:' header)
  -t recipient, --to recipient
                        Message recipient ('To:' header) (multiple)
  --body TEXT           Message body (defaults to stdin)
  --bodyfile BODYFILE   File containing the message body (defaults to stdin)
  -C CONFIG.PY, --config CONFIG.PY
                        Python Module with smtp configuration defined.
  -c CC, --cc CC        Message copy recipient ('CC:' header) (multiple)
  -b BCC, --bcc BCC     Message hidden copy recipient ('BCC:' header)
                        (multiple), other recipients won't see this header
  -r REPLYTO, --replyto REPLYTO
                        Default address to reply at ('Reply-To:' header)
                        (multiple)
  --format FORMAT       Format for the body. 'md' takes markdown and generates
                        both html and text. 'ansi' does the same, turning ANSI
                        color codes in html or stripping them for text.
  --style CSSFILE       Style sheet for the html output, (multiple)
  --template TEMPLATE   Alternative template for the html body.
  --dump OUTPUTFILE.eml
                        Instead of sending, dump the email into a file
Release History

Release History

This version
History Node

1.4

History Node

1.3

History Node

1.2

History Node

1.1

History Node

1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
emili-1.4.tar.gz (5.3 kB) Copy SHA256 Checksum SHA256 Source Jul 2, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting