コード例 #1
0
ファイル: example.php プロジェクト: henderjon/gaggle
<?php

require "vendor/autoload.php";
/**
 * RichText Raw Message
 */
$message = new Gaggle\RichMessage();
$message->setHeaders(["from" => "*****@*****.**", "to" => "*****@*****.**", "subject" => "this should be rich text w/ an attachment"]);
$message->setMessage("this is some <strong>html</strong> text.");
$message->attachFile("./examples/attachment.txt");
print_r($message->marshal());
/**
 * AWS SES Message
 */
$config = array("access_key" => "", "secret_key" => "", "region" => "");
//overwrite our examples
if (file_exists("conf/config.ini")) {
    $config = parse_ini_file("conf/config.ini");
}
use Aws\Common\Aws;
// Instantiate an S3 client
$aws = Aws::factory(array("key" => $config["access_key"], "secret" => $config["secret_key"], "region" => $config["region"]));
$ses = $aws->get('ses');
$message = new Gaggle\SESMessage();
// this is NOT a valid, verified email addess
$message->setHeaders(["from" => "*****@*****.**", "to" => "*****@*****.**", "subject" => "this should be rich text w/ an attachment"]);
$message->setMessage("this is some <strong>html</strong> text.");
$response = $ses->sendEmail($message->marshal());
print_r($response);