title: send email from node.js app using nodemailer
body: <p>From my ubuntu (10.04) box, I have no problem send email with:  </p>
  
  <pre><code>echo "hello" | mail -s 'test email' my_gmail_nickname@gmail.com
  </code></pre>
  
  <p>When I try to send an email from a node.js app running on the same machine, it does not work.</p>
  
  <pre><code>var nodemailer = require('nodemailer');
  nodemailer.SMTP = {
    host: 'localhost'
  }
  nodemailer.send_mail(
  {
      sender: 'me@example.com',
      to:'my_gmail_nickname@gmail.com',
      subject:'Hello!',
      html: 'test',
      body:'test'
  },
  function(error, success){
      console.log(error);
      console.log(success);
      console.log('Message ' + success ? 'sent' : 'failed');
  });
  </code></pre>
  
  <p>I have the error message:</p>
  
  <pre><code>me@luc:~/gridteams/services/gpshop$ cat nohup.out 
  { stack: [Getter/Setter],
    arguments: undefined,
    type: undefined,
    message: 'ECONNREFUSED, Connection refused',
    errno: 111,
    code: 'ECONNREFUSED',
    syscall: 'connect' }
  null
  sent
  </code></pre>
  
  <p>I see the connection refused but do not understand why I get this error. What do you think is the missing piece ?</p>