title: No provider for smtp
body: <p>I'm running Alfresco v3.4.0E on Tomcat v.6.0.32. Everything works fine except for sending emails through an outbound SMTP server. This is the relevant part of the stack trace I get:</p>
  
  <pre><code>Caused by: org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.NoSuchProviderException: No provider for smtp 
      at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:418)
      at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:341)
      at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:356)
      at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:345)
      at org.alfresco.repo.action.executer.MailActionExecuter.executeImpl(MailActionExecuter.java:439)
      ... 144 more
  Caused by: javax.mail.NoSuchProviderException: No provider for smtp 
      at javax.mail.Session.getProvider(Session.java:455)
      at javax.mail.Session.getTransport(Session.java:650)
      at javax.mail.Session.getTransport(Session.java:631)
      at org.springframework.mail.javamail.JavaMailSenderImpl.getTransport(JavaMailSenderImpl.java:433)
      at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:387)
      ... 148 more
  </code></pre>
  
  <p>I already made sure that both mail.jar and activation.jar are included in the classpath:</p>
  
  <pre><code>[root tomcat]$ ll webapps/alfresco/WEB-INF/lib/ | grep mail.jar
  -rw-rw-r-- 1 alfresco alfresco   356519 Jan 17 20:38 mail.jar
  [root tomcat]$ ll webapps/alfresco/WEB-INF/lib/ | grep activation.jar
  -rw-rw-r-- 1 alfresco alfresco    55932 Jan 17 20:38 activation.jar
  </code></pre>
  
  <p>Here's an excerpt from my alfresco-global.properties:</p>
  
  <pre><code># Outbound SMTP -- sending emails from Alfresco to the outside world
  mail.from.default=noreply@domain.local
  mail.port=25 
  mail.protocol=smtp 
  mail.encoding=UTF-8
  mail.header=
  mail.smtp.auth=false
  mail.smtp.timeout=30000
  mail.host=smtp.domain.local
  </code></pre>
  
  <p>I already succeeded sending an email using that very same SMTP server via <code>telnet</code> from the Alfresco server.</p>
  
  <p>What am I missing?</p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>It turned out (thanks, <a href="http://twitter.com/#!/zaphgod" rel="nofollow">zaphgod</a>!) that it was all caused by some configuration problems: commenting out some properties solved the issue:</p>
  
  <pre><code># Outbound SMTP -- sending emails from Alfresco to the outside world
  mail.from.default=noreply@domain.local
  #mail.port=25 
  #mail.protocol=smtp 
  mail.encoding=UTF-8
  #mail.header=
  #mail.smtp.auth=false
  #mail.smtp.timeout=30000
  mail.host=smtp.domain.local
  </code></pre>
  
  <p>Now the question is, why this behavior? I'm pretty sure the properties I used first are with the default values..</p>