title: NoSuchProviderException: smtp with log4j SMTP appender
body: <p>I am using log4j to send an email when there is an exception. below is my log4j properties file configuration. </p>
  
  <pre><code>log4j.rootLogger=WARN, R, email
  log4j.appender.R=org.apache.log4j.ConsoleAppender
  log4j.appender.R.layout=org.apache.log4j.PatternLayout
  log4j.appender.R.layout.ConversionPattern=%d{HH:mm:ss} %-5p [%c{1}]: %m%n
  log4j.appender.email=org.apache.log4j.net.SMTPAppender
  log4j.appender.email.BufferSize=10
  log4j.appender.email.SMTPHost=myhost.com
  log4j.appender.email.From=abc@some.com
  log4j.appender.email.To=abc@some.com
  log4j.appender.email.Subject=Error
  log4j.appender.email.layout=org.apache.log4j.PatternLayout
  </code></pre>
  
  <p>mine is maven project i have added dependencies for mail.jar, activation.jar and smtp.jar. But on <strong>application server startup</strong> itself i get below error:</p>
  
  <pre><code>[ERROR] log4j:ERROR Error occured while sending e-mail notification.
  [ERROR] javax.mail.NoSuchProviderException: smtp
  [ERROR]     at javax.mail.Session.getService(Session.java:782)
  [ERROR]     at javax.mail.Session.getTransport(Session.java:708)
  [ERROR]     at javax.mail.Session.getTransport(Session.java:651)
  [ERROR]     at javax.mail.Session.getTransport(Session.java:631)
  [ERROR]     at javax.mail.Session.getTransport(Session.java:686)
  [ERROR]     at javax.mail.Transport.send0(Transport.java:166)
  </code></pre>
  
  <p>Am i missing any thing here? What is the root cause of the error? is it because of <strong>incorrect SMTP host name</strong>? or is it because of any missing/conflicting dependencies?</p>