title: Cannot send email from Play framework
body: <p>I am trying to use Play Framework to send out email. In applications.conf, when I set smtp.mock=true , it works perfectly well:</p>
  
  <pre><code>[info] application - HTML: Welcome to Play20StartApp. &lt;br&gt; Click on this link : http://localhost:9000/confirm/d77ea256-0d2e-4df5-b66e-e034159f8042 to confirm your email.&lt;br&gt;&lt;br&gt;--&lt;br&gt;null
  [debug] application - Mail sent - SMTP:smtp.google.com:465 SSL:yes user:username@gmail.com password:password
  </code></pre>
  
  <p>However, when I comment smtp.mock=true and attempt to send real emails, I get this error:</p>
  
  <pre><code>[debug] application - Mail.sendMail: Mail will be sent to user1@gmail.com
  [ERROR] [09/26/2013 03:46:05.014] [application-akka.actor.default-dispatcher-2] [TaskInvocation] From address required
  org.apache.commons.mail.EmailException: From address required
  </code></pre>
  
  <p>I have set smtp.user to a proper value, i.e. server@businessdomain.com . Any idea what causes this error?</p>
  
  <p>Troubleshooting steps</p>
  
  <ol>
  <li>The emails used are real emails, for the purpose of posting, they are anonymized. Likewise, a real domain name is used</li>
  <li>Tested with a working local mail server (exim), as well as directly sending through Gmail (smtp.google.com) and Google Apps (aspmx.l.google.com) servers. These settings have been verified using mail clients.</li>
  <li><p>The Java code snippet below works perfectly,</p>
  
  <p>import java.util.<em>;
      import javax.mail.</em>;
      import javax.mail.internet.<em>;
      import javax.activation.</em>;</p>
  
  <pre><code>public class SendEmail
  {
      public static void main(String [] args)
      {
          String to = "recipient@mydomain.com";
          String from = "sender@mydomain.com";
          String host = "localhost";
  
          Properties properties = System.getProperties();
  
          // Setup mail server
          properties.setProperty("mail.smtp.host", host);
  
          // Get the default Session object.
          Session session = Session.getDefaultInstance(properties);
  
          try{
              MimeMessage message = new MimeMessage(session);
  
              // Set From: header field of the header.
              message.setFrom(new InternetAddress(from));
  
              message.addRecipient(Message.RecipientType.TO,
                      new InternetAddress(to));
              message.setSubject("Subject of email");
              message.setText("This is actual message");
  
              Transport.send(message);
              System.out.println("Sent message successfully....");
          }catch (MessagingException mex) {
              mex.printStackTrace();
          }
      }
  }
  </code></pre></li>
  </ol>