title: Sending emails from local host - Play Framework
body: <p>Does anybody know the <code>smtp</code> settings that need to be applied within the <code>application.conf</code> file of a Play Framework project for sending emails on localhost?</p>
  
  <p>During my unit testing I am getting the error:</p>
  
  <blockquote>
    <p>A play.exceptions.MailException has been caught, Cannot send email</p>
  </blockquote>
  
  <p>The developers at Play have made sending emails so easy that the only way I could be messing up is with my settings in the config file.</p>
  
  <p>I have tried just using:</p>
  
  <pre><code>mail.smtp=mock
  </code></pre>
  
  <p>And I tried commenting out the line above and using:</p>
  
  <pre><code>mail.smtp.host=127.0.0.1
  </code></pre>
  
  <p>Neither of these two approaches work. I understand that this is probably a very noob question, but I have never really dealt with setting up emails before - so I am grateful for any help that can be contributed.</p>
  
  <p>If it is the case that I am unable to send email as Play would not work as an SMTP server, is there any way that I can use <code>mail.smtp=mock</code> to 'mock send' an email and allow my tests to pass?</p>
  
  <p><strong>Useful Link</strong></p>
  
  <p><a href="http://www.playframework.org/documentation/1.2.2/emails#smtp" rel="nofollow noreferrer">This is a link to the Play documentation for sending emails</a></p>