1 | <?php |
||
21 | class Swift_Plugin_MailSend implements Swift_Events_SendListener, Swift_Events_BeforeSendListener |
||
22 | { |
||
23 | /** |
||
24 | * The operating system of the server |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $OS = null; |
||
|
|||
28 | /** |
||
29 | * The return path in use here |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $returnPath = null; |
||
33 | /** |
||
34 | * The line ending before we intrusively change it |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $oldLE = "\r\n"; |
||
38 | /** |
||
39 | * 5th parameter in mail(). |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $additionalParams; |
||
43 | |||
44 | /** |
||
45 | * Constructor. |
||
46 | * @param string 5th mail() function parameter as a sprintf() formatted string where %s is the sender. |
||
47 | */ |
||
48 | public function __construct($params="-oi -f %s") |
||
53 | /** |
||
54 | * Set the 5th mail() function parameter as a sprintf() formatted string where %s is the sender. |
||
55 | * @param string |
||
56 | */ |
||
57 | public function setAdditionalParams($params) |
||
61 | /** |
||
62 | * Get the 5th mail() function parameter as a sprintf() string. |
||
63 | * @return string |
||
64 | */ |
||
65 | public function getAdditionalParams() |
||
69 | /** |
||
70 | * Set the operating system string (changes behaviour with LE) |
||
71 | * @param string The operating system |
||
72 | * @param string $os |
||
73 | */ |
||
74 | public function setOS($os) |
||
78 | /** |
||
79 | * Get the operating system string |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getOS() |
||
86 | /** |
||
87 | * Check if this is windows or not |
||
88 | * @return boolean |
||
89 | */ |
||
90 | public function isWindows() |
||
94 | /** |
||
95 | * Swift's BeforeSendEvent listener. |
||
96 | * Invoked just before Swift sends a message |
||
97 | * @param Swift_Events_SendEvent The event information |
||
98 | */ |
||
99 | public function beforeSendPerformed(Swift_Events_SendEvent $e) |
||
106 | /** |
||
107 | * Swift's SendEvent listener. |
||
108 | * Invoked when Swift sends a message |
||
109 | * @param Swift_Events_SendEvent The event information |
||
110 | * @throws Swift_ConnectionException If mail() returns false |
||
111 | */ |
||
112 | public function sendPerformed(Swift_Events_SendEvent $e) |
||
153 | |||
154 | /** |
||
155 | * @param string $to |
||
156 | * @param string $subject |
||
157 | * @param string $message |
||
158 | * @param Swift_Message_Headers $headers |
||
159 | * @param string $params |
||
160 | */ |
||
161 | public function doMail($to, $subject, $message, $headers, $params) |
||
178 | } |
||
179 |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.