Menu
Amazon Simple Email Service
Developer Guide

Part 7: Test the AWS Lambda Function

Before you schedule the Lambda function to run on a regular basis, you should test it to be sure that all of the components are configured properly. In this procedure, you send two messages through the Amazon SES mailbox simulator, and then run the Lambda function to ensure that messages are being processed properly.

To test the Lambda function

  1. Open the Amazon SES console at https://console.aws.amazon.com/ses/.

  2. In the column on the left, choose Email Addresses.

  3. Check the box next to a verified email address, and then choose Send a Test Email.

  4. For To:, type bounce@simulator.amazonses.com. For Subject and Body, type some sample text. Choose Send Test Email.

  5. Repeat step 4 to create a test message, but this time, for To:, type complaint@simulator.amazonses.com.

  6. Open the Amazon SQS console at https://console.aws.amazon.com/sqs/. The Messages Available column should indicate that 2 messages are available.

  7. Open the Lambda console at https://console.aws.amazon.com/lambda/.

  8. In the column on the left, choose Functions.

  9. In the list of functions, choose the function you created in Part 6: Create an AWS Lambda Function.

  10. Choose Test. When the function finishes running, expand the Details section. If the Lambda function was configured properly, you will receive one of the following messages:

    • null: Indicates that the function ran without errors.

    • Queue empty: Indicates that there were no new bounce or complaint notifications in the queue.

  11. Proceed to Part 8: Configure Triggers in Amazon CloudWatch.