Command Line Mass Mailing Tool

There are lots of tool for mass-mailing, but this tool is the tool for which i am talking about is based on command line. It is a very simple tool with as much as configurations for applications and mail framework properties.

Application Settings

All application configurations will be given through the application.properties where you have to provide the settings like password, email list file, email file, return path, log file, debug option, mailer and mail format like text, html, etc..

Email Settings

Email settings file mainly contains all email settings which required by the Java Mailing apis, you may fine complete properties list here. some of the important properties ate are host, port, user name etc..

Application folder - contains all files
Application folder – contains all files

Setup Email List

Application property `application.list` used to pass the email list to the application. This file heaving a very simple format one line is equals to one email address. it means if you wanted to send email to 1000 people you have create 1000 lines in this file and place the complete path of that file in application.list parameter. default file is list.txt its already there with the program.

Setup Email

Application property `application.email` used to pass the email data to the application. You can write Text or HTML data in that file for the movement it does not support any attachments.

Setting Host and Port

Host and port both settings are related to the Email framework configurations, you may find the properties mail.smtp.host and mail.smtp.port in the email configurations. it varies based on which smtp server you are using. Here i have used an yahoo smtp server.

Setting User and Password

User and password are related to the different configurations, user is comes from the mail configurations while password is comes from the application configurations, as because mail configuration is a set of standard properties of Java Mail API not contains the property for the password. If you plan to send email using user/password authentication then mail.smtp.auth property must be set to true or else set to false if you plan to send email using local smtp program like sendmail.

Run Mass mail

Once you ready with all configurations, you just need to execute either run.sh or run.bat depending on your operating system. and It will start throwing email to the and logging the same in the logfile. Have a look at the sample run below.

Download

Click here to download the Application

Sample Run

mantavya@mga-laptop:~$ cd Desktop/massmail/
mantavya@mga-laptop:~/Desktop/massmail$ ./run.sh
19 Jun, 2011 1:30:19 PM in.mantavyagajjar.massmail.MailManager loadProperties
INFO: Read application settings application.properties successfully !
19 Jun, 2011 1:30:19 PM in.mantavyagajjar.massmail.MailManager loadProperties
INFO: Read mail settings mail.properties successfully !
19 Jun, 2011 1:30:19 PM in.mantavyagajjar.massmail.MailManager
INFO: Session created successfully !
19 Jun, 2011 1:30:19 PM in.mantavyagajjar.massmail.MailManager run
INFO: Reading emaillist list.txt successfully !
19 Jun, 2011 1:30:19 PM in.mantavyagajjar.massmail.MailManager run
INFO: Reading e-mail from email.txt successfully !
19 Jun, 2011 1:30:22 PM in.mantavyagajjar.massmail.MailManager run
INFO: Email sent successfully – mantavyagajjar@gmail.com

2 thoughts on “Command Line Mass Mailing Tool

  1. Hi, I am again.
    I am encountered this error when trying to run your program:

    Apr 21, 2013 11:14:13 AM in.mantavyagajjar.massmail.MailManager loadProperties
    INFO: Read application settings application.properties successfully !
    Apr 21, 2013 11:14:13 AM in.mantavyagajjar.massmail.MailManager loadProperties
    INFO: Read mail settings mail.properties successfully !
    Apr 21, 2013 11:14:13 AM in.mantavyagajjar.massmail.MailManager
    INFO: Session created successfully !
    Apr 21, 2013 11:14:13 AM in.mantavyagajjar.massmail.MailManager run
    INFO: Reading emaillist list.txt successfully !
    Apr 21, 2013 11:14:13 AM in.mantavyagajjar.massmail.MailManager run
    INFO: Reading e-mail from email.txt successfully !
    Apr 21, 2013 11:14:13 AM in.mantavyagajjar.massmail.MailManager run
    INFO: Email failed -myniq@my-qualified-domain-name.com // leading ‘dash’ ‘-‘ in front of my email address

    Whats wrong?
    One thing I am not sure is, whats the correct parameter for
    “application.mailer=ESMTP postfix” in application.properties.
    Is that correct? I am using postfix as my mail daemon.

    Thank you

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s