GithubHelp home page GithubHelp logo

mailpitcher's Introduction

MailPitcher

A library simplify file mailing tasks

Setup

Define your own pitcher.cfg, need not to be in a specific directory or name. You can address it with the Pitcher constructor.
The pitcher.cfg will look like the following:

[Shot_1]
enabled = True
from = [email protected]
to = [email protected], [email protected]
subject = MailPitcher Test
htmlContent = <h1>MailPitcher</h1><p>test message</p>
plainContent = test message
files[0] = /tmp/mail.log
files[1] = /tmp/mail.pitcher.log
files[2] = /tmp/gloves.pitcher.log

[SMTP]
host = smtp.sunshire.net
port = 25

The section "SMTP" is necessary, which addresses the SMTP server and port.
For other sections, each one documents a pitching(mailing) task.
You are allow to specify the sender(from)/receiver(to), aware that to field is allow multi-value, so you can mail multiple people.

enabled field is optional, default True. Assigning values other than "True" would skip this section.
subject field is plain text.
htmlContent and plainContent are mutual exculsive, but if you specified both, htmlContent has a higher priority.
And the last but not least, files*, you are allow to specify variadic quatity of files, as long as they got the correct prefix(files).

Write your own script

An example code is available here. You may copy it and modify it to your version.
Or if you are confident enough, you may from MailPitcher import Pitcher and apply it in your code.

The main concept of usage

A code snippet is worth a thousand words.

from MailPitcher import Pitcher
pitcher = Pitcher(configFile) # specify the config file of this pitch.
pitcher.pitch(sectionName) # address the task you want to pitch by its section name.
# you may also pass arguments to determine which task to run, imagination is the boundary.

mailpitcher's People

Contributors

ire7715 avatar

Watchers

 avatar  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.