title: Sending email using SES in typescript
body: <p>I am trying to set up email service using ses in typescript. I followed this example <a href="https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/javascript/example_code/ses/ses_sendemail.js" rel="nofollow noreferrer">https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/javascript/example_code/ses/ses_sendemail.js</a> but I get</p>
  <blockquote>
  <p>AWS.ses is not a constructor.</p>
  </blockquote>
  <p>Here is my emailService class</p>
  <pre><code>const AWS = require(&quot;aws-sdk&quot;);
  const loggerService: LoggerServiceInterface = new LoggerService();
  
  AWS.config.update({region: &quot;us-east-1&quot;});
  
  export class EmailService {
  
  sendEmail(recipient: string): Promise&lt;boolean&gt; {
  
   const params = {
    Destination: { /* required */
      CcAddresses: [
        &quot;abcd@gmail.com&quot;,
        /* more items */
      ],
      ToAddresses: [
        &quot;abcd@gmail.com&quot;,
        /* more items */
      ]
    },
    Message: { /* required */
      Body: { /* required */
        Html: {
         Charset: &quot;UTF-8&quot;,
         Data: &quot;HTML_FORMAT_BODY&quot;
        },
        Text: {
         Charset: &quot;UTF-8&quot;,
         Data: &quot;TEXT_FORMAT_BODY&quot;
        }
       },
       Subject: {
        Charset: &quot;UTF-8&quot;,
        Data: &quot;Test email&quot;
       }
      },
    Source: &quot;xyxy@gmail.com&quot;,
    ReplyToAddresses: [
       &quot;xyxy@gmail.com&quot;,
    ],
  };
  
  const sendPromise = new AWS.SES({apiVersion: &quot;2010-12-01&quot;}).sendEmail(params).promise();
  
  sendPromise.then(function(data) {
    console.log(data.MessageId);
  }).catch(
    function(err) {
    console.error(err, err.stack);
  });
  
  return Promise.resolve(true);
  }
  }
  </code></pre>
  <p>I am in a sanbox environment and both of those emails are verified. Am I missing something?</p>