title: SMTPAppender for log4j -- can't get it to work
body: <p>I'm tying to add the SMTPAppender to an application for error notification (tomcat app).  I haven't been able to get it to work up to this point.  I have tried it using configuration both in the log4j.properties file as well as through the log4j.xml configuration.  I'm not seeing any errors in the log related to a misconfiguration of the appender setup.  I'm just not seeing any email attempts at all.  Initially I has to bring in javax.mail and javax.activation so I know that it's attempting to set up and use the SMTPAppender, but I'm not seeing anything as far as miconfiguration errors or emails that are sent when errors occur.</p>
  
  <p>Here's the log4j.properties that I tried (changed the private info)</p>
  
  <pre><code>log4j.appender.console=org.apache.log4j.ConsoleAppender
  log4j.appender.console.layout=org.apache.log4j.PatternLayout
  log4j.appender.console.layout.ConversionPattern=%-5p %d [%t] %c: %m%n
  
  log4j.appender.email=org.apache.log4j.net.SMTPAppender
  log4j.appender.email.Threshold=ERROR
  log4j.appender.email.BufferSize=512
  log4j.appender.email.To=myemail@mydomain.com
  log4j.appender.email.From=from@mydomain.com
  log4j.appender.email.SMTPHost=mysmtphost
  log4j.appender.email.Subject=MULE -- error  
  log4j.appender.email.layout=org.apache.log4j.PatternLayout
  log4j.appender.email.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
  log4j.appender.email.SMTPUsername=mysmtpuser
  log4j.appender.email.SMTPPassword=mysmtppassword
  </code></pre>
  
  <p>Here's the configuation that I tried in the log4j.xml file </p>
  
  <pre><code>&lt;appender name="console" class="org.apache.log4j.ConsoleAppender"&gt;      
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
          &lt;param name="ConversionPattern" value="%5p (%F:%L) - %m%n" /&gt;
      &lt;/layout&gt;
  &lt;/appender&gt;
  
  &lt;appender name="file" class="org.apache.log4j.RollingFileAppender"&gt;
      &lt;param name="File" value="/apps/data/pbymuleservices.log"/&gt;
      &lt;param name="Append" value="true"/&gt;
      &lt;param name="MaxFileSize" value="1000KB"/&gt;
      &lt;param name="MaxBackupIndex" value="10"/&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
           &lt;param name="ConversionPattern" value="%5p [%d{ISO8601}] (%F:%L) - %m%n"/&gt;
      &lt;/layout&gt;
  &lt;/appender&gt; 
  
  &lt;appender name="email" class="org.apache.log4j.net.SMTPAppender"&gt;
      &lt;param name="BufferSize" value="512" /&gt;
      &lt;param name="SMTPHost" value="mysmtphost" /&gt;
      &lt;param name="SMTPUsername" value="mysmtpusername" /&gt;
      &lt;param name="SMTPPassword" value="mysmtppassword" /&gt;
      &lt;param name="From" value="fromemail@mydomain.com" /&gt;
      &lt;param name="To" value="toemail@mydomain.com" /&gt;
      &lt;param name="Threshold" value="error" /&gt;
      &lt;param name="Subject" value="MULE -- Error" /&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
          &lt;param name="ConversionPattern" value="[%d{ISO8601}]%n%n%-5p%n%n%c%n%n%m%n%n" /&gt;
      &lt;/layout&gt;
      &lt;filter class="org.apache.log4j.varia.LevelRangeFilter"&gt;
          &lt;param name="LevelMin" value="error" /&gt;
          &lt;param name="LevelMax" value="fatal" /&gt;
      &lt;/filter&gt;
  &lt;/appender&gt;
  
  &lt;logger name="com.mytoplevel.package" additivity="false"&gt;
      &lt;level value="INFO"/&gt;
      &lt;appender-ref ref="console"/&gt; 
      &lt;appender-ref ref="file"/&gt; 
  &lt;/logger&gt;
  
  &lt;logger name="org.mule" additivity="false"&gt;
      &lt;level value="WARN"/&gt;
      &lt;appender-ref ref="console"/&gt; 
      &lt;appender-ref ref="file"/&gt; 
  &lt;/logger&gt;
  
  &lt;logger name="com.mulesource" additivity="false"&gt;
      &lt;level value="WARN"/&gt;
      &lt;appender-ref ref="console"/&gt; 
      &lt;appender-ref ref="file"/&gt; 
  &lt;/logger&gt;               
  
  &lt;root&gt;
      &lt;priority value="error" /&gt;
      &lt;appender-ref ref="console" /&gt;
      &lt;appender-ref ref="file"/&gt;
      &lt;appender-ref ref="email"/&gt; 
  &lt;/root&gt;
  </code></pre>
  
  <p>Anyone see anything that should keep this from working?  I'm not seeing any configuration related errors in the log, but I'm also not seeing emails when errors occur.
  Thanks</p>