Verifying an Email Address in Amazon SES - AWS SDK for Ruby

Verifying an Email Address in Amazon SES

The following example demonstrates how to use the AWS SDK for Ruby to verify an Amazon SES email address.

require 'aws-sdk-ses' # v2: require 'aws-sdk' # Replace with a "To" address. recipient = "" # Create a new SES resource in the us-west-2 region. # Replace us-west-2 with the AWS Region you're using for Amazon SES. ses = 'us-west-2') # Try to verify email address. begin ses.verify_email_identity({ email_address: recipient }) puts 'Email sent to ' + recipient # If something goes wrong, display an error message. rescue Aws::SES::Errors::ServiceError => error puts "Email not sent. Error message: #{error}" end

See the complete example on GitHub.