Skip to content

Instantly share code, notes, and snippets.

@nobuf
Created February 20, 2011 22:28
Show Gist options
  • Save nobuf/836381 to your computer and use it in GitHub Desktop.
Save nobuf/836381 to your computer and use it in GitHub Desktop.
Sending email with Amazon SES in sandbox
<?php
require_once './sdk.class.php'; // http://aws.amazon.com/sdkforphp/
define('VERIFIED_FROM_EMAIL_ADDRESS', 'from@example.com');
define('VERIFIED_TO_EMAIL_ADDRESS', 'to@example.com');
$ses = new AmazonSES(AWS_KEY, AWS_SECRET_KEY);
var_dump($ses->send_email(VERIFIED_FROM_EMAIL_ADDRESS,
array('ToAddresses' => VERIFIED_TO_EMAIL_ADDRESS),
array(
'Subject' => array('Data' => 'Hello!'),
'Body' => array('Html' => array('Data' => '<h1>Hello World!</h1><ul><li>foo</li><li>bar</li></ul>')),
)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment