Class SendMail


public class SendMail
extends java.lang.Object

This class sends an email to the given address every time a task ends This class does exactly the same as the directive MAILTO extension in crontab

Sending an email has a strong limitation:

The log you receive by mail can be confused in multithreaded tasks or if you have more than two tasks running at the same time. Why? Cause The problem is that the output of the classes goes all to the same System.out and there is where jcrontab reads it. Then if you concurrent executions on you system the output you can receive bu mail can be confusing.

But how can i avoid that?

Using a better logging system for example log4j, take a look at, this system sends emails and does a lot of things more...

If you can't change your class or running a native program... well take it easy and be concious of the problem

$Revision: 1.5 $
$Author: iolalla $

Constructor Summary
Method Summary
 void send( file)
          This method sends the email to the given address by the config
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SendMail()
Method Detail


public void send( file)
          throws java.lang.Exception
This method sends the email to the given address by the config

file - the temporary file in which the output is stored