Package: emili
EmiliSimple interface for sending mails. Turns input formats
such as Markdown or console outputs using ANSI colors
into nice dual plaintext/html messages.Module usageimportemilicontent="""# this is a titleRead **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 namedsmtp:smtp=dict(host='smtp.acme.cat',port=465,user='roadrunner@acme.cat',password='mecmec',)Command line usageusage: 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 filereportrunusage: reportrun [-h] -s SUBJECT -t RECIPIENT [-f SENDER] [-C CONFIG.PY]
                [FILE [FILE ...]] -- COMMAND [COMMAND_ARG ...]

reportrun wraps the execution of a command and sends an email
whenever the command fails. The mail sending is processed by
emili so that ansi codes and spacing are shown properly.

positional arguments:
  FILE                  File to attach
  COMMAND               Command to run
  COMMAND_ARG           Argument for COMMAND

optional arguments:
  -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)
  -C CONFIG.PY, --config CONFIG.PY
                        Python Module with smtp configuration defined.
  -a, --always
                        Sends even if the command does not fail.
  --
                        Marks the start of the command to execute.Changelog1.6 (2019-10-09)Fix: reportrun ignored endlinesreportrun accepts attatchmentreportrun --help option and documented in README1.5 (2018-10-15)Addedreportrunscript1.4 (2017-07-02)Fix: dump does not require configuration1.3 (2016-11-02)--dumpoption to dump the resulting email as file instead of sending itFix: Better processing addresses in the formatMe <me@here.org>Fix: Do not take the full path as attachment nameactivate_wrapper.shmoved tosomenergia-utilsrepo1.2 (2016-03-28)Option-c/--configto explicit configuration fileAdded wrapperexecute_send_mail.shAdded wrapperactivate_wrapper.sh1.1 (2016-01-12)Available on PyPi1.0 (2016-01-12)First version