title: What is the proper way to configure SMTPAppender in log4j?
body: <p>I'm trying to configure log4j to use the <code>SMTPAppender</code> but I keep getting relay access denied errors.  I get this error when executing my code on my laptop AND straight from my shared hosting environment.</p>
  
  <p>Here's the relevant config:</p>
  
  <pre><code>#CONFIGURE SMTP
  log4j.appender.email=org.apache.log4j.net.SMTPAppender
  log4j.appender.email.SMTPHost=mydomain.com
  log4j.appender.email.SMTPUsername=myuser
  log4j.appender.email.SMTPPassword=mypw
  log4j.appender.email.From=myuser@mydomain.com
  log4j.appender.email.BufferSize=1
  log4j.appender.email.EvaluatorClass=TriggerLogEvent
  log4j.appender.email.layout=org.apache.log4j.PatternLayout
  log4j.appender.email.layout.ConversionPattern=%m
  </code></pre>
  
  <p>If I switch to <code>log4j.appender.email.SMTPHost=mail.mydomain.com</code> instead then I get authentication errors.  My hosting is on DreamHost so bonus points if anyone has set up log4j <code>SMTPAppender</code> using a DreamHost email account.</p>