Created: 2012-03-26 04:30
Updated: 2018-06-25 12:03


Generates and sends emails based on a CSV template. Useful for Gmail and for sending customized attachments to each recipient.


How to use:

  1. Create a CSV "workfile" containing all of your email details. Each row should contain header info (FROM, TO, CC, BCC, and SUBJECT). FROM is required, as is at least one of TO, CC, and BCC. SUBJECT is optional.
  2. BODY should be a path (absolute or relative to the location of the CSV workfile) to a template file that uses Jinja2 templating syntax (see for details). Each row can have a different value for BODY if you want.
  3. SUBJECT should just be a string in the CSV, though it can also use Jinja2 template syntax. (BODY can also be a string.)
  4. Fields beginning with ATTACHMENT should be paths (again, absolute or relative to the location of the CSV workfile) to attachment files.
  5. You also need to create a file containing the details of the account to which you want to connect. This file needs to have 3 lines, with the SMTP host and port on the first, the user account on the second, and the account password on the third.
  6. Run sendtmail to use. Use the -d [--debug] flag to run in debug mode and print out all of the emails without sending them.

The following templates are provided as examples:

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more