title: Nodemailer and Amazon SES
body: <p>My structure:</p>
  
  <pre><code>site
  -- node_modules
  ---- nodemailer
  -- webclient
  ---- js
  ------- controller.js
  
  site/node_modules/nodemailer
  site/webclient/js/controller.js
  </code></pre>
  
  <p><strong>site/webclient/js/controller.js:</strong></p>
  
  <pre><code>    var nodemailer = require('../../node_modules/nodemailer');
  
      var transport = nodemailer.createTransport('SES', {
          AWSAccessKeyID: 'xxx', // real one in code
          AWSSecretKey: 'xxx', // real one in code
          ServiceUrl: 'email-smtp.us-west-2.amazonaws.com'
      });
  
      var message = {
          from: 'example@mail.com', // verified in Amazon AWS SES
          to: 'example@mail.com', // verified in Amazon AWS SES
          subject: 'testing',
          text: 'hello',
          html: '&lt;p&gt;&lt;b&gt;hello&lt;/b&gt;&lt;/p&gt;' +
                'test'
      };
  
      transport.sendMail(message, function(error) {
          if (error) {
              console.log(error);
          } else {
              console.log('Message sent: ' + response.message);
          }
      });
  </code></pre>
  
  <p>This code is part of a controller where all other functions within it work perfectly.</p>
  
  <ul>
  <li>Is there something I am missing?</li>
  <li>Perhaps I'm calling for the incorrect nodemailer module?</li>
  <li>Or should the transport be SMTP, not SES?</li>
  </ul>
  
  <p>I'm stuck.</p>