title: AWS SES - Nodemailer - transporter.sendEmail is not a function
body: <pre class="lang-js prettyprint-override"><code>const nodemailer = require('nodemailer');
  const aws = require('aws-sdk');
  aws.config.update({ region: 'myRegion');
  const senderEmail = process.env.SENDER_EMAIL;
  const destinationEmail = process.env.DESTINATION_EMAIL;
  const transporter = nodemailer.createTransport({
      SES: new aws.SES({
          apiVersion: '2010-12-01'
      })
  });
  exports.handler = async (event) =&gt; {
      let request = event.body;
      try {
          await this.sendEmail(request);
          return {
              'statusCode': 201,
              'headers': {
                  'Access-Control-Allow-Origin': '*'
              }
          };
      } catch (error) {
          return {
              'statusCode': 500
          };
      }
  };
  
  exports.sendEmail = async (request) =&gt; {
      try {
          await transporter.sendEmail({
              from: senderEmail,
              to: destinationEmail,
              subject: 'Hello',
              text: 'Hello using SES'
          });
      } catch (error) {
          console.log(error);
          throw error;
      }
  };
  </code></pre>
  <p>I have the following code which gives a error saying 'transporter.Email' is not a function. I have the following dependencies specified in my package.json (Some content is stripped but it is a valid JSON)</p>
  <pre class="lang-js prettyprint-override"><code>{
      &quot;devDependencies&quot;: {
          &quot;aws-sdk&quot;: &quot;^2.267.1&quot;,
          &quot;chai&quot;: &quot;^4.1.2&quot;,
          &quot;eslint&quot;: &quot;^5.1.0&quot;,
          &quot;eslint-config-standard&quot;: &quot;^11.0.0&quot;,
          &quot;eslint-plugin-import&quot;: &quot;^2.13.0&quot;,
          &quot;eslint-plugin-node&quot;: &quot;^6.0.1&quot;,
          &quot;eslint-plugin-promise&quot;: &quot;^3.8.0&quot;,
          &quot;eslint-plugin-standard&quot;: &quot;^3.1.0&quot;,
          &quot;hippie-swagger&quot;: &quot;^3.2.0&quot;,
          &quot;mocha&quot;: &quot;^5.1.1&quot;,
          &quot;mochawesome&quot;: &quot;^3.0.3&quot;,
          &quot;sinon&quot;: &quot;^6.1.0&quot;,
          &quot;swagger-parser&quot;: &quot;^5.0.2&quot;
      },
      &quot;dependencies&quot;: {
          &quot;axios&quot;: &quot;^0.18.0&quot;,
          &quot;nodemailer&quot;: &quot;^4.6.8&quot;,
          &quot;nodemailer-ses-transport&quot;: &quot;^1.5.1&quot;
      }
  }
  </code></pre>
  <p>At the first look, it does not look like a permissions issue, so ruling that out. Any pointers to fix it would be of great help.</p>
  <p>I am using Node.js 8.10 in lambda.</p>