NodeMailer No Recipients Defined
<p>When trying to send an email from a node.js server using nodemailer, I get the following error:</p>

<pre><code>ERROR: Send Error: No recipients defined
</code></pre>

<p>My code is as follows:</p>

<p>client side:</p>

<pre><code>var mailData = {
        from: "myemail@gmail.com",
        to: "someoneelse@something.com",
        subject: "test",
        text: "test email"
    };

  $.ajax({
        type: 'POST',
        data: mailData,
        contentType: 'application/json',
        url: 'http://localhost:8080/sendEmail',
        success: function(mailData) {
            console.log('successfully posted to server.');
        }
    });
</code></pre>

<p>server side:</p>

<pre><code>var nodemailer = require('nodemailer');

app.post('/sendEmail', function(mailData) {

   var transporter = nodemailer.createTransport({
       service: 'gmail',
       auth: {
           user: 'myemail@gmail.com',
           pass: 'mypassword'
       },
   });

   transporter.sendMail(mailData, function(error, info) {
       if (error) {
           console.log(error);
           return;
       }
       console.log('Message sent');
       transporter.close();
   });

});
</code></pre>

<p>This is in line with the nodemailer docs, and the SMTP handshake always finishes successfully, so I know that this is not an issue with the transporter object.</p>