GithubHelp home page GithubHelp logo

dmgolembiowski / sremail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from figglewatts/sremail

0.0 1.0 0.0 446 KB

'SRE Mail' is a Python package designed to make sending email in MIME format a lot easier.

License: MIT License

Python 62.74% PowerShell 34.78% Batchfile 2.49%

sremail's Introduction

sremail

License Coverage Version

'SRE Mail' is a Python package designed to make sending email in MIME format a lot easier.

Basic usage

from datetime import datetime

from sremail import message, smtp

msg = message.Message(to=["Sam Gibson <[email protected]>", "[email protected]"],
                      from_addresses=["[email protected]"],
                      date=datetime.now(),
                      another_header="test")
             .attach("attachment.pdf")

smtp.send(msg, "smtp.some_server.com:25")

Gotchas

  • You can't add the X-FileTrust-Tenant header to a Message with a kwarg, as there's no way to format it in a general way due to the capitalised 'T' in 'Trust'. To get around this you have to add the header manually:
    msg = message.Message(to=["Sam Gibson <[email protected]>", "[email protected]"],
                      from_addresses=["[email protected]"],
                      date=datetime.now())
    msg.headers["X-FileTrust-Tenant"] = "<guid>"

Development

Prerequisites

  • Python 3.6+
  • Pipenv

Quick start

  1. Clone this repo.
  2. Run pipenv sync --dev.
  3. You're good to go. You can run commands using the package inside a pipenv shell, and modify the code with your IDE.

sremail's People

Contributors

ashkapow avatar figglewatts avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.