Envoi de newsletter HTML avec amazon ses

Petit snippet de script php utilisant le code de Anthone et Dan :

http://whitehatcrew.com/blog/free-php-class-for-sending-email-through-amazon-ses/

http://www.orderingdisorder.com/aws/ses/

<?php
require_once('ses.php');
$AccessKeyID='AKIAJT*******3XYQIWA';
$SecretKey='b8tTSghJqV*************y/HQ9';
$ses = new SimpleEmailService($AccessKeyID,$SecretKey);
$m = new SimpleEmailServiceMessage();
$m->setFrom('thomas@lyonsalsacongress.com');
$m->addTo('thomas@lyonsalsacongress.com');
$m->addBCC(array('salut@gmail.com', 'thomas@6www.net'));
$m->addReplyTo('thomas@lyonsalsacongress.com');
$m->setSubject('News du Lyon Salsa Congress');
$m->addRawMessageFromFile('html','news.html','text/html');
print_r($ses->sendEmail($m));
print_r($ses->getSendQuota());
print_r($ses->getSendStatistics());
?>

Il faut sauver la page en HTML depuis le navigateur et l’uploader sur le site.

Les functions : ses

Bon dimanche.

Leave a Reply

Your email address will not be published. Required fields are marked *