##########################################################
##									  ##
##		JMail Setup Procedures				  ##
##									  ##
##########################################################

Required fiels:

1) JMail.jar or .zip
2) mailapi.jar
3) smtp.jar
4) activation.jar


download all the four jar files into the directory where you
can map the directory to the CLASSPATH.

**Note: Please include the "activation.jar" in the end of 
the classpath on Unix.

add the following CLASSPATH into your existing CLASSPATH:
Windows:
CLASSPATH=<dir of jar files>\JMail.jar or .zip;
	       <dir of jar files>\mailapi.jar;
	       <dir of jar files>\smtp.jar;
	       <dir of jar files>\activation.jar;.

Unix:
CLASSPATH=<dir of jar files>/JMail.jar or .zip:
	       <dir of jar files>/mailapi.jar:
	       <dir of jar files>/smtp.jar:
	       <dir of jar files>/activation.jar:.

See the Example below how to instantiate Mail Constructor
and call send() method.

##########################################################
##		Example Java Code					  ##
##########################################################
//import these 4 classes
import com.jmail.core.mailer.Mail;
import com.jmail.core.exception.JMailMessageException;
import com.jmail.core.exception.JMailSendException;
import com.jmail.core.exception.NoFileException;

public class TestClass {

  public void TestClass() { }
  public static void main(String[] args) {
     //set Host Name of String type like smtp.your-server.com (Remember this version supports only SMTP)
     //Uncomment next line if you want to use your own mail server  (Optional for licensed users)
     //Mail.setHost(hostName)
     //Mail.setFooter(false)  //If you don't like the default footer in message body
     //Mail.setBodyFont("Times New Roman"); //(Optional, when body is File and you want to override the default Courier New)
     //Mail.setBodyFontSize(4); //(Optional, when body is File and you want to override the default size 2)
     //Instantiate the Mail Con with required parameters
     String from = "abc@abc.com";
     String replyTO = "xyz@xyz.com";
     String to = "abc@abc.com,nbc@cnbc.com,fox@fox.com";  // comma seperated string for multiple emails
     String cc = "abc@abc.com,you@you.com,me@me.com";  // comma seperated string for multiple emails
     String bcc = "abc@abc.com,abz@abz.com";  // comma seperated string for multiple emails
     String subject = "Mail from your buddy";
     String body = "This is the Big String Body of the mail. This supports all HTML tags";
     //Comment the above line and uncomment next line to display File as Body
     //File body = new File(C:\\myfolder\\sampleFile.txt"); //This will preserve white spaces and indent in file
     String[] attachments = {"C:\\tmp\\sample.txt", "D:\\wrk\\Test.java"};

     Mail mail = new Mail(from,to,subject, body, attachments);
     //this is an optional public method to override the default reply to address
     //of the message from From Address to another different address
     mail.setReplyTO(replyTO);
     //catch NoFileException in only in case of File parameter for message body, passed to Constructor
     //catch the JMailMessageException to see the detailed exceptions

     try {
       mail.send();
     } catch (NoFileException nfex) {
         System.out.println("NoFileException...." + NoFileException.message());
    } catch (JMailMessageException jmx) {
      Exception ex = jmx;
      if (ex instanceof JMailSendException) {
        System.out.println("JMailSendException...." + JMailSendException.message());

        String[] invAddrList = JMailSendException.invalidAddresses();
        if (invAddrList != null)
          for (int i = 0; i < invAddrList.length; i++) {
            System.out.println("Invalid Address: " + invAddrList[i]);
          }

        String[] valSentAddrList = JMailSendException.validSentAddresses();
        if (valSentAddrList != null)
          for (int i = 0; i < valSentAddrList.length; i++) {
            System.out.println("Valid Sent Address: " + valSentAddrList[i]);
          }

          String[] valUnSentAddrList = JMailSendException.validUnsentAddresses();
          if (valUnSentAddrList != null)
            for (int i = 0; i < valUnSentAddrList.length; i++) {
              System.out.println("Valid Unsent Address: " + valUnSentAddrList[i]);
            }
      }
    }
  }
}// End of TestClass

Good Luck :)

Drop some coments to gerasunil@gerasunil.com