summaryrefslogtreecommitdiffstats
path: root/examples/transmission/simple_send.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/transmission/simple_send.php')
-rw-r--r--examples/transmission/simple_send.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/transmission/simple_send.php b/examples/transmission/simple_send.php
new file mode 100644
index 0000000..8149238
--- /dev/null
+++ b/examples/transmission/simple_send.php
@@ -0,0 +1,29 @@
+<?php
+namespace Examples\Transmisson;
+require_once (dirname(__FILE__).'/../bootstrap.php');
+
+use SparkPost\SparkPost;
+use SparkPost\Transmission;
+
+$key = 'YOURAPIKEY';
+SparkPost::setConfig(array('key'=>$key));
+
+try {
+ $results = Transmission::send(array(
+ "from"=>"From Envelope <from@example.com>",
+ "html"=>"<p>Hello World!</p>",
+ "text"=>"Hello World!",
+ "subject"=>"Example Email",
+ "recipients"=>array(
+ array(
+ "address"=>array(
+ "email"=>"john.doe@example.com"
+ )
+ )
+ )
+ ));
+ echo 'Congrats you can use your SDK!';
+} catch (\Exception $exception) {
+ echo $exception->getMessage();
+}
+?> \ No newline at end of file