Tag: getting started


Amazon SES Documentation Enhancements

by Wendy Giberson | on | in Announcements | | Comments

I just wanted to bring your attention to some changes we’ve made to the Amazon SES documentation recently. We have listened to your feedback and are always working to make our documentation more helpful and easier to navigate.

The most notable updates we have made are:

  • We incorporated the Getting Started Guide with the Developer Guide, so you don’t have to change guides as you move from getting started and sending your first email to more advanced concepts.
  • We expanded the Getting Started section to include some introductory code samples in Java and C#. These new examples show you how to send an email in two ways: using the SMTP Interface and using an AWS SDK. We previously just had an example for the console.
  • We expanded the introduction to better explain where Amazon SES fits in to your email sending setup. We also explain basic Amazon SES concepts in terms of how they relate to deliverability, and discuss in more detail what happens when you send an email through Amazon SES.
  • We restructured the table of contents to make it easier to find the information you need.

If you’ve bookmarked links to the old documentation, your links should still work. They have been redirected to the new documentation.

As always, we really appreciate your feedback. Thanks for using Amazon SES!

 

Getting Started with Amazon SES and .NET

by Rohan Deshpande | on | in How To | | Comments

This post will help get you started using Amazon SES from .NET applications. Before you start working, make sure you are signed up for Amazon SES as described in the Getting Started Guide. This post assumes you are using Visual Studio for development.

Using SMTP

The easiest way to send email through Amazon SES is via SMTP. The Amazon SES SMTP endpoint requires delivery over authenticated encrypted connections (Transport Layer Security, or TLS).

  1. Generate your SMTP credentials according to these instructions. Please note that your SMTP credentials are different from your AWS credentials.
  2. Create a Console Application in Visual Studio.
  3. Add the following code to the Main method:
      String username = "SMTP-USERNAME";  // Replace with your SMTP username.
      String password = "SMTP-PASSWORD";  // Replace with your SMTP password.
      String host = "email-smtp.us-east-1.amazonaws.com";
      int port = 25;
       
      using (var client = new System.Net.Mail.SmtpClient(host, port))
      {
        client.Credentials = new System.Net.NetworkCredential(username, password);
        client.EnableSsl = true;
       
        client.Send
        (
                  "FROM@EXAMPLE.COM",  // Replace with the sender address.
                  "TO@EXAMPLE.COM",    // Replace with the recipient address.
                  "Testing Amazon SES through SMTP",			  
                  "This email was delivered through Amazon SES via the SMTP end point."
        );
      }	
  4. Run the application and check the recipient mailbox for your email.
  5. Advanced users can configure the SMTP credentials and SMTP end point using the <mailSettings> element as described in this Amazon SES forum post.

Using the AWS SDK

The AWS SDK gives you more control over email delivery through Amazon SES. Messages are delivered over HTTPS to the Amazon SES API.

  1. Create a Console Application in Visual Studio.
  2. Install the AWS SDK for .NET.
  3. SendEmail is the simplest action provided by the Amazon SES SDK. To send an email using this action, add the following code to your Main method:
       String source = "FROM@EXAMPLE.COM";        // Replace with the sender address.
       String recipient = "TO@EXAMPLE.COM";       // Replace with the recipient address.
       String awsAccessKey = "AWS-ACCESS-KEY";    // Replace with your AWS access key.
       String awsSecretKey = "AWS-SECRET-KEY";    // Replace with your AWS secret key.
        
       // Setup the email recipients.
       var oDestination = new Destination().WithToAddresses(new List<string>() { recipient });
        
       // Create the email subject.
       var oSubject = new Content().WithData("Testing Amazon SES through the API");
        
       // Create the email body.
       var oTextBody = new Content().WithData("This email was delivered through the Amazon SES API.");
       var oBody = new Body().WithText(oTextBody);
        
       // Create and transmit the email to the recipients via Amazon SES.
       var oMessage = new Message().WithSubject(oSubject).WithBody(oBody);
       var request = new SendEmailRequest().WithSource(source).WithDestination(oDestination).WithMessage(oMessage);
        
       using (var client = new AmazonSimpleEmailServiceClient(awsAccessKey, awsSecretKey))
       {
       		 client.SendEmail(request);
       }	 
  4. Run the application and check the recipient mailbox for your email.

Final Thoughts

We hope that you now have the basic information on how to get started with Amazon SES using .NET. Please review our API reference; it describes all actions, error codes and restrictions that apply to Amazon SES.

If you have comments or feedback about this service, please post them on the Amazon SES forums. We actively monitor the forum and frequently engage with customers. Happy sending with Amazon SES!