This simple code is a deployable example of a lambda/ses integration. It's using SAM for deployment purposes, so it's a matter of running a couple of commands in order for you to get started quickly and efficiently.
If you decided to host a static website on S3 but still want people to send you emails through your contact page, this might be a really nice solution for you. The combination of S3, API Gateway, Lambda, & SES covers the basis for a lot of website owners.
In order for this to work, you need to authorize the receiver (DESTINATION_EMAIL) of your setup. Otherwise SES will throw an exception saying that the destination email isn't verified. More info here: Verifying Email Addresses in Amazon SES
Running the cloudformation scripts will provision the needed resources, including API Gateway and Lambda, which might incur some costs
mvn package
mvn package
aws cloudformation package --template-file sam.yaml --s3-bucket code.bucket.name > /tmp/ses-deployment
aws cloudformation deploy --template-file /tmp/ses-deployment --stack-name send-email-stack --parameter-overrides RegionParameter=us-east-1 [email protected] --capabilities CAPABILITY_IAM
curl -XPOST -i -H "fromEmail: [email protected]" -H "subject: Hello World" -H "message: First Test" https://aaaaaaaa.execute-api.us-east-1.amazonaws.com/Prod/email