SimpleExcel.php
[Pman.Core] / Tests / Mailer.php
1 <?php
2
3 require_once 'Pman.php';
4
5 class Pman_Core_Tests_Mailer extends Pman
6 {
7      static $cli_desc = "Send out Test emails using Mailer API";
8     
9     static $cli_opts = array(
10         'to' => array(
11             'desc' => 'TO: email address',
12           //  'default' => '',
13             'short' => 't',
14             'min' => 1,
15             'max' => 1,
16             
17         )
18     );
19     
20     function getAuth()
21     {
22         
23         if (!$this->bootLoader->cli) {
24             die("NOT PUBLIC");
25         }
26         
27     }
28     
29     function get($q,  $opts=array())
30     {
31         // send a test email to me...
32         $this->rcpts = $opts['to'];
33         $this->subject = "test email";
34         
35         for($i = 0; $i < 10; $i++) {
36             $this->test[$i] = $i;
37             
38         }
39         require_once 'Pman/Core/Mailer.php';
40         $r = new Pman_Core_Mailer(array(
41             'template'=> 'test',
42             'contents' => array(),
43             'page' => $this,
44             'attachments' => array(
45                 array(
46                
47                     'file' => '/home/alan/Documents/Nestplaytimespjadcover.pdf', // pass the file path DO NOT pass the file content
48                     'name' => 'Nestplaytimespjadcover.pdf',
49                     'mimetype' => 'application/pdf'
50                     
51                 )
52             )
53         ));
54         $res = $r->send();
55         var_dump($res);
56         
57         die("done?");
58         
59     }
60     
61     
62     
63 }