1 | <?php |
||
29 | class Driver_SMTP extends Base |
||
30 | { |
||
31 | /** |
||
32 | * Stores the server address |
||
33 | **/ |
||
34 | private $_server = ''; |
||
|
|||
35 | |||
36 | /** |
||
37 | * Creates the mail handler object |
||
38 | * |
||
39 | * @param array $config Configuration details as an array |
||
40 | * |
||
41 | * @return \csphere\core\mail\Driver_SMTP |
||
42 | **/ |
||
43 | |||
44 | public function __construct(array $config) |
||
51 | |||
52 | /** |
||
53 | * Prepares a command list for later usage |
||
54 | * |
||
55 | * @param string $email Email target |
||
56 | * |
||
57 | * @return array |
||
58 | **/ |
||
59 | |||
60 | private function _commands($email) |
||
86 | |||
87 | /** |
||
88 | * Execute the commands on smtp server |
||
89 | * |
||
90 | * @param array $commands Commands to work with |
||
91 | * |
||
92 | * @return boolean |
||
93 | **/ |
||
94 | |||
95 | private function _remote(array $commands) |
||
142 | |||
143 | /** |
||
144 | * Handle SMTP Server communication errors |
||
145 | * |
||
146 | * @param integer $code Status code |
||
147 | * @param array $log Log as an array |
||
148 | * |
||
149 | * @throws \Exception |
||
150 | * |
||
151 | * @return void |
||
152 | **/ |
||
153 | |||
154 | private function _errorlog($code, array $log) |
||
164 | |||
165 | /** |
||
166 | * Prepares a mail by setting its content |
||
167 | * |
||
168 | * @param string $subject Subject to use in email |
||
169 | * @param string $message Message to use in email |
||
170 | * @param string $type Defaults to text/plain |
||
171 | * |
||
172 | * @return boolean |
||
173 | **/ |
||
174 | |||
175 | public function prepare($subject, $message, $type = 'text/plain') |
||
194 | |||
195 | /** |
||
196 | * Sends the prepared content to a given email |
||
197 | * |
||
198 | * @param string $email Email target |
||
199 | * @param boolean $clear Defaults to true which keeps mail data |
||
200 | * |
||
201 | * @return boolean |
||
202 | **/ |
||
203 | |||
204 | public function send($email, $clear = true) |
||
218 | } |
||
219 |