Added feature #15998: Create a new API to send mails based on SwiftMailer to replace...
[Packages/TYPO3.CMS.git] / typo3 / contrib / swiftmailer / classes / Swift / Events / ResponseEvent.php
1 <?php
2
3 /*
4 * This file is part of SwiftMailer.
5 * (c) 2004-2009 Chris Corbyn
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11 //@require 'Swift/Events/EventObject.php';
12
13 /**
14 * Generated when a response is received on a SMTP connection.
15 * @package Swift
16 * @subpackage Events
17 * @author Chris Corbyn
18 */
19 class Swift_Events_ResponseEvent extends Swift_Events_EventObject
20 {
21
22 /**
23 * The overall result.
24 * @var boolean
25 */
26 private $_valid;
27
28 /**
29 * The response received from the server.
30 * @var string
31 */
32 private $_response;
33
34 /**
35 * Create a new ResponseEvent for $source and $response.
36 * @param Swift_Transport $source
37 * @param string $response
38 * @param boolean $valid
39 */
40 public function __construct(Swift_Transport $source, $response, $valid = false)
41 {
42 parent::__construct($source);
43 $this->_response = $response;
44 $this->_valid = $valid;
45 }
46
47 /**
48 * Get the response which was received from the server.
49 * @return string
50 */
51 public function getResponse()
52 {
53 return $this->_response;
54 }
55
56 /**
57 * Get the success status of this Event.
58 * @return boolean
59 */
60 public function isValid()
61 {
62 return $this->_valid;
63 }
64
65 }