diff options
author | Avi Goldman <avrahamymgoldman@gmail.com> | 2016-06-24 15:51:34 -0400 |
---|---|---|
committer | Avi Goldman <avrahamymgoldman@gmail.com> | 2016-06-24 15:51:34 -0400 |
commit | 55d1bdc1ac65d63df6490f588f3d6e9eb506da79 (patch) | |
tree | b21a8ac66224692fe10b2a3cced0374d18ee7de1 /examples/transmission/rfc822.php | |
parent | 1b61a81471fc46cde5a515381e9642e0c884481c (diff) | |
parent | 12f363bb1f99891fb4b105009d20c596c35c87ae (diff) | |
download | php-sparkpost-55d1bdc1ac65d63df6490f588f3d6e9eb506da79.zip php-sparkpost-55d1bdc1ac65d63df6490f588f3d6e9eb506da79.tar.gz php-sparkpost-55d1bdc1ac65d63df6490f588f3d6e9eb506da79.tar.bz2 |
merged in 2x
Diffstat (limited to 'examples/transmission/rfc822.php')
-rw-r--r-- | examples/transmission/rfc822.php | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/examples/transmission/rfc822.php b/examples/transmission/rfc822.php deleted file mode 100644 index df2b06b..0000000 --- a/examples/transmission/rfc822.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $results = $sparky->transmission->send([ - 'recipients' => [ - [ - 'address' => [ - 'email' => 'john.doe@example.com', - ], - ], - ], - 'rfc822' => "Content-Type: text/plain\nFrom: From Envelope <from@sparkpostbox.com>\nSubject: Example Email\n\nHello World", - ]); - echo 'Congrats! You sent an email using SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} |