Advertisement
Guest User

Untitled

a guest
Dec 25th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. <?php
  2.  
  3. ini_set('display_errors', 1);
  4. ini_set('display_startup_errors', 1);
  5. error_reporting(E_ALL);
  6.  
  7. use AwsSesSesClient;
  8.  
  9. require 'vendor/autoload.php';
  10.  
  11. $client = SesClient::factory(array(
  12. 'key' => 'SECRET_KEY',
  13. 'secret' => 'SECRET_SECRET',
  14. 'region' => 'eu-west-1',
  15. 'version' => '2010-12-01'
  16. ));
  17.  
  18. $emailSentId = $client->sendEmail(array(
  19. // Source is required
  20. 'Source' => 'donotreply@mydomain.com',
  21. // Destination is required
  22. 'Destination' => array(
  23. 'ToAddresses' => array('sendto@mydomain.com')
  24. ),
  25. // Message is required
  26. 'Message' => array(
  27. // Subject is required
  28. 'Subject' => array(
  29. // Data is required
  30. 'Data' => 'SES Testing',
  31. 'Charset' => 'UTF-8',
  32. ),
  33. // Body is required
  34. 'Body' => array(
  35. 'Text' => array(
  36. // Data is required
  37. 'Data' => 'My plain text email',
  38. 'Charset' => 'UTF-8',
  39. ),
  40. 'Html' => array(
  41. // Data is required
  42. 'Data' => '<b>My HTML Email</b>',
  43. 'Charset' => 'UTF-8',
  44. ),
  45. ),
  46. ),
  47. 'ReplyToAddresses' => array( 'donotreply@mydomain.com' ),
  48. 'ReturnPath' => 'donotreply@mydomain.com'
  49. ));
  50.  
  51.  
  52.  
  53.  
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement