Skip to main content

This package provides a simple notifier sending emails

Project description

This package provides a simple notifier sending emails.

  • Free software: GNU General Public License v3

  • Copyright (c) 2021 Henning Janssen

Installation

To install the package, simply run within your terminal:

$ pip install simple_email_sender

Usage

You will need only one single line, to trigger a message within your Python code:

sender.info("Hello World")

For a fully working example, you need to specify the server_settings in a separate file

# server_settings.yaml

# Use this file to store the server setting for the SMTP-Server

"name": "example@email.com"
"password": "MySecretPassword"
"server": "smtp.example.com"
"port": 465

And this is a MWE:

# example.py

from simple_email_sender import Sender

# Before running this example, you need to change your settings in the
# 'server_settings.yaml'-file according to your personal needs


def main():
    receiver = "example@email.com"
    sender = Sender("./server_settings.yaml", receiver, subject="Experiment 123")
    sender.info("Hello World")
    sender.error("Something unexpected happened and you should take care of it...")


if __name__ == "__main__":
    main()

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

simple_email_sender-0.0.3.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

simple_email_sender-0.0.3-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

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