AWS SDK for Ruby
Developer Guide

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 sender@example.com with your "From" address. # This address must be verified with Amazon SES. sender = "sender@example.com" # Replace recipient@example.com with a "To" address. recipient = "recipient@example.com" # 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 = Aws::SES::Client.new(region: 'us-west-2') # Try to verify email address. begin ses.verify_email_identity({ email_address: recipient, }) puts 'Email sent to ' + email_address # 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.