Send an Email Through the Amazon SES SMTP Interface with scala


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:

  1. 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
  2.  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.
  3.  you shold have IntelliJ or Eclipse
  4.  Install the AWS Toolkit – you can use dependecies for AWS Toolkit libraryDependencies += "com.amazonaws" % "aws-java-sdk" % "1.11.152"
  5. Create a shared credentials file – you must create a shared credentials file.

Procedure

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


KNOLDUS-advt-sticker

Advertisements
This entry was posted in Amazon EC2, AWS, AWS Services, Scala and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s