JMailSend: Email Sending Utility

By Mitch Stuart
Copyright © 2005 FullSpan Software  -  Usage subject to license
Software Version: 1.0  -  Document Version: $Revision: 1.5 $, $Date: 2005/04/16 07:59:33 $

Introduction

JMailSend is a program to send email messages using the SMTP protocol. It uses the JavaMail API to send email. JMailSend is not a full-fledged email program. It is a tool for programmers, system administrators, and other "power users" who need to send "raw" emails.

JMailSend was written with two particular purposes in mind:

Getting JMailSend

Installing and Running JMailSend

To install JMailSend, simply expand the distribution archive (.zip or .tar.gz file) into a directory of your choice. For the remainder of this document, we'll refer to this installation directory as JMAILSEND_DIR.

JMailSend provides both a GUI and command line interface. Each interface has a standalone JAR file, so that you can execute the interface of your choice by running java -jar jarfilename.

GUI Interface
To run the GUI interface, open a shell or command window and type the following command:

   java -jar JMAILSEND_DIR/build/lib/jmailsendgui.jar

Command Line Interface
To run the command line interface, open a shell or command window and type the following command:

   java -jar JMAILSEND_DIR/build/lib/jmailsend.jar

Windows GUI Shortcut
On Windows, once you have confirmed that the GUI version of JMailSend runs properly, you might want to create a desktop shortcut to launch the program. For help on this, search for "create shortcut" in Windows Help. In the shortcut, you might want to use javaw instead of java in the command line. This tells the Java environment that you are running a graphical program, so it will not require a text-mode command window.

Using JMailSend GUI

The JMailSend GUI was designed to be self-explanatory. You should be able to use it fairly easily by just reading the text on the screen:

JMailSend GUI screen

In the To, CC, and BCC fields, specify the recipients of the message. In these fields, you can enter either a single email address, or a comma-separated list of addresses. You can use standard email address formats such as:

   jdoe@sampledomain.not
or
   "Jane Doe" <jdoe@sampledomain.not>

In the Subject and Text fields, enter the subject and text.

In the Configuration section, the names to the left of the text fields are the actual JavaMail property names that will be set by JMailSend. Refer to the JavaMail documentation for details on the meaning of these parameters. In addition to the parameters that you are likely to need, there is space for up to three additional custom parameters. For these parameters, simply enter their names and values, and they will be passed through unchanged to the JavaMail API. An example is shown of the mail.debug property, which you can set to true or false.

Using JMailSend Command Line

The format of the JMailSend command line is:
   java -jar jmailsend.jar propfile subject tolist [cclist [bcclist]]
The parameters are: Note that the parameters are positional, so if you want to specify a bcclist you must also specify a cclist.

The text of the email will be read from stdin.

Example (shown on several lines for readability, but should be typed on one line):

   java -jar jmailsend.jar
      c:\mydir\mymail.properties
      "Test mail" 
      jdoe@sampledomain.not
      jsmith@otherdomain.not,cvasquez@testdomain.not
      <msg.txt 

Sample Properties File
There is a sample file, jmailsend.sample.properties, included in the JMailSend distribution. You can copy and edit this file to set the proper values for your environment. The sample file contents are shown here:

   # Sample properties file for JMailSend
   # http://www.fullspan.com/proj/jmailsend/
   
   # ------ SECTION 1
   # Following are standard JavaMail properties.
   # Set these to match your enviroment.
   
   mail.from="Jane Doe" <jdoe@sampledomain.not>
   mail.smtp.host=mail.sampledomain.not
   mail.smtp.user=jdoe
   mail.smtp.auth=false
   
   # ------ SECTION 2
   # Following are JMailSend custom properties (not used by
   # standard JavaMail, but interpreted by the JMailSend program).
   # Set these to match your environment.
   
   # Set the password if you have enabled SMTP authentication
   # (mail.smtp.auth=true).
   # CAUTION: Make sure to secure this file so that others cannot
   # view your password.
   
   password=mypassword

Building JMailSend

To build JMailSend using Ant, change to the top-level JMailSend directory and run ant. This will use the build.xml build file in that directory.

JMailSend was programmed using the Eclipse 3.0.1 development environment. To build JMailSend using Eclipse, import the top-level JMailSend directory as an Eclipse project. The JMailSend GUI was developed using Swing Designer, however you do not need to have Swing Designer to build, run, or modify JMailSend.

License and External Libraries

JMailSend is released under the FullSpan license. JMailSend uses the FSJUtil library, which is released under the same license.

In addition, JMailSend uses the following external libraries, which are distributed under license from their copyright holders:

Component Description License
JavaMail Email API License text: mail-license.txt
JavaBeans Activation Framework Activation Framework License text: activation-license.txt
JGoodies Forms

JGoodies Looks
"The JGoodies Forms framework helps you lay out and implement elegant Swing panels quickly and consistently."

"The JGoodies look & feels make your Swing applications and applets look better."
This product includes software developed by JGoodies (http://www.jgoodies.com/).

License text: jgoodies-license.txt