Visit MaiBatch at sourcforge.net
Contents
Release 1.0.4 of MailBatch is now available for download. New features are:
The utility PollMail has been introduced with version 1.0.4. PollMail is a simple program that retrieve emails from a IMAP server. Retrieved emails are then passed on to some command that can read stdin and can be executed on the local host. Since the email are keept intact it can be passed to procmail for local host mail delivery. PollMail was written to integrate Bugzilla email integration utility called bug_email.pl without exposing the machine running bug_email.pl as a email server.
Subject can now include the same parsing directives as the body can.
Release 1.0.2 of MailBatch include:
Support for attachments.
Reading subject from a file.
The system property line.separator is used when writing to log files and stdout.
Trimming of " and space characters are now correctly done when reading from the address file.
Download MaiBatch release 1.0.2
MailBatch is a simple email client
that can be used to send emails to a large number of users from the
command line. Email information are retrieved from a csv file that can
include email data that is needed to customize the email based on the
receiver. In the example of a course registration acknowledgment
where different recipients will receive different information based on their
identity. So to compose the batch emails you need a csv formated
email data file, called address, a file with the email body content
and a subject. The address file can typical be created by some
business system and should be in a csv formated file like:
The body file for this course registration example could look like this:
In the above file the {x} is references to the fields in the address csv file
where {0} is the first field that should always be the email address. The rest
of the fields are optional.
To send out emails to the new pupils just run
The program works with the
following parameters
The program can have a fixed subject that is common to all recipients that are given on command
line.
Every messages can have a body text that is in text/html; charset=ISO-8859-1
From must be set to a email address
If the reply address should be different from the from address
Sender info can be put in a signature file that is append to the body
Logging is done by setting
To pause between each mail sent
Turn on visual progress of the sent emails. A dot (.) means successfully sent, question mark means
not sent and a bang means failed.
To verify the content of each email before it sent use the switch
Supported properties are:
Properties should be put in the file
On Windows
Download MaiBatch from sourceforge.net
lars@hightech.com, Lars Larsson, 2/4, Advanced Unix training
bert@beginner.com, Bert Bertson, 5/4, Unix beginners
The first column must always be the email address to the recipient. The other
columns are optional and can include user specific information. The different
fields can be inserted in the subject, body and signature parts by using the
string {X} where X is the number of the column in the csv file. X=0 is the first
column that are the email recipient address.
Dear {1},
We are happy to invite you to our course in {3} starting the {2}-2006.
Best regards,
HeadMaster
java MailBatch -address my.csv -body my.body -subject Welcome -from headmaster@unixuni.net -smtp
smtp.unixuni.net
The recipients address are stored in a csv
file. The first column is the email address. The file can have more
fields that can be used depending on needs, i.e. the real name.
-address address-file
If the -address switch is not set the address data are read from stdin
-subject string (mandatory)
or:
-subjectfile filename (mandatory)
If reading the subject from a file only the first line is used as a subject.
-body
body-file
If the body file include {x} these are replaced with fields from the address-file
Example 1:
-attach fileone,~/filetwo
The character , must be used to separate the file and no space are allowed at
the comma or in the filename.
Example 2:
-attach "file one.pdf , file two.pdf"
Use " to enclose the multiple file names. Now space is allowed but you can
not use shell directives or shell parameters since expansion of these will
not work.
-from user@address
-replyto replyto
-signature signature-file
-logfile logfile
Logfile can have the $T tag in the name. This will be replaced to the current timestamp to easily
separate different logfiles.
-pause X
Where X is the pause in seconds. Default is 5
-verbose
-verify
signature - file name to signature file
logfile - file name to log file
from - the from user email address, i.e. don@xyz.com
replyto - the reply to email address if different the the from user
smtp - the smtp server address, i.e. smtp.chello.se
verbose - show mail sending progress, default is false
pause - the pausing interval between sending emails, default is 5
mb.properties
. Valid locations are user home
directory or current working directory.
To run MailBatch the following jars are requiered:
- JavaMail 1.4 from java.sun.com
- JavaBeans Activation Framework (JAF) 1.1 from java.sun.com
- Commons CLI 1.0 from apache.org
On Linux
Set REQLIB to where your have your jars that are specified in the
System requirements section.
$ export REQLIB=your_jar_dir
Run Mailbatch:
$ tar xzvf mailbatchX.Y.Z.tar.gz
$ cd mailbatchX.Y.Z
$ java -classpath $REQLIB/commons-cli-1.0.jar:$REQLIB/activation.jar:$REQLIB/mail.jar:.
MailBatch -help
Set REQLIB to where your have your jars that are specified in the
System requirements section.
c:\> set REQLIB=your_jar_dir
c:\> unzip mailbatchX.Y.Z.zip
c:\> cd mailbatchX.Y.Z
Run MailBatch:
c:\mailbatchX.Y.Z> java -classpath %REQLIB%\commons-cli-1.0.jar;%REQLIB%\mail.jar;%REQLIB%\activation.jar;. MailBatch -help