Git Product home page Git Product logo

multimail's Introduction

MultiMail

a primitive mail merge for email, using Mutt and Python

What is it?

This is a Python script that helps send batch emails with message bodies customized for each recipient.

Prerequisites

To run this script, you need:

  • Python (tested with 2.7, others may work as well)
  • Mutt mail client, configured and working

How to configure

Sending an email requires the existence of three files:

  • a message file
  • a recipients file
  • a configuration file

Examples of each type of file are located in the example directory.

Message file

The message file contains the body of your message as plain-text. For portions of the text that you want to customize, insert a placeholder of the form <?> where the ? is the number of the item to substitute in (start the numbering at 1). For example:

Hello, <1>. Are we still on for <2>?

If you want to include the recipient's email address, use the placeholder <0>.

Recipients file

The recipients file contains the addresses of the recipients and recipient- specific information. Fields are separated by commas, and each line denotes a new recipient. The first column must contain the recipient's email address. For example:

[email protected],Alice,"dinner on Monday"
[email protected],Bob,"lunch on Tuesday"

Note that strings containing spaces must be enclosed on quotes. (The quotes won't be part of the message sent.) There is currently no support for newlines.

Configuration file

The configuration file contains the subject and, optionally, the CC, BCC, and attachment filename for the messages you want to send.

It follows the following format:

[common]
subject: your subject here
cc: [email protected]
bcc: [email protected]
attachment: picture.jpg

A field need not be filled out, but its label must appear. (e.g., you can have the attachment field be empty, but you still need the attachment: label)

Speaking of attachments, the attachment field supports the same placeholders as the message. So if you want user-specific attachments, just use a placeholder in the configuration file and put the filename (or portion of it) in the respective column of the recipients file.

How to send

To send a batch of message, create the files described above and run the script.

./multimail.py

By default, the script will look for files with the following names in the current directory:

  • configuration file: batch.cfg
  • recipients file: recipients.csv
  • message file: message.txt

Any of these can be changed by running the script with the following flags:

  • configuration file: -c/--config
  • recipients file: -r/--recipients
  • message file: -m/--message

If you want to suppress any output from the script, you can run with the -s/--silent flag.

multimail's People

Contributors

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