The following procedure shows you how to use AWS Toolkit for IntelliJ to create an AWS SDK project and modify the scala code to send an email through Amazon SES.
In this getting started tutorial, you send an email to yourself so that you can check to see if you received it. For further experimentation or load testing, use the Amazon SES mailbox simulator.
Prerequisites – Before you begin, perform the following tasks:
- Verify your email address with Amazon SES – Before you can send an email with Amazon SES, you must verify that you own the sender’s email address. If your account is still in the Amazon SES sandbox, you must also verify the recipient email address. The easiest way to verify email addresses is by using the Amazon SES console. For more information, see Verification Procedures
- Get your AWS credentials — You need an AWS access key ID and AWS secret access key to access Amazon SES using an SDK. You can find your credentials by using the Security Credentials page in the AWS Management Console. For more information about credentials, see Using Credentials With Amazon SES.
- you shold have IntelliJ or Eclipse
- Install the AWS Toolkit – you can use dependecies for AWS Toolkit
libraryDependencies += "com.amazonaws" % "aws-java-sdk" % "1.11.152"
- Create a shared credentials file – you must create a shared credentials file.
The following procedure shows how to send an email through Amazon SES using the AWS SDK for scala.
- Create an sbt scala Project in IntelliJ
- Add the above dependency in to build.sbt
- Replace the entire contents of AmazonSES MailingApi.scala with the following code:
The Whole code present HERE