Skip to content

Instantly share code, notes, and snippets.

@okochang
Created February 24, 2012 08:06
Show Gist options
  • Save okochang/1899052 to your computer and use it in GitHub Desktop.
Save okochang/1899052 to your computer and use it in GitHub Desktop.
awssdk for ruby send email
# -*- coding: utf-8 -*-
require 'aws-sdk'
# ACCESS_KEYとSECRET_KEYを定義します
ACCESS_KEY = 'YOUR_ACCESS_KEY'
SECRET_KEY = 'YOUR_SECRET_KEY'
# AWSの認証を行い、テストメールを送信します
ses = AWS::SimpleEmailService.new(:access_key_id => ACCESS_KEY,:secret_access_key => SECRET_KEY)
ses.send_email(
:subject => 'A Sample Email',
:from => 'sender@domain.com',
:to => 'receipient@domain.com',
:body_text => 'Sample email text.',
:body_html => '<h1>Sample Email</h1>')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment