title: how to send email with log4j SMTP appender
body: <p>I want send email to email group only once after I finish the java task.</p>
  
  <p>in log4j properties, I am able to send email,but is triggering email for every log statement.</p>
  
  <p>But my requirement is that to send email after all tasks are completed, meaning start java program, do some processing which will have multiple log statements, then send email.</p>
  
  <p>Below is my log4j smtp properties list.</p>
  
  <pre><code>#log4j.rootLogger=DEBUG, sendMail  
  #log4j.appender.stdout=org.apache.log4j.ConsoleAppender  
  #log4j.appender.stdout.layout=org.apache.log4j.PatternLayout  
  #log4j.appender.stdout.layout.ConversionPattern=[%5p] %d{mm:ss} (%F:%M:%L)%n%m%n%n  
  #log4j.appender.sendMail=org.apache.log4j.net.SMTPAppender  
  ##log4j.appender.sendMail.Threshold=WARN  
  #log4j.appender.sendMail.To=xx@domain.com   
  #log4j.appender.sendMail.From=xx@domain.com  
  #log4j.appender.sendMail.SMTPHost=10.13.16.57
  #log4j.appender.sendMail.Subject=Log4J Message  
  #log4j.appender.sendMail.layout=org.apache.log4j.PatternLayout  
  #log4j.appender.sendMail.layout.ConversionPattern=%p %t %c - %m%n  
  #log4j.appender.sendMail.BufferSize=1  
  #log4j.appender.sendMail.SMTPDebug=true 
  </code></pre>