title: SES: Accessing email body inside lambda function
body: <p>I'm relatively new to AWS and I'm trying to process my email via Lambda Functions. I've built this one in node.js:</p>
  
  <pre><code>'use strict';
  
  exports.handler = (event, context, callback) =&gt; {
  
      var http = require('http');
      var data = JSON.stringify(event);
  
      var options = {
          host: 'my.host',
          port: '80',
          path: '/my/path',
          method: 'POST',
          headers: {
              'Content-Type': 'application/json; charset=utf-8',
              'Content-Length': data.length
          }
      };
  
      var req = http.request(options, function(res) {
          var msg = '';
  
          res.setEncoding('utf8');
          res.on('data', function(chunk) {
              msg += chunk;
          });
          res.on('end', function() {
              console.log(JSON.parse(msg));
          });
      });
  
      req.write(data);
      req.end();
  };
  </code></pre>
  
  <p>I've tested with the endpoint and it works perfectly, the problem is that I just now realized that the body of the message is never sent. How can I access the body of the message to send it and be processed by my api?</p>
  
  <p>If you need to see a sample of whats sent let me know.</p>