Version Description
- WordPress 5.5 compatibility update.
Download this release
Release Info
Developer | naa986 |
Plugin | Gmail SMTP |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.9 to 1.2.0
- PHPMailer/PHPMailerAutoload.php +0 -51
- PHPMailer/class.phpmailer.php +0 -4044
- PHPMailer/class.phpmaileroauth.php +0 -197
- PHPMailer/class.phpmaileroauthgoogle.php +0 -77
- PHPMailer/class.pop3.php +0 -407
- PHPMailer/class.smtp.php +0 -1276
- PHPMailer/get_oauth_token.php +0 -162
- PHPMailer/language/phpmailer.lang-am.php +0 -26
- PHPMailer/language/phpmailer.lang-ar.php +0 -27
- PHPMailer/language/phpmailer.lang-az.php +0 -26
- PHPMailer/language/phpmailer.lang-ba.php +0 -26
- PHPMailer/language/phpmailer.lang-be.php +0 -26
- PHPMailer/language/phpmailer.lang-bg.php +0 -26
- PHPMailer/language/phpmailer.lang-ca.php +0 -26
- PHPMailer/language/phpmailer.lang-ch.php +0 -26
- PHPMailer/language/phpmailer.lang-cs.php +0 -25
- PHPMailer/language/phpmailer.lang-da.php +0 -26
- PHPMailer/language/phpmailer.lang-de.php +0 -25
- PHPMailer/language/phpmailer.lang-el.php +0 -25
- PHPMailer/language/phpmailer.lang-eo.php +0 -25
- PHPMailer/language/phpmailer.lang-es.php +0 -26
- PHPMailer/language/phpmailer.lang-et.php +0 -27
- PHPMailer/language/phpmailer.lang-fa.php +0 -27
- PHPMailer/language/phpmailer.lang-fi.php +0 -27
- PHPMailer/language/phpmailer.lang-fo.php +0 -26
- PHPMailer/language/phpmailer.lang-fr.php +0 -29
- PHPMailer/language/phpmailer.lang-gl.php +0 -26
- PHPMailer/language/phpmailer.lang-he.php +0 -26
- PHPMailer/language/phpmailer.lang-hr.php +0 -26
- PHPMailer/language/phpmailer.lang-hu.php +0 -26
- PHPMailer/language/phpmailer.lang-id.php +0 -26
- PHPMailer/language/phpmailer.lang-it.php +0 -27
- PHPMailer/language/phpmailer.lang-ja.php +0 -27
- PHPMailer/language/phpmailer.lang-ka.php +0 -26
- PHPMailer/language/phpmailer.lang-ko.php +0 -26
- PHPMailer/language/phpmailer.lang-lt.php +0 -26
- PHPMailer/language/phpmailer.lang-lv.php +0 -26
- PHPMailer/language/phpmailer.lang-ms.php +0 -26
- PHPMailer/language/phpmailer.lang-nb.php +0 -25
- PHPMailer/language/phpmailer.lang-nl.php +0 -26
- PHPMailer/language/phpmailer.lang-pl.php +0 -26
- PHPMailer/language/phpmailer.lang-pt.php +0 -26
- PHPMailer/language/phpmailer.lang-pt_br.php +0 -29
- PHPMailer/language/phpmailer.lang-ro.php +0 -26
- PHPMailer/language/phpmailer.lang-rs.php +0 -26
- PHPMailer/language/phpmailer.lang-ru.php +0 -27
- PHPMailer/language/phpmailer.lang-sk.php +0 -26
- PHPMailer/language/phpmailer.lang-sl.php +0 -26
- PHPMailer/language/phpmailer.lang-sv.php +0 -26
- PHPMailer/language/phpmailer.lang-tr.php +0 -30
- PHPMailer/language/phpmailer.lang-uk.php +0 -27
- PHPMailer/language/phpmailer.lang-vi.php +0 -26
- PHPMailer/language/phpmailer.lang-zh.php +0 -28
- PHPMailer/language/phpmailer.lang-zh_cn.php +0 -28
- class.phpmaileroauth.php +5 -7
- main.php +388 -381
- readme.txt +23 -4
PHPMailer/PHPMailerAutoload.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PHPMailer SPL autoloader.
|
4 |
-
* PHP Version 5
|
5 |
-
* @package PHPMailer
|
6 |
-
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
7 |
-
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
8 |
-
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
9 |
-
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
10 |
-
* @author Brent R. Matzelle (original founder)
|
11 |
-
* @copyright 2012 - 2014 Marcus Bointon
|
12 |
-
* @copyright 2010 - 2012 Jim Jagielski
|
13 |
-
* @copyright 2004 - 2009 Andy Prevost
|
14 |
-
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
15 |
-
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
16 |
-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE.
|
18 |
-
*/
|
19 |
-
|
20 |
-
/**
|
21 |
-
* PHPMailer SPL autoloader.
|
22 |
-
* @param string $classname The name of the class to load
|
23 |
-
*/
|
24 |
-
function PHPMailerAutoload($classname)
|
25 |
-
{
|
26 |
-
//Can't use __DIR__ as it's only in PHP 5.3+
|
27 |
-
$filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
|
28 |
-
if (is_readable($filename)) {
|
29 |
-
require $filename;
|
30 |
-
}
|
31 |
-
}
|
32 |
-
|
33 |
-
if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
|
34 |
-
//SPL autoloading was introduced in PHP 5.1.2
|
35 |
-
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
36 |
-
spl_autoload_register('PHPMailerAutoload', true, true);
|
37 |
-
} else {
|
38 |
-
spl_autoload_register('PHPMailerAutoload');
|
39 |
-
}
|
40 |
-
} else {
|
41 |
-
/**
|
42 |
-
* Fall back to traditional autoload for old PHP versions
|
43 |
-
* @param string $classname The name of the class to load
|
44 |
-
*/
|
45 |
-
/* commented out this code since PHP 7.2 shows a notice even though this part is not getting executed
|
46 |
-
function __autoload($classname)
|
47 |
-
{
|
48 |
-
PHPMailerAutoload($classname);
|
49 |
-
}
|
50 |
-
*/
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/class.phpmailer.php
DELETED
@@ -1,4044 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PHPMailer - PHP email creation and transport class.
|
4 |
-
* PHP Version 5
|
5 |
-
* @package PHPMailer
|
6 |
-
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
7 |
-
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
8 |
-
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
9 |
-
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
10 |
-
* @author Brent R. Matzelle (original founder)
|
11 |
-
* @copyright 2012 - 2014 Marcus Bointon
|
12 |
-
* @copyright 2010 - 2012 Jim Jagielski
|
13 |
-
* @copyright 2004 - 2009 Andy Prevost
|
14 |
-
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
15 |
-
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
16 |
-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE.
|
18 |
-
*/
|
19 |
-
|
20 |
-
/**
|
21 |
-
* PHPMailer - PHP email creation and transport class.
|
22 |
-
* @package PHPMailer
|
23 |
-
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
24 |
-
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
25 |
-
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
26 |
-
* @author Brent R. Matzelle (original founder)
|
27 |
-
*/
|
28 |
-
class PHPMailer
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* The PHPMailer Version number.
|
32 |
-
* @var string
|
33 |
-
*/
|
34 |
-
public $Version = '5.2.26';
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Email priority.
|
38 |
-
* Options: null (default), 1 = High, 3 = Normal, 5 = low.
|
39 |
-
* When null, the header is not set at all.
|
40 |
-
* @var integer
|
41 |
-
*/
|
42 |
-
public $Priority = null;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* The character set of the message.
|
46 |
-
* @var string
|
47 |
-
*/
|
48 |
-
public $CharSet = 'iso-8859-1';
|
49 |
-
|
50 |
-
/**
|
51 |
-
* The MIME Content-type of the message.
|
52 |
-
* @var string
|
53 |
-
*/
|
54 |
-
public $ContentType = 'text/plain';
|
55 |
-
|
56 |
-
/**
|
57 |
-
* The message encoding.
|
58 |
-
* Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".
|
59 |
-
* @var string
|
60 |
-
*/
|
61 |
-
public $Encoding = '8bit';
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Holds the most recent mailer error message.
|
65 |
-
* @var string
|
66 |
-
*/
|
67 |
-
public $ErrorInfo = '';
|
68 |
-
|
69 |
-
/**
|
70 |
-
* The From email address for the message.
|
71 |
-
* @var string
|
72 |
-
*/
|
73 |
-
public $From = 'root@localhost';
|
74 |
-
|
75 |
-
/**
|
76 |
-
* The From name of the message.
|
77 |
-
* @var string
|
78 |
-
*/
|
79 |
-
public $FromName = 'Root User';
|
80 |
-
|
81 |
-
/**
|
82 |
-
* The Sender email (Return-Path) of the message.
|
83 |
-
* If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
|
84 |
-
* @var string
|
85 |
-
*/
|
86 |
-
public $Sender = '';
|
87 |
-
|
88 |
-
/**
|
89 |
-
* The Return-Path of the message.
|
90 |
-
* If empty, it will be set to either From or Sender.
|
91 |
-
* @var string
|
92 |
-
* @deprecated Email senders should never set a return-path header;
|
93 |
-
* it's the receiver's job (RFC5321 section 4.4), so this no longer does anything.
|
94 |
-
* @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference
|
95 |
-
*/
|
96 |
-
public $ReturnPath = '';
|
97 |
-
|
98 |
-
/**
|
99 |
-
* The Subject of the message.
|
100 |
-
* @var string
|
101 |
-
*/
|
102 |
-
public $Subject = '';
|
103 |
-
|
104 |
-
/**
|
105 |
-
* An HTML or plain text message body.
|
106 |
-
* If HTML then call isHTML(true).
|
107 |
-
* @var string
|
108 |
-
*/
|
109 |
-
public $Body = '';
|
110 |
-
|
111 |
-
/**
|
112 |
-
* The plain-text message body.
|
113 |
-
* This body can be read by mail clients that do not have HTML email
|
114 |
-
* capability such as mutt & Eudora.
|
115 |
-
* Clients that can read HTML will view the normal Body.
|
116 |
-
* @var string
|
117 |
-
*/
|
118 |
-
public $AltBody = '';
|
119 |
-
|
120 |
-
/**
|
121 |
-
* An iCal message part body.
|
122 |
-
* Only supported in simple alt or alt_inline message types
|
123 |
-
* To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator
|
124 |
-
* @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/
|
125 |
-
* @link http://kigkonsult.se/iCalcreator/
|
126 |
-
* @var string
|
127 |
-
*/
|
128 |
-
public $Ical = '';
|
129 |
-
|
130 |
-
/**
|
131 |
-
* The complete compiled MIME message body.
|
132 |
-
* @access protected
|
133 |
-
* @var string
|
134 |
-
*/
|
135 |
-
protected $MIMEBody = '';
|
136 |
-
|
137 |
-
/**
|
138 |
-
* The complete compiled MIME message headers.
|
139 |
-
* @var string
|
140 |
-
* @access protected
|
141 |
-
*/
|
142 |
-
protected $MIMEHeader = '';
|
143 |
-
|
144 |
-
/**
|
145 |
-
* Extra headers that createHeader() doesn't fold in.
|
146 |
-
* @var string
|
147 |
-
* @access protected
|
148 |
-
*/
|
149 |
-
protected $mailHeader = '';
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Word-wrap the message body to this number of chars.
|
153 |
-
* Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance.
|
154 |
-
* @var integer
|
155 |
-
*/
|
156 |
-
public $WordWrap = 0;
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Which method to use to send mail.
|
160 |
-
* Options: "mail", "sendmail", or "smtp".
|
161 |
-
* @var string
|
162 |
-
*/
|
163 |
-
public $Mailer = 'mail';
|
164 |
-
|
165 |
-
/**
|
166 |
-
* The path to the sendmail program.
|
167 |
-
* @var string
|
168 |
-
*/
|
169 |
-
public $Sendmail = '/usr/sbin/sendmail';
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Whether mail() uses a fully sendmail-compatible MTA.
|
173 |
-
* One which supports sendmail's "-oi -f" options.
|
174 |
-
* @var boolean
|
175 |
-
*/
|
176 |
-
public $UseSendmailOptions = true;
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Path to PHPMailer plugins.
|
180 |
-
* Useful if the SMTP class is not in the PHP include path.
|
181 |
-
* @var string
|
182 |
-
* @deprecated Should not be needed now there is an autoloader.
|
183 |
-
*/
|
184 |
-
public $PluginDir = '';
|
185 |
-
|
186 |
-
/**
|
187 |
-
* The email address that a reading confirmation should be sent to, also known as read receipt.
|
188 |
-
* @var string
|
189 |
-
*/
|
190 |
-
public $ConfirmReadingTo = '';
|
191 |
-
|
192 |
-
/**
|
193 |
-
* The hostname to use in the Message-ID header and as default HELO string.
|
194 |
-
* If empty, PHPMailer attempts to find one with, in order,
|
195 |
-
* $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value
|
196 |
-
* 'localhost.localdomain'.
|
197 |
-
* @var string
|
198 |
-
*/
|
199 |
-
public $Hostname = '';
|
200 |
-
|
201 |
-
/**
|
202 |
-
* An ID to be used in the Message-ID header.
|
203 |
-
* If empty, a unique id will be generated.
|
204 |
-
* You can set your own, but it must be in the format "<id@domain>",
|
205 |
-
* as defined in RFC5322 section 3.6.4 or it will be ignored.
|
206 |
-
* @see https://tools.ietf.org/html/rfc5322#section-3.6.4
|
207 |
-
* @var string
|
208 |
-
*/
|
209 |
-
public $MessageID = '';
|
210 |
-
|
211 |
-
/**
|
212 |
-
* The message Date to be used in the Date header.
|
213 |
-
* If empty, the current date will be added.
|
214 |
-
* @var string
|
215 |
-
*/
|
216 |
-
public $MessageDate = '';
|
217 |
-
|
218 |
-
/**
|
219 |
-
* SMTP hosts.
|
220 |
-
* Either a single hostname or multiple semicolon-delimited hostnames.
|
221 |
-
* You can also specify a different port
|
222 |
-
* for each host by using this format: [hostname:port]
|
223 |
-
* (e.g. "smtp1.example.com:25;smtp2.example.com").
|
224 |
-
* You can also specify encryption type, for example:
|
225 |
-
* (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465").
|
226 |
-
* Hosts will be tried in order.
|
227 |
-
* @var string
|
228 |
-
*/
|
229 |
-
public $Host = 'localhost';
|
230 |
-
|
231 |
-
/**
|
232 |
-
* The default SMTP server port.
|
233 |
-
* @var integer
|
234 |
-
* @TODO Why is this needed when the SMTP class takes care of it?
|
235 |
-
*/
|
236 |
-
public $Port = 25;
|
237 |
-
|
238 |
-
/**
|
239 |
-
* The SMTP HELO of the message.
|
240 |
-
* Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find
|
241 |
-
* one with the same method described above for $Hostname.
|
242 |
-
* @var string
|
243 |
-
* @see PHPMailer::$Hostname
|
244 |
-
*/
|
245 |
-
public $Helo = '';
|
246 |
-
|
247 |
-
/**
|
248 |
-
* What kind of encryption to use on the SMTP connection.
|
249 |
-
* Options: '', 'ssl' or 'tls'
|
250 |
-
* @var string
|
251 |
-
*/
|
252 |
-
public $SMTPSecure = '';
|
253 |
-
|
254 |
-
/**
|
255 |
-
* Whether to enable TLS encryption automatically if a server supports it,
|
256 |
-
* even if `SMTPSecure` is not set to 'tls'.
|
257 |
-
* Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
|
258 |
-
* @var boolean
|
259 |
-
*/
|
260 |
-
public $SMTPAutoTLS = true;
|
261 |
-
|
262 |
-
/**
|
263 |
-
* Whether to use SMTP authentication.
|
264 |
-
* Uses the Username and Password properties.
|
265 |
-
* @var boolean
|
266 |
-
* @see PHPMailer::$Username
|
267 |
-
* @see PHPMailer::$Password
|
268 |
-
*/
|
269 |
-
public $SMTPAuth = false;
|
270 |
-
|
271 |
-
/**
|
272 |
-
* Options array passed to stream_context_create when connecting via SMTP.
|
273 |
-
* @var array
|
274 |
-
*/
|
275 |
-
public $SMTPOptions = array();
|
276 |
-
|
277 |
-
/**
|
278 |
-
* SMTP username.
|
279 |
-
* @var string
|
280 |
-
*/
|
281 |
-
public $Username = '';
|
282 |
-
|
283 |
-
/**
|
284 |
-
* SMTP password.
|
285 |
-
* @var string
|
286 |
-
*/
|
287 |
-
public $Password = '';
|
288 |
-
|
289 |
-
/**
|
290 |
-
* SMTP auth type.
|
291 |
-
* Options are CRAM-MD5, LOGIN, PLAIN, NTLM, XOAUTH2, attempted in that order if not specified
|
292 |
-
* @var string
|
293 |
-
*/
|
294 |
-
public $AuthType = '';
|
295 |
-
|
296 |
-
/**
|
297 |
-
* SMTP realm.
|
298 |
-
* Used for NTLM auth
|
299 |
-
* @var string
|
300 |
-
*/
|
301 |
-
public $Realm = '';
|
302 |
-
|
303 |
-
/**
|
304 |
-
* SMTP workstation.
|
305 |
-
* Used for NTLM auth
|
306 |
-
* @var string
|
307 |
-
*/
|
308 |
-
public $Workstation = '';
|
309 |
-
|
310 |
-
/**
|
311 |
-
* The SMTP server timeout in seconds.
|
312 |
-
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
|
313 |
-
* @var integer
|
314 |
-
*/
|
315 |
-
public $Timeout = 300;
|
316 |
-
|
317 |
-
/**
|
318 |
-
* SMTP class debug output mode.
|
319 |
-
* Debug output level.
|
320 |
-
* Options:
|
321 |
-
* * `0` No output
|
322 |
-
* * `1` Commands
|
323 |
-
* * `2` Data and commands
|
324 |
-
* * `3` As 2 plus connection status
|
325 |
-
* * `4` Low-level data output
|
326 |
-
* @var integer
|
327 |
-
* @see SMTP::$do_debug
|
328 |
-
*/
|
329 |
-
public $SMTPDebug = 0;
|
330 |
-
|
331 |
-
/**
|
332 |
-
* How to handle debug output.
|
333 |
-
* Options:
|
334 |
-
* * `echo` Output plain-text as-is, appropriate for CLI
|
335 |
-
* * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
|
336 |
-
* * `error_log` Output to error log as configured in php.ini
|
337 |
-
*
|
338 |
-
* Alternatively, you can provide a callable expecting two params: a message string and the debug level:
|
339 |
-
* <code>
|
340 |
-
* $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
|
341 |
-
* </code>
|
342 |
-
* @var string|callable
|
343 |
-
* @see SMTP::$Debugoutput
|
344 |
-
*/
|
345 |
-
public $Debugoutput = 'echo';
|
346 |
-
|
347 |
-
/**
|
348 |
-
* Whether to keep SMTP connection open after each message.
|
349 |
-
* If this is set to true then to close the connection
|
350 |
-
* requires an explicit call to smtpClose().
|
351 |
-
* @var boolean
|
352 |
-
*/
|
353 |
-
public $SMTPKeepAlive = false;
|
354 |
-
|
355 |
-
/**
|
356 |
-
* Whether to split multiple to addresses into multiple messages
|
357 |
-
* or send them all in one message.
|
358 |
-
* Only supported in `mail` and `sendmail` transports, not in SMTP.
|
359 |
-
* @var boolean
|
360 |
-
*/
|
361 |
-
public $SingleTo = false;
|
362 |
-
|
363 |
-
/**
|
364 |
-
* Storage for addresses when SingleTo is enabled.
|
365 |
-
* @var array
|
366 |
-
* @TODO This should really not be public
|
367 |
-
*/
|
368 |
-
public $SingleToArray = array();
|
369 |
-
|
370 |
-
/**
|
371 |
-
* Whether to generate VERP addresses on send.
|
372 |
-
* Only applicable when sending via SMTP.
|
373 |
-
* @link https://en.wikipedia.org/wiki/Variable_envelope_return_path
|
374 |
-
* @link http://www.postfix.org/VERP_README.html Postfix VERP info
|
375 |
-
* @var boolean
|
376 |
-
*/
|
377 |
-
public $do_verp = false;
|
378 |
-
|
379 |
-
/**
|
380 |
-
* Whether to allow sending messages with an empty body.
|
381 |
-
* @var boolean
|
382 |
-
*/
|
383 |
-
public $AllowEmpty = false;
|
384 |
-
|
385 |
-
/**
|
386 |
-
* The default line ending.
|
387 |
-
* @note The default remains "\n". We force CRLF where we know
|
388 |
-
* it must be used via self::CRLF.
|
389 |
-
* @var string
|
390 |
-
*/
|
391 |
-
public $LE = "\n";
|
392 |
-
|
393 |
-
/**
|
394 |
-
* DKIM selector.
|
395 |
-
* @var string
|
396 |
-
*/
|
397 |
-
public $DKIM_selector = '';
|
398 |
-
|
399 |
-
/**
|
400 |
-
* DKIM Identity.
|
401 |
-
* Usually the email address used as the source of the email.
|
402 |
-
* @var string
|
403 |
-
*/
|
404 |
-
public $DKIM_identity = '';
|
405 |
-
|
406 |
-
/**
|
407 |
-
* DKIM passphrase.
|
408 |
-
* Used if your key is encrypted.
|
409 |
-
* @var string
|
410 |
-
*/
|
411 |
-
public $DKIM_passphrase = '';
|
412 |
-
|
413 |
-
/**
|
414 |
-
* DKIM signing domain name.
|
415 |
-
* @example 'example.com'
|
416 |
-
* @var string
|
417 |
-
*/
|
418 |
-
public $DKIM_domain = '';
|
419 |
-
|
420 |
-
/**
|
421 |
-
* DKIM private key file path.
|
422 |
-
* @var string
|
423 |
-
*/
|
424 |
-
public $DKIM_private = '';
|
425 |
-
|
426 |
-
/**
|
427 |
-
* DKIM private key string.
|
428 |
-
* If set, takes precedence over `$DKIM_private`.
|
429 |
-
* @var string
|
430 |
-
*/
|
431 |
-
public $DKIM_private_string = '';
|
432 |
-
|
433 |
-
/**
|
434 |
-
* Callback Action function name.
|
435 |
-
*
|
436 |
-
* The function that handles the result of the send email action.
|
437 |
-
* It is called out by send() for each email sent.
|
438 |
-
*
|
439 |
-
* Value can be any php callable: http://www.php.net/is_callable
|
440 |
-
*
|
441 |
-
* Parameters:
|
442 |
-
* boolean $result result of the send action
|
443 |
-
* array $to email addresses of the recipients
|
444 |
-
* array $cc cc email addresses
|
445 |
-
* array $bcc bcc email addresses
|
446 |
-
* string $subject the subject
|
447 |
-
* string $body the email body
|
448 |
-
* string $from email address of sender
|
449 |
-
* @var string
|
450 |
-
*/
|
451 |
-
public $action_function = '';
|
452 |
-
|
453 |
-
/**
|
454 |
-
* What to put in the X-Mailer header.
|
455 |
-
* Options: An empty string for PHPMailer default, whitespace for none, or a string to use
|
456 |
-
* @var string
|
457 |
-
*/
|
458 |
-
public $XMailer = '';
|
459 |
-
|
460 |
-
/**
|
461 |
-
* Which validator to use by default when validating email addresses.
|
462 |
-
* May be a callable to inject your own validator, but there are several built-in validators.
|
463 |
-
* @see PHPMailer::validateAddress()
|
464 |
-
* @var string|callable
|
465 |
-
* @static
|
466 |
-
*/
|
467 |
-
public static $validator = 'auto';
|
468 |
-
|
469 |
-
/**
|
470 |
-
* An instance of the SMTP sender class.
|
471 |
-
* @var SMTP
|
472 |
-
* @access protected
|
473 |
-
*/
|
474 |
-
protected $smtp = null;
|
475 |
-
|
476 |
-
/**
|
477 |
-
* The array of 'to' names and addresses.
|
478 |
-
* @var array
|
479 |
-
* @access protected
|
480 |
-
*/
|
481 |
-
protected $to = array();
|
482 |
-
|
483 |
-
/**
|
484 |
-
* The array of 'cc' names and addresses.
|
485 |
-
* @var array
|
486 |
-
* @access protected
|
487 |
-
*/
|
488 |
-
protected $cc = array();
|
489 |
-
|
490 |
-
/**
|
491 |
-
* The array of 'bcc' names and addresses.
|
492 |
-
* @var array
|
493 |
-
* @access protected
|
494 |
-
*/
|
495 |
-
protected $bcc = array();
|
496 |
-
|
497 |
-
/**
|
498 |
-
* The array of reply-to names and addresses.
|
499 |
-
* @var array
|
500 |
-
* @access protected
|
501 |
-
*/
|
502 |
-
protected $ReplyTo = array();
|
503 |
-
|
504 |
-
/**
|
505 |
-
* An array of all kinds of addresses.
|
506 |
-
* Includes all of $to, $cc, $bcc
|
507 |
-
* @var array
|
508 |
-
* @access protected
|
509 |
-
* @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
|
510 |
-
*/
|
511 |
-
protected $all_recipients = array();
|
512 |
-
|
513 |
-
/**
|
514 |
-
* An array of names and addresses queued for validation.
|
515 |
-
* In send(), valid and non duplicate entries are moved to $all_recipients
|
516 |
-
* and one of $to, $cc, or $bcc.
|
517 |
-
* This array is used only for addresses with IDN.
|
518 |
-
* @var array
|
519 |
-
* @access protected
|
520 |
-
* @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
|
521 |
-
* @see PHPMailer::$all_recipients
|
522 |
-
*/
|
523 |
-
protected $RecipientsQueue = array();
|
524 |
-
|
525 |
-
/**
|
526 |
-
* An array of reply-to names and addresses queued for validation.
|
527 |
-
* In send(), valid and non duplicate entries are moved to $ReplyTo.
|
528 |
-
* This array is used only for addresses with IDN.
|
529 |
-
* @var array
|
530 |
-
* @access protected
|
531 |
-
* @see PHPMailer::$ReplyTo
|
532 |
-
*/
|
533 |
-
protected $ReplyToQueue = array();
|
534 |
-
|
535 |
-
/**
|
536 |
-
* The array of attachments.
|
537 |
-
* @var array
|
538 |
-
* @access protected
|
539 |
-
*/
|
540 |
-
protected $attachment = array();
|
541 |
-
|
542 |
-
/**
|
543 |
-
* The array of custom headers.
|
544 |
-
* @var array
|
545 |
-
* @access protected
|
546 |
-
*/
|
547 |
-
protected $CustomHeader = array();
|
548 |
-
|
549 |
-
/**
|
550 |
-
* The most recent Message-ID (including angular brackets).
|
551 |
-
* @var string
|
552 |
-
* @access protected
|
553 |
-
*/
|
554 |
-
protected $lastMessageID = '';
|
555 |
-
|
556 |
-
/**
|
557 |
-
* The message's MIME type.
|
558 |
-
* @var string
|
559 |
-
* @access protected
|
560 |
-
*/
|
561 |
-
protected $message_type = '';
|
562 |
-
|
563 |
-
/**
|
564 |
-
* The array of MIME boundary strings.
|
565 |
-
* @var array
|
566 |
-
* @access protected
|
567 |
-
*/
|
568 |
-
protected $boundary = array();
|
569 |
-
|
570 |
-
/**
|
571 |
-
* The array of available languages.
|
572 |
-
* @var array
|
573 |
-
* @access protected
|
574 |
-
*/
|
575 |
-
protected $language = array();
|
576 |
-
|
577 |
-
/**
|
578 |
-
* The number of errors encountered.
|
579 |
-
* @var integer
|
580 |
-
* @access protected
|
581 |
-
*/
|
582 |
-
protected $error_count = 0;
|
583 |
-
|
584 |
-
/**
|
585 |
-
* The S/MIME certificate file path.
|
586 |
-
* @var string
|
587 |
-
* @access protected
|
588 |
-
*/
|
589 |
-
protected $sign_cert_file = '';
|
590 |
-
|
591 |
-
/**
|
592 |
-
* The S/MIME key file path.
|
593 |
-
* @var string
|
594 |
-
* @access protected
|
595 |
-
*/
|
596 |
-
protected $sign_key_file = '';
|
597 |
-
|
598 |
-
/**
|
599 |
-
* The optional S/MIME extra certificates ("CA Chain") file path.
|
600 |
-
* @var string
|
601 |
-
* @access protected
|
602 |
-
*/
|
603 |
-
protected $sign_extracerts_file = '';
|
604 |
-
|
605 |
-
/**
|
606 |
-
* The S/MIME password for the key.
|
607 |
-
* Used only if the key is encrypted.
|
608 |
-
* @var string
|
609 |
-
* @access protected
|
610 |
-
*/
|
611 |
-
protected $sign_key_pass = '';
|
612 |
-
|
613 |
-
/**
|
614 |
-
* Whether to throw exceptions for errors.
|
615 |
-
* @var boolean
|
616 |
-
* @access protected
|
617 |
-
*/
|
618 |
-
protected $exceptions = false;
|
619 |
-
|
620 |
-
/**
|
621 |
-
* Unique ID used for message ID and boundaries.
|
622 |
-
* @var string
|
623 |
-
* @access protected
|
624 |
-
*/
|
625 |
-
protected $uniqueid = '';
|
626 |
-
|
627 |
-
/**
|
628 |
-
* Error severity: message only, continue processing.
|
629 |
-
*/
|
630 |
-
const STOP_MESSAGE = 0;
|
631 |
-
|
632 |
-
/**
|
633 |
-
* Error severity: message, likely ok to continue processing.
|
634 |
-
*/
|
635 |
-
const STOP_CONTINUE = 1;
|
636 |
-
|
637 |
-
/**
|
638 |
-
* Error severity: message, plus full stop, critical error reached.
|
639 |
-
*/
|
640 |
-
const STOP_CRITICAL = 2;
|
641 |
-
|
642 |
-
/**
|
643 |
-
* SMTP RFC standard line ending.
|
644 |
-
*/
|
645 |
-
const CRLF = "\r\n";
|
646 |
-
|
647 |
-
/**
|
648 |
-
* The maximum line length allowed by RFC 2822 section 2.1.1
|
649 |
-
* @var integer
|
650 |
-
*/
|
651 |
-
const MAX_LINE_LENGTH = 998;
|
652 |
-
|
653 |
-
/**
|
654 |
-
* Constructor.
|
655 |
-
* @param boolean $exceptions Should we throw external exceptions?
|
656 |
-
*/
|
657 |
-
public function __construct($exceptions = null)
|
658 |
-
{
|
659 |
-
if ($exceptions !== null) {
|
660 |
-
$this->exceptions = (boolean)$exceptions;
|
661 |
-
}
|
662 |
-
//Pick an appropriate debug output format automatically
|
663 |
-
$this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html');
|
664 |
-
}
|
665 |
-
|
666 |
-
/**
|
667 |
-
* Destructor.
|
668 |
-
*/
|
669 |
-
public function __destruct()
|
670 |
-
{
|
671 |
-
//Close any open SMTP connection nicely
|
672 |
-
$this->smtpClose();
|
673 |
-
}
|
674 |
-
|
675 |
-
/**
|
676 |
-
* Call mail() in a safe_mode-aware fashion.
|
677 |
-
* Also, unless sendmail_path points to sendmail (or something that
|
678 |
-
* claims to be sendmail), don't pass params (not a perfect fix,
|
679 |
-
* but it will do)
|
680 |
-
* @param string $to To
|
681 |
-
* @param string $subject Subject
|
682 |
-
* @param string $body Message Body
|
683 |
-
* @param string $header Additional Header(s)
|
684 |
-
* @param string $params Params
|
685 |
-
* @access private
|
686 |
-
* @return boolean
|
687 |
-
*/
|
688 |
-
private function mailPassthru($to, $subject, $body, $header, $params)
|
689 |
-
{
|
690 |
-
//Check overloading of mail function to avoid double-encoding
|
691 |
-
if (ini_get('mbstring.func_overload') & 1) {
|
692 |
-
$subject = $this->secureHeader($subject);
|
693 |
-
} else {
|
694 |
-
$subject = $this->encodeHeader($this->secureHeader($subject));
|
695 |
-
}
|
696 |
-
|
697 |
-
//Can't use additional_parameters in safe_mode, calling mail() with null params breaks
|
698 |
-
//@link http://php.net/manual/en/function.mail.php
|
699 |
-
if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) {
|
700 |
-
$result = @mail($to, $subject, $body, $header);
|
701 |
-
} else {
|
702 |
-
$result = @mail($to, $subject, $body, $header, $params);
|
703 |
-
}
|
704 |
-
return $result;
|
705 |
-
}
|
706 |
-
/**
|
707 |
-
* Output debugging info via user-defined method.
|
708 |
-
* Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).
|
709 |
-
* @see PHPMailer::$Debugoutput
|
710 |
-
* @see PHPMailer::$SMTPDebug
|
711 |
-
* @param string $str
|
712 |
-
*/
|
713 |
-
protected function edebug($str)
|
714 |
-
{
|
715 |
-
if ($this->SMTPDebug <= 0) {
|
716 |
-
return;
|
717 |
-
}
|
718 |
-
//Avoid clash with built-in function names
|
719 |
-
if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
|
720 |
-
call_user_func($this->Debugoutput, $str, $this->SMTPDebug);
|
721 |
-
return;
|
722 |
-
}
|
723 |
-
switch ($this->Debugoutput) {
|
724 |
-
case 'error_log':
|
725 |
-
//Don't output, just log
|
726 |
-
error_log($str);
|
727 |
-
break;
|
728 |
-
case 'html':
|
729 |
-
//Cleans up output a bit for a better looking, HTML-safe output
|
730 |
-
echo htmlentities(
|
731 |
-
preg_replace('/[\r\n]+/', '', $str),
|
732 |
-
ENT_QUOTES,
|
733 |
-
'UTF-8'
|
734 |
-
)
|
735 |
-
. "<br>\n";
|
736 |
-
break;
|
737 |
-
case 'echo':
|
738 |
-
default:
|
739 |
-
//Normalize line breaks
|
740 |
-
$str = preg_replace('/\r\n?/ms', "\n", $str);
|
741 |
-
echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
|
742 |
-
"\n",
|
743 |
-
"\n \t ",
|
744 |
-
trim($str)
|
745 |
-
) . "\n";
|
746 |
-
}
|
747 |
-
}
|
748 |
-
|
749 |
-
/**
|
750 |
-
* Sets message type to HTML or plain.
|
751 |
-
* @param boolean $isHtml True for HTML mode.
|
752 |
-
* @return void
|
753 |
-
*/
|
754 |
-
public function isHTML($isHtml = true)
|
755 |
-
{
|
756 |
-
if ($isHtml) {
|
757 |
-
$this->ContentType = 'text/html';
|
758 |
-
} else {
|
759 |
-
$this->ContentType = 'text/plain';
|
760 |
-
}
|
761 |
-
}
|
762 |
-
|
763 |
-
/**
|
764 |
-
* Send messages using SMTP.
|
765 |
-
* @return void
|
766 |
-
*/
|
767 |
-
public function isSMTP()
|
768 |
-
{
|
769 |
-
$this->Mailer = 'smtp';
|
770 |
-
}
|
771 |
-
|
772 |
-
/**
|
773 |
-
* Send messages using PHP's mail() function.
|
774 |
-
* @return void
|
775 |
-
*/
|
776 |
-
public function isMail()
|
777 |
-
{
|
778 |
-
$this->Mailer = 'mail';
|
779 |
-
}
|
780 |
-
|
781 |
-
/**
|
782 |
-
* Send messages using $Sendmail.
|
783 |
-
* @return void
|
784 |
-
*/
|
785 |
-
public function isSendmail()
|
786 |
-
{
|
787 |
-
$ini_sendmail_path = ini_get('sendmail_path');
|
788 |
-
|
789 |
-
if (!stristr($ini_sendmail_path, 'sendmail')) {
|
790 |
-
$this->Sendmail = '/usr/sbin/sendmail';
|
791 |
-
} else {
|
792 |
-
$this->Sendmail = $ini_sendmail_path;
|
793 |
-
}
|
794 |
-
$this->Mailer = 'sendmail';
|
795 |
-
}
|
796 |
-
|
797 |
-
/**
|
798 |
-
* Send messages using qmail.
|
799 |
-
* @return void
|
800 |
-
*/
|
801 |
-
public function isQmail()
|
802 |
-
{
|
803 |
-
$ini_sendmail_path = ini_get('sendmail_path');
|
804 |
-
|
805 |
-
if (!stristr($ini_sendmail_path, 'qmail')) {
|
806 |
-
$this->Sendmail = '/var/qmail/bin/qmail-inject';
|
807 |
-
} else {
|
808 |
-
$this->Sendmail = $ini_sendmail_path;
|
809 |
-
}
|
810 |
-
$this->Mailer = 'qmail';
|
811 |
-
}
|
812 |
-
|
813 |
-
/**
|
814 |
-
* Add a "To" address.
|
815 |
-
* @param string $address The email address to send to
|
816 |
-
* @param string $name
|
817 |
-
* @return boolean true on success, false if address already used or invalid in some way
|
818 |
-
*/
|
819 |
-
public function addAddress($address, $name = '')
|
820 |
-
{
|
821 |
-
return $this->addOrEnqueueAnAddress('to', $address, $name);
|
822 |
-
}
|
823 |
-
|
824 |
-
/**
|
825 |
-
* Add a "CC" address.
|
826 |
-
* @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
|
827 |
-
* @param string $address The email address to send to
|
828 |
-
* @param string $name
|
829 |
-
* @return boolean true on success, false if address already used or invalid in some way
|
830 |
-
*/
|
831 |
-
public function addCC($address, $name = '')
|
832 |
-
{
|
833 |
-
return $this->addOrEnqueueAnAddress('cc', $address, $name);
|
834 |
-
}
|
835 |
-
|
836 |
-
/**
|
837 |
-
* Add a "BCC" address.
|
838 |
-
* @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
|
839 |
-
* @param string $address The email address to send to
|
840 |
-
* @param string $name
|
841 |
-
* @return boolean true on success, false if address already used or invalid in some way
|
842 |
-
*/
|
843 |
-
public function addBCC($address, $name = '')
|
844 |
-
{
|
845 |
-
return $this->addOrEnqueueAnAddress('bcc', $address, $name);
|
846 |
-
}
|
847 |
-
|
848 |
-
/**
|
849 |
-
* Add a "Reply-To" address.
|
850 |
-
* @param string $address The email address to reply to
|
851 |
-
* @param string $name
|
852 |
-
* @return boolean true on success, false if address already used or invalid in some way
|
853 |
-
*/
|
854 |
-
public function addReplyTo($address, $name = '')
|
855 |
-
{
|
856 |
-
return $this->addOrEnqueueAnAddress('Reply-To', $address, $name);
|
857 |
-
}
|
858 |
-
|
859 |
-
/**
|
860 |
-
* Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer
|
861 |
-
* can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still
|
862 |
-
* be modified after calling this function), addition of such addresses is delayed until send().
|
863 |
-
* Addresses that have been added already return false, but do not throw exceptions.
|
864 |
-
* @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
|
865 |
-
* @param string $address The email address to send, resp. to reply to
|
866 |
-
* @param string $name
|
867 |
-
* @throws phpmailerException
|
868 |
-
* @return boolean true on success, false if address already used or invalid in some way
|
869 |
-
* @access protected
|
870 |
-
*/
|
871 |
-
protected function addOrEnqueueAnAddress($kind, $address, $name)
|
872 |
-
{
|
873 |
-
$address = trim($address);
|
874 |
-
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
|
875 |
-
if (($pos = strrpos($address, '@')) === false) {
|
876 |
-
// At-sign is misssing.
|
877 |
-
$error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
|
878 |
-
$this->setError($error_message);
|
879 |
-
$this->edebug($error_message);
|
880 |
-
if ($this->exceptions) {
|
881 |
-
throw new phpmailerException($error_message);
|
882 |
-
}
|
883 |
-
return false;
|
884 |
-
}
|
885 |
-
$params = array($kind, $address, $name);
|
886 |
-
// Enqueue addresses with IDN until we know the PHPMailer::$CharSet.
|
887 |
-
if ($this->has8bitChars(substr($address, ++$pos)) and $this->idnSupported()) {
|
888 |
-
if ($kind != 'Reply-To') {
|
889 |
-
if (!array_key_exists($address, $this->RecipientsQueue)) {
|
890 |
-
$this->RecipientsQueue[$address] = $params;
|
891 |
-
return true;
|
892 |
-
}
|
893 |
-
} else {
|
894 |
-
if (!array_key_exists($address, $this->ReplyToQueue)) {
|
895 |
-
$this->ReplyToQueue[$address] = $params;
|
896 |
-
return true;
|
897 |
-
}
|
898 |
-
}
|
899 |
-
return false;
|
900 |
-
}
|
901 |
-
// Immediately add standard addresses without IDN.
|
902 |
-
return call_user_func_array(array($this, 'addAnAddress'), $params);
|
903 |
-
}
|
904 |
-
|
905 |
-
/**
|
906 |
-
* Add an address to one of the recipient arrays or to the ReplyTo array.
|
907 |
-
* Addresses that have been added already return false, but do not throw exceptions.
|
908 |
-
* @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
|
909 |
-
* @param string $address The email address to send, resp. to reply to
|
910 |
-
* @param string $name
|
911 |
-
* @throws phpmailerException
|
912 |
-
* @return boolean true on success, false if address already used or invalid in some way
|
913 |
-
* @access protected
|
914 |
-
*/
|
915 |
-
protected function addAnAddress($kind, $address, $name = '')
|
916 |
-
{
|
917 |
-
if (!in_array($kind, array('to', 'cc', 'bcc', 'Reply-To'))) {
|
918 |
-
$error_message = $this->lang('Invalid recipient kind: ') . $kind;
|
919 |
-
$this->setError($error_message);
|
920 |
-
$this->edebug($error_message);
|
921 |
-
if ($this->exceptions) {
|
922 |
-
throw new phpmailerException($error_message);
|
923 |
-
}
|
924 |
-
return false;
|
925 |
-
}
|
926 |
-
if (!$this->validateAddress($address)) {
|
927 |
-
$error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
|
928 |
-
$this->setError($error_message);
|
929 |
-
$this->edebug($error_message);
|
930 |
-
if ($this->exceptions) {
|
931 |
-
throw new phpmailerException($error_message);
|
932 |
-
}
|
933 |
-
return false;
|
934 |
-
}
|
935 |
-
if ($kind != 'Reply-To') {
|
936 |
-
if (!array_key_exists(strtolower($address), $this->all_recipients)) {
|
937 |
-
array_push($this->$kind, array($address, $name));
|
938 |
-
$this->all_recipients[strtolower($address)] = true;
|
939 |
-
return true;
|
940 |
-
}
|
941 |
-
} else {
|
942 |
-
if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
|
943 |
-
$this->ReplyTo[strtolower($address)] = array($address, $name);
|
944 |
-
return true;
|
945 |
-
}
|
946 |
-
}
|
947 |
-
return false;
|
948 |
-
}
|
949 |
-
|
950 |
-
/**
|
951 |
-
* Parse and validate a string containing one or more RFC822-style comma-separated email addresses
|
952 |
-
* of the form "display name <address>" into an array of name/address pairs.
|
953 |
-
* Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available.
|
954 |
-
* Note that quotes in the name part are removed.
|
955 |
-
* @param string $addrstr The address list string
|
956 |
-
* @param bool $useimap Whether to use the IMAP extension to parse the list
|
957 |
-
* @return array
|
958 |
-
* @link http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation
|
959 |
-
*/
|
960 |
-
public function parseAddresses($addrstr, $useimap = true)
|
961 |
-
{
|
962 |
-
$addresses = array();
|
963 |
-
if ($useimap and function_exists('imap_rfc822_parse_adrlist')) {
|
964 |
-
//Use this built-in parser if it's available
|
965 |
-
$list = imap_rfc822_parse_adrlist($addrstr, '');
|
966 |
-
foreach ($list as $address) {
|
967 |
-
if ($address->host != '.SYNTAX-ERROR.') {
|
968 |
-
if ($this->validateAddress($address->mailbox . '@' . $address->host)) {
|
969 |
-
$addresses[] = array(
|
970 |
-
'name' => (property_exists($address, 'personal') ? $address->personal : ''),
|
971 |
-
'address' => $address->mailbox . '@' . $address->host
|
972 |
-
);
|
973 |
-
}
|
974 |
-
}
|
975 |
-
}
|
976 |
-
} else {
|
977 |
-
//Use this simpler parser
|
978 |
-
$list = explode(',', $addrstr);
|
979 |
-
foreach ($list as $address) {
|
980 |
-
$address = trim($address);
|
981 |
-
//Is there a separate name part?
|
982 |
-
if (strpos($address, '<') === false) {
|
983 |
-
//No separate name, just use the whole thing
|
984 |
-
if ($this->validateAddress($address)) {
|
985 |
-
$addresses[] = array(
|
986 |
-
'name' => '',
|
987 |
-
'address' => $address
|
988 |
-
);
|
989 |
-
}
|
990 |
-
} else {
|
991 |
-
list($name, $email) = explode('<', $address);
|
992 |
-
$email = trim(str_replace('>', '', $email));
|
993 |
-
if ($this->validateAddress($email)) {
|
994 |
-
$addresses[] = array(
|
995 |
-
'name' => trim(str_replace(array('"', "'"), '', $name)),
|
996 |
-
'address' => $email
|
997 |
-
);
|
998 |
-
}
|
999 |
-
}
|
1000 |
-
}
|
1001 |
-
}
|
1002 |
-
return $addresses;
|
1003 |
-
}
|
1004 |
-
|
1005 |
-
/**
|
1006 |
-
* Set the From and FromName properties.
|
1007 |
-
* @param string $address
|
1008 |
-
* @param string $name
|
1009 |
-
* @param boolean $auto Whether to also set the Sender address, defaults to true
|
1010 |
-
* @throws phpmailerException
|
1011 |
-
* @return boolean
|
1012 |
-
*/
|
1013 |
-
public function setFrom($address, $name = '', $auto = true)
|
1014 |
-
{
|
1015 |
-
$address = trim($address);
|
1016 |
-
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
|
1017 |
-
// Don't validate now addresses with IDN. Will be done in send().
|
1018 |
-
if (($pos = strrpos($address, '@')) === false or
|
1019 |
-
(!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
|
1020 |
-
!$this->validateAddress($address)) {
|
1021 |
-
$error_message = $this->lang('invalid_address') . " (setFrom) $address";
|
1022 |
-
$this->setError($error_message);
|
1023 |
-
$this->edebug($error_message);
|
1024 |
-
if ($this->exceptions) {
|
1025 |
-
throw new phpmailerException($error_message);
|
1026 |
-
}
|
1027 |
-
return false;
|
1028 |
-
}
|
1029 |
-
$this->From = $address;
|
1030 |
-
$this->FromName = $name;
|
1031 |
-
if ($auto) {
|
1032 |
-
if (empty($this->Sender)) {
|
1033 |
-
$this->Sender = $address;
|
1034 |
-
}
|
1035 |
-
}
|
1036 |
-
return true;
|
1037 |
-
}
|
1038 |
-
|
1039 |
-
/**
|
1040 |
-
* Return the Message-ID header of the last email.
|
1041 |
-
* Technically this is the value from the last time the headers were created,
|
1042 |
-
* but it's also the message ID of the last sent message except in
|
1043 |
-
* pathological cases.
|
1044 |
-
* @return string
|
1045 |
-
*/
|
1046 |
-
public function getLastMessageID()
|
1047 |
-
{
|
1048 |
-
return $this->lastMessageID;
|
1049 |
-
}
|
1050 |
-
|
1051 |
-
/**
|
1052 |
-
* Check that a string looks like an email address.
|
1053 |
-
* @param string $address The email address to check
|
1054 |
-
* @param string|callable $patternselect A selector for the validation pattern to use :
|
1055 |
-
* * `auto` Pick best pattern automatically;
|
1056 |
-
* * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
|
1057 |
-
* * `pcre` Use old PCRE implementation;
|
1058 |
-
* * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
|
1059 |
-
* * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
|
1060 |
-
* * `noregex` Don't use a regex: super fast, really dumb.
|
1061 |
-
* Alternatively you may pass in a callable to inject your own validator, for example:
|
1062 |
-
* PHPMailer::validateAddress('user@example.com', function($address) {
|
1063 |
-
* return (strpos($address, '@') !== false);
|
1064 |
-
* });
|
1065 |
-
* You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.
|
1066 |
-
* @return boolean
|
1067 |
-
* @static
|
1068 |
-
* @access public
|
1069 |
-
*/
|
1070 |
-
public static function validateAddress($address, $patternselect = null)
|
1071 |
-
{
|
1072 |
-
if (is_null($patternselect)) {
|
1073 |
-
$patternselect = self::$validator;
|
1074 |
-
}
|
1075 |
-
if (is_callable($patternselect)) {
|
1076 |
-
return call_user_func($patternselect, $address);
|
1077 |
-
}
|
1078 |
-
//Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
|
1079 |
-
if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
|
1080 |
-
return false;
|
1081 |
-
}
|
1082 |
-
if (!$patternselect or $patternselect == 'auto') {
|
1083 |
-
//Check this constant first so it works when extension_loaded() is disabled by safe mode
|
1084 |
-
//Constant was added in PHP 5.2.4
|
1085 |
-
if (defined('PCRE_VERSION')) {
|
1086 |
-
//This pattern can get stuck in a recursive loop in PCRE <= 8.0.2
|
1087 |
-
if (version_compare(PCRE_VERSION, '8.0.3') >= 0) {
|
1088 |
-
$patternselect = 'pcre8';
|
1089 |
-
} else {
|
1090 |
-
$patternselect = 'pcre';
|
1091 |
-
}
|
1092 |
-
} elseif (function_exists('extension_loaded') and extension_loaded('pcre')) {
|
1093 |
-
//Fall back to older PCRE
|
1094 |
-
$patternselect = 'pcre';
|
1095 |
-
} else {
|
1096 |
-
//Filter_var appeared in PHP 5.2.0 and does not require the PCRE extension
|
1097 |
-
if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
|
1098 |
-
$patternselect = 'php';
|
1099 |
-
} else {
|
1100 |
-
$patternselect = 'noregex';
|
1101 |
-
}
|
1102 |
-
}
|
1103 |
-
}
|
1104 |
-
switch ($patternselect) {
|
1105 |
-
case 'pcre8':
|
1106 |
-
/**
|
1107 |
-
* Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains.
|
1108 |
-
* @link http://squiloople.com/2009/12/20/email-address-validation/
|
1109 |
-
* @copyright 2009-2010 Michael Rushton
|
1110 |
-
* Feel free to use and redistribute this code. But please keep this copyright notice.
|
1111 |
-
*/
|
1112 |
-
return (boolean)preg_match(
|
1113 |
-
'/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' .
|
1114 |
-
'((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' .
|
1115 |
-
'(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' .
|
1116 |
-
'([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' .
|
1117 |
-
'(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' .
|
1118 |
-
'(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' .
|
1119 |
-
'|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' .
|
1120 |
-
'|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' .
|
1121 |
-
'|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD',
|
1122 |
-
$address
|
1123 |
-
);
|
1124 |
-
case 'pcre':
|
1125 |
-
//An older regex that doesn't need a recent PCRE
|
1126 |
-
return (boolean)preg_match(
|
1127 |
-
'/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' .
|
1128 |
-
'[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' .
|
1129 |
-
'(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' .
|
1130 |
-
'@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' .
|
1131 |
-
'(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' .
|
1132 |
-
'[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' .
|
1133 |
-
'::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' .
|
1134 |
-
'[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' .
|
1135 |
-
'::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' .
|
1136 |
-
'|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD',
|
1137 |
-
$address
|
1138 |
-
);
|
1139 |
-
case 'html5':
|
1140 |
-
/**
|
1141 |
-
* This is the pattern used in the HTML5 spec for validation of 'email' type form input elements.
|
1142 |
-
* @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email)
|
1143 |
-
*/
|
1144 |
-
return (boolean)preg_match(
|
1145 |
-
'/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' .
|
1146 |
-
'[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD',
|
1147 |
-
$address
|
1148 |
-
);
|
1149 |
-
case 'noregex':
|
1150 |
-
//No PCRE! Do something _very_ approximate!
|
1151 |
-
//Check the address is 3 chars or longer and contains an @ that's not the first or last char
|
1152 |
-
return (strlen($address) >= 3
|
1153 |
-
and strpos($address, '@') >= 1
|
1154 |
-
and strpos($address, '@') != strlen($address) - 1);
|
1155 |
-
case 'php':
|
1156 |
-
default:
|
1157 |
-
return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL);
|
1158 |
-
}
|
1159 |
-
}
|
1160 |
-
|
1161 |
-
/**
|
1162 |
-
* Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the
|
1163 |
-
* "intl" and "mbstring" PHP extensions.
|
1164 |
-
* @return bool "true" if required functions for IDN support are present
|
1165 |
-
*/
|
1166 |
-
public function idnSupported()
|
1167 |
-
{
|
1168 |
-
// @TODO: Write our own "idn_to_ascii" function for PHP <= 5.2.
|
1169 |
-
return function_exists('idn_to_ascii') and function_exists('mb_convert_encoding');
|
1170 |
-
}
|
1171 |
-
|
1172 |
-
/**
|
1173 |
-
* Converts IDN in given email address to its ASCII form, also known as punycode, if possible.
|
1174 |
-
* Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet.
|
1175 |
-
* This function silently returns unmodified address if:
|
1176 |
-
* - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form)
|
1177 |
-
* - Conversion to punycode is impossible (e.g. required PHP functions are not available)
|
1178 |
-
* or fails for any reason (e.g. domain has characters not allowed in an IDN)
|
1179 |
-
* @see PHPMailer::$CharSet
|
1180 |
-
* @param string $address The email address to convert
|
1181 |
-
* @return string The encoded address in ASCII form
|
1182 |
-
*/
|
1183 |
-
public function punyencodeAddress($address)
|
1184 |
-
{
|
1185 |
-
// Verify we have required functions, CharSet, and at-sign.
|
1186 |
-
if ($this->idnSupported() and
|
1187 |
-
!empty($this->CharSet) and
|
1188 |
-
($pos = strrpos($address, '@')) !== false) {
|
1189 |
-
$domain = substr($address, ++$pos);
|
1190 |
-
// Verify CharSet string is a valid one, and domain properly encoded in this CharSet.
|
1191 |
-
if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) {
|
1192 |
-
$domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet);
|
1193 |
-
if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ?
|
1194 |
-
idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) :
|
1195 |
-
idn_to_ascii($domain)) !== false) {
|
1196 |
-
return substr($address, 0, $pos) . $punycode;
|
1197 |
-
}
|
1198 |
-
}
|
1199 |
-
}
|
1200 |
-
return $address;
|
1201 |
-
}
|
1202 |
-
|
1203 |
-
/**
|
1204 |
-
* Create a message and send it.
|
1205 |
-
* Uses the sending method specified by $Mailer.
|
1206 |
-
* @throws phpmailerException
|
1207 |
-
* @return boolean false on error - See the ErrorInfo property for details of the error.
|
1208 |
-
*/
|
1209 |
-
public function send()
|
1210 |
-
{
|
1211 |
-
try {
|
1212 |
-
if (!$this->preSend()) {
|
1213 |
-
return false;
|
1214 |
-
}
|
1215 |
-
return $this->postSend();
|
1216 |
-
} catch (phpmailerException $exc) {
|
1217 |
-
$this->mailHeader = '';
|
1218 |
-
$this->setError($exc->getMessage());
|
1219 |
-
if ($this->exceptions) {
|
1220 |
-
throw $exc;
|
1221 |
-
}
|
1222 |
-
return false;
|
1223 |
-
}
|
1224 |
-
}
|
1225 |
-
|
1226 |
-
/**
|
1227 |
-
* Prepare a message for sending.
|
1228 |
-
* @throws phpmailerException
|
1229 |
-
* @return boolean
|
1230 |
-
*/
|
1231 |
-
public function preSend()
|
1232 |
-
{
|
1233 |
-
try {
|
1234 |
-
$this->error_count = 0; // Reset errors
|
1235 |
-
$this->mailHeader = '';
|
1236 |
-
|
1237 |
-
// Dequeue recipient and Reply-To addresses with IDN
|
1238 |
-
foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {
|
1239 |
-
$params[1] = $this->punyencodeAddress($params[1]);
|
1240 |
-
call_user_func_array(array($this, 'addAnAddress'), $params);
|
1241 |
-
}
|
1242 |
-
if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
|
1243 |
-
throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL);
|
1244 |
-
}
|
1245 |
-
|
1246 |
-
// Validate From, Sender, and ConfirmReadingTo addresses
|
1247 |
-
foreach (array('From', 'Sender', 'ConfirmReadingTo') as $address_kind) {
|
1248 |
-
$this->$address_kind = trim($this->$address_kind);
|
1249 |
-
if (empty($this->$address_kind)) {
|
1250 |
-
continue;
|
1251 |
-
}
|
1252 |
-
$this->$address_kind = $this->punyencodeAddress($this->$address_kind);
|
1253 |
-
if (!$this->validateAddress($this->$address_kind)) {
|
1254 |
-
$error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind;
|
1255 |
-
$this->setError($error_message);
|
1256 |
-
$this->edebug($error_message);
|
1257 |
-
if ($this->exceptions) {
|
1258 |
-
throw new phpmailerException($error_message);
|
1259 |
-
}
|
1260 |
-
return false;
|
1261 |
-
}
|
1262 |
-
}
|
1263 |
-
|
1264 |
-
// Set whether the message is multipart/alternative
|
1265 |
-
if ($this->alternativeExists()) {
|
1266 |
-
$this->ContentType = 'multipart/alternative';
|
1267 |
-
}
|
1268 |
-
|
1269 |
-
$this->setMessageType();
|
1270 |
-
// Refuse to send an empty message unless we are specifically allowing it
|
1271 |
-
if (!$this->AllowEmpty and empty($this->Body)) {
|
1272 |
-
throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL);
|
1273 |
-
}
|
1274 |
-
|
1275 |
-
// Create body before headers in case body makes changes to headers (e.g. altering transfer encoding)
|
1276 |
-
$this->MIMEHeader = '';
|
1277 |
-
$this->MIMEBody = $this->createBody();
|
1278 |
-
// createBody may have added some headers, so retain them
|
1279 |
-
$tempheaders = $this->MIMEHeader;
|
1280 |
-
$this->MIMEHeader = $this->createHeader();
|
1281 |
-
$this->MIMEHeader .= $tempheaders;
|
1282 |
-
|
1283 |
-
// To capture the complete message when using mail(), create
|
1284 |
-
// an extra header list which createHeader() doesn't fold in
|
1285 |
-
if ($this->Mailer == 'mail') {
|
1286 |
-
if (count($this->to) > 0) {
|
1287 |
-
$this->mailHeader .= $this->addrAppend('To', $this->to);
|
1288 |
-
} else {
|
1289 |
-
$this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;');
|
1290 |
-
}
|
1291 |
-
$this->mailHeader .= $this->headerLine(
|
1292 |
-
'Subject',
|
1293 |
-
$this->encodeHeader($this->secureHeader(trim($this->Subject)))
|
1294 |
-
);
|
1295 |
-
}
|
1296 |
-
|
1297 |
-
// Sign with DKIM if enabled
|
1298 |
-
if (!empty($this->DKIM_domain)
|
1299 |
-
&& !empty($this->DKIM_selector)
|
1300 |
-
&& (!empty($this->DKIM_private_string)
|
1301 |
-
|| (!empty($this->DKIM_private) && file_exists($this->DKIM_private))
|
1302 |
-
)
|
1303 |
-
) {
|
1304 |
-
$header_dkim = $this->DKIM_Add(
|
1305 |
-
$this->MIMEHeader . $this->mailHeader,
|
1306 |
-
$this->encodeHeader($this->secureHeader($this->Subject)),
|
1307 |
-
$this->MIMEBody
|
1308 |
-
);
|
1309 |
-
$this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF .
|
1310 |
-
str_replace("\r\n", "\n", $header_dkim) . self::CRLF;
|
1311 |
-
}
|
1312 |
-
return true;
|
1313 |
-
} catch (phpmailerException $exc) {
|
1314 |
-
$this->setError($exc->getMessage());
|
1315 |
-
if ($this->exceptions) {
|
1316 |
-
throw $exc;
|
1317 |
-
}
|
1318 |
-
return false;
|
1319 |
-
}
|
1320 |
-
}
|
1321 |
-
|
1322 |
-
/**
|
1323 |
-
* Actually send a message.
|
1324 |
-
* Send the email via the selected mechanism
|
1325 |
-
* @throws phpmailerException
|
1326 |
-
* @return boolean
|
1327 |
-
*/
|
1328 |
-
public function postSend()
|
1329 |
-
{
|
1330 |
-
try {
|
1331 |
-
// Choose the mailer and send through it
|
1332 |
-
switch ($this->Mailer) {
|
1333 |
-
case 'sendmail':
|
1334 |
-
case 'qmail':
|
1335 |
-
return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody);
|
1336 |
-
case 'smtp':
|
1337 |
-
return $this->smtpSend($this->MIMEHeader, $this->MIMEBody);
|
1338 |
-
case 'mail':
|
1339 |
-
return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
|
1340 |
-
default:
|
1341 |
-
$sendMethod = $this->Mailer.'Send';
|
1342 |
-
if (method_exists($this, $sendMethod)) {
|
1343 |
-
return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody);
|
1344 |
-
}
|
1345 |
-
|
1346 |
-
return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
|
1347 |
-
}
|
1348 |
-
} catch (phpmailerException $exc) {
|
1349 |
-
$this->setError($exc->getMessage());
|
1350 |
-
$this->edebug($exc->getMessage());
|
1351 |
-
if ($this->exceptions) {
|
1352 |
-
throw $exc;
|
1353 |
-
}
|
1354 |
-
}
|
1355 |
-
return false;
|
1356 |
-
}
|
1357 |
-
|
1358 |
-
/**
|
1359 |
-
* Send mail using the $Sendmail program.
|
1360 |
-
* @param string $header The message headers
|
1361 |
-
* @param string $body The message body
|
1362 |
-
* @see PHPMailer::$Sendmail
|
1363 |
-
* @throws phpmailerException
|
1364 |
-
* @access protected
|
1365 |
-
* @return boolean
|
1366 |
-
*/
|
1367 |
-
protected function sendmailSend($header, $body)
|
1368 |
-
{
|
1369 |
-
// CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
|
1370 |
-
if (!empty($this->Sender) and self::isShellSafe($this->Sender)) {
|
1371 |
-
if ($this->Mailer == 'qmail') {
|
1372 |
-
$sendmailFmt = '%s -f%s';
|
1373 |
-
} else {
|
1374 |
-
$sendmailFmt = '%s -oi -f%s -t';
|
1375 |
-
}
|
1376 |
-
} else {
|
1377 |
-
if ($this->Mailer == 'qmail') {
|
1378 |
-
$sendmailFmt = '%s';
|
1379 |
-
} else {
|
1380 |
-
$sendmailFmt = '%s -oi -t';
|
1381 |
-
}
|
1382 |
-
}
|
1383 |
-
|
1384 |
-
// TODO: If possible, this should be changed to escapeshellarg. Needs thorough testing.
|
1385 |
-
$sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender);
|
1386 |
-
|
1387 |
-
if ($this->SingleTo) {
|
1388 |
-
foreach ($this->SingleToArray as $toAddr) {
|
1389 |
-
if (!@$mail = popen($sendmail, 'w')) {
|
1390 |
-
throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
|
1391 |
-
}
|
1392 |
-
fputs($mail, 'To: ' . $toAddr . "\n");
|
1393 |
-
fputs($mail, $header);
|
1394 |
-
fputs($mail, $body);
|
1395 |
-
$result = pclose($mail);
|
1396 |
-
$this->doCallback(
|
1397 |
-
($result == 0),
|
1398 |
-
array($toAddr),
|
1399 |
-
$this->cc,
|
1400 |
-
$this->bcc,
|
1401 |
-
$this->Subject,
|
1402 |
-
$body,
|
1403 |
-
$this->From
|
1404 |
-
);
|
1405 |
-
if ($result != 0) {
|
1406 |
-
throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
|
1407 |
-
}
|
1408 |
-
}
|
1409 |
-
} else {
|
1410 |
-
if (!@$mail = popen($sendmail, 'w')) {
|
1411 |
-
throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
|
1412 |
-
}
|
1413 |
-
fputs($mail, $header);
|
1414 |
-
fputs($mail, $body);
|
1415 |
-
$result = pclose($mail);
|
1416 |
-
$this->doCallback(
|
1417 |
-
($result == 0),
|
1418 |
-
$this->to,
|
1419 |
-
$this->cc,
|
1420 |
-
$this->bcc,
|
1421 |
-
$this->Subject,
|
1422 |
-
$body,
|
1423 |
-
$this->From
|
1424 |
-
);
|
1425 |
-
if ($result != 0) {
|
1426 |
-
throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
|
1427 |
-
}
|
1428 |
-
}
|
1429 |
-
return true;
|
1430 |
-
}
|
1431 |
-
|
1432 |
-
/**
|
1433 |
-
* Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters.
|
1434 |
-
*
|
1435 |
-
* Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows.
|
1436 |
-
* @param string $string The string to be validated
|
1437 |
-
* @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report
|
1438 |
-
* @access protected
|
1439 |
-
* @return boolean
|
1440 |
-
*/
|
1441 |
-
protected static function isShellSafe($string)
|
1442 |
-
{
|
1443 |
-
// Future-proof
|
1444 |
-
if (escapeshellcmd($string) !== $string
|
1445 |
-
or !in_array(escapeshellarg($string), array("'$string'", "\"$string\""))
|
1446 |
-
) {
|
1447 |
-
return false;
|
1448 |
-
}
|
1449 |
-
|
1450 |
-
$length = strlen($string);
|
1451 |
-
|
1452 |
-
for ($i = 0; $i < $length; $i++) {
|
1453 |
-
$c = $string[$i];
|
1454 |
-
|
1455 |
-
// All other characters have a special meaning in at least one common shell, including = and +.
|
1456 |
-
// Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here.
|
1457 |
-
// Note that this does permit non-Latin alphanumeric characters based on the current locale.
|
1458 |
-
if (!ctype_alnum($c) && strpos('@_-.', $c) === false) {
|
1459 |
-
return false;
|
1460 |
-
}
|
1461 |
-
}
|
1462 |
-
|
1463 |
-
return true;
|
1464 |
-
}
|
1465 |
-
|
1466 |
-
/**
|
1467 |
-
* Send mail using the PHP mail() function.
|
1468 |
-
* @param string $header The message headers
|
1469 |
-
* @param string $body The message body
|
1470 |
-
* @link http://www.php.net/manual/en/book.mail.php
|
1471 |
-
* @throws phpmailerException
|
1472 |
-
* @access protected
|
1473 |
-
* @return boolean
|
1474 |
-
*/
|
1475 |
-
protected function mailSend($header, $body)
|
1476 |
-
{
|
1477 |
-
$toArr = array();
|
1478 |
-
foreach ($this->to as $toaddr) {
|
1479 |
-
$toArr[] = $this->addrFormat($toaddr);
|
1480 |
-
}
|
1481 |
-
$to = implode(', ', $toArr);
|
1482 |
-
|
1483 |
-
$params = null;
|
1484 |
-
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
|
1485 |
-
if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
|
1486 |
-
// CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
|
1487 |
-
if (self::isShellSafe($this->Sender)) {
|
1488 |
-
$params = sprintf('-f%s', $this->Sender);
|
1489 |
-
}
|
1490 |
-
}
|
1491 |
-
if (!empty($this->Sender) and !ini_get('safe_mode') and $this->validateAddress($this->Sender)) {
|
1492 |
-
$old_from = ini_get('sendmail_from');
|
1493 |
-
ini_set('sendmail_from', $this->Sender);
|
1494 |
-
}
|
1495 |
-
$result = false;
|
1496 |
-
if ($this->SingleTo and count($toArr) > 1) {
|
1497 |
-
foreach ($toArr as $toAddr) {
|
1498 |
-
$result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
|
1499 |
-
$this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From);
|
1500 |
-
}
|
1501 |
-
} else {
|
1502 |
-
$result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
|
1503 |
-
$this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From);
|
1504 |
-
}
|
1505 |
-
if (isset($old_from)) {
|
1506 |
-
ini_set('sendmail_from', $old_from);
|
1507 |
-
}
|
1508 |
-
if (!$result) {
|
1509 |
-
throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL);
|
1510 |
-
}
|
1511 |
-
return true;
|
1512 |
-
}
|
1513 |
-
|
1514 |
-
/**
|
1515 |
-
* Get an instance to use for SMTP operations.
|
1516 |
-
* Override this function to load your own SMTP implementation
|
1517 |
-
* @return SMTP
|
1518 |
-
*/
|
1519 |
-
public function getSMTPInstance()
|
1520 |
-
{
|
1521 |
-
if (!is_object($this->smtp)) {
|
1522 |
-
$this->smtp = new SMTP;
|
1523 |
-
}
|
1524 |
-
return $this->smtp;
|
1525 |
-
}
|
1526 |
-
|
1527 |
-
/**
|
1528 |
-
* Send mail via SMTP.
|
1529 |
-
* Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
|
1530 |
-
* Uses the PHPMailerSMTP class by default.
|
1531 |
-
* @see PHPMailer::getSMTPInstance() to use a different class.
|
1532 |
-
* @param string $header The message headers
|
1533 |
-
* @param string $body The message body
|
1534 |
-
* @throws phpmailerException
|
1535 |
-
* @uses SMTP
|
1536 |
-
* @access protected
|
1537 |
-
* @return boolean
|
1538 |
-
*/
|
1539 |
-
protected function smtpSend($header, $body)
|
1540 |
-
{
|
1541 |
-
$bad_rcpt = array();
|
1542 |
-
if (!$this->smtpConnect($this->SMTPOptions)) {
|
1543 |
-
throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
|
1544 |
-
}
|
1545 |
-
if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
|
1546 |
-
$smtp_from = $this->Sender;
|
1547 |
-
} else {
|
1548 |
-
$smtp_from = $this->From;
|
1549 |
-
}
|
1550 |
-
if (!$this->smtp->mail($smtp_from)) {
|
1551 |
-
$this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
|
1552 |
-
throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL);
|
1553 |
-
}
|
1554 |
-
|
1555 |
-
// Attempt to send to all recipients
|
1556 |
-
foreach (array($this->to, $this->cc, $this->bcc) as $togroup) {
|
1557 |
-
foreach ($togroup as $to) {
|
1558 |
-
if (!$this->smtp->recipient($to[0])) {
|
1559 |
-
$error = $this->smtp->getError();
|
1560 |
-
$bad_rcpt[] = array('to' => $to[0], 'error' => $error['detail']);
|
1561 |
-
$isSent = false;
|
1562 |
-
} else {
|
1563 |
-
$isSent = true;
|
1564 |
-
}
|
1565 |
-
$this->doCallback($isSent, array($to[0]), array(), array(), $this->Subject, $body, $this->From);
|
1566 |
-
}
|
1567 |
-
}
|
1568 |
-
|
1569 |
-
// Only send the DATA command if we have viable recipients
|
1570 |
-
if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) {
|
1571 |
-
throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL);
|
1572 |
-
}
|
1573 |
-
if ($this->SMTPKeepAlive) {
|
1574 |
-
$this->smtp->reset();
|
1575 |
-
} else {
|
1576 |
-
$this->smtp->quit();
|
1577 |
-
$this->smtp->close();
|
1578 |
-
}
|
1579 |
-
//Create error message for any bad addresses
|
1580 |
-
if (count($bad_rcpt) > 0) {
|
1581 |
-
$errstr = '';
|
1582 |
-
foreach ($bad_rcpt as $bad) {
|
1583 |
-
$errstr .= $bad['to'] . ': ' . $bad['error'];
|
1584 |
-
}
|
1585 |
-
throw new phpmailerException(
|
1586 |
-
$this->lang('recipients_failed') . $errstr,
|
1587 |
-
self::STOP_CONTINUE
|
1588 |
-
);
|
1589 |
-
}
|
1590 |
-
return true;
|
1591 |
-
}
|
1592 |
-
|
1593 |
-
/**
|
1594 |
-
* Initiate a connection to an SMTP server.
|
1595 |
-
* Returns false if the operation failed.
|
1596 |
-
* @param array $options An array of options compatible with stream_context_create()
|
1597 |
-
* @uses SMTP
|
1598 |
-
* @access public
|
1599 |
-
* @throws phpmailerException
|
1600 |
-
* @return boolean
|
1601 |
-
*/
|
1602 |
-
public function smtpConnect($options = null)
|
1603 |
-
{
|
1604 |
-
if (is_null($this->smtp)) {
|
1605 |
-
$this->smtp = $this->getSMTPInstance();
|
1606 |
-
}
|
1607 |
-
|
1608 |
-
//If no options are provided, use whatever is set in the instance
|
1609 |
-
if (is_null($options)) {
|
1610 |
-
$options = $this->SMTPOptions;
|
1611 |
-
}
|
1612 |
-
|
1613 |
-
// Already connected?
|
1614 |
-
if ($this->smtp->connected()) {
|
1615 |
-
return true;
|
1616 |
-
}
|
1617 |
-
|
1618 |
-
$this->smtp->setTimeout($this->Timeout);
|
1619 |
-
$this->smtp->setDebugLevel($this->SMTPDebug);
|
1620 |
-
$this->smtp->setDebugOutput($this->Debugoutput);
|
1621 |
-
$this->smtp->setVerp($this->do_verp);
|
1622 |
-
$hosts = explode(';', $this->Host);
|
1623 |
-
$lastexception = null;
|
1624 |
-
|
1625 |
-
foreach ($hosts as $hostentry) {
|
1626 |
-
$hostinfo = array();
|
1627 |
-
if (!preg_match(
|
1628 |
-
'/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*|\[[a-fA-F0-9:]+\]):?([0-9]*)$/',
|
1629 |
-
trim($hostentry),
|
1630 |
-
$hostinfo
|
1631 |
-
)) {
|
1632 |
-
// Not a valid host entry
|
1633 |
-
$this->edebug('Ignoring invalid host: ' . $hostentry);
|
1634 |
-
continue;
|
1635 |
-
}
|
1636 |
-
// $hostinfo[2]: optional ssl or tls prefix
|
1637 |
-
// $hostinfo[3]: the hostname
|
1638 |
-
// $hostinfo[4]: optional port number
|
1639 |
-
// The host string prefix can temporarily override the current setting for SMTPSecure
|
1640 |
-
// If it's not specified, the default value is used
|
1641 |
-
$prefix = '';
|
1642 |
-
$secure = $this->SMTPSecure;
|
1643 |
-
$tls = ($this->SMTPSecure == 'tls');
|
1644 |
-
if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
|
1645 |
-
$prefix = 'ssl://';
|
1646 |
-
$tls = false; // Can't have SSL and TLS at the same time
|
1647 |
-
$secure = 'ssl';
|
1648 |
-
} elseif ($hostinfo[2] == 'tls') {
|
1649 |
-
$tls = true;
|
1650 |
-
// tls doesn't use a prefix
|
1651 |
-
$secure = 'tls';
|
1652 |
-
}
|
1653 |
-
//Do we need the OpenSSL extension?
|
1654 |
-
$sslext = defined('OPENSSL_ALGO_SHA1');
|
1655 |
-
if ('tls' === $secure or 'ssl' === $secure) {
|
1656 |
-
//Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
|
1657 |
-
if (!$sslext) {
|
1658 |
-
throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL);
|
1659 |
-
}
|
1660 |
-
}
|
1661 |
-
$host = $hostinfo[3];
|
1662 |
-
$port = $this->Port;
|
1663 |
-
$tport = (integer)$hostinfo[4];
|
1664 |
-
if ($tport > 0 and $tport < 65536) {
|
1665 |
-
$port = $tport;
|
1666 |
-
}
|
1667 |
-
if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
|
1668 |
-
try {
|
1669 |
-
if ($this->Helo) {
|
1670 |
-
$hello = $this->Helo;
|
1671 |
-
} else {
|
1672 |
-
$hello = $this->serverHostname();
|
1673 |
-
}
|
1674 |
-
$this->smtp->hello($hello);
|
1675 |
-
//Automatically enable TLS encryption if:
|
1676 |
-
// * it's not disabled
|
1677 |
-
// * we have openssl extension
|
1678 |
-
// * we are not already using SSL
|
1679 |
-
// * the server offers STARTTLS
|
1680 |
-
if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) {
|
1681 |
-
$tls = true;
|
1682 |
-
}
|
1683 |
-
if ($tls) {
|
1684 |
-
if (!$this->smtp->startTLS()) {
|
1685 |
-
throw new phpmailerException($this->lang('connect_host'));
|
1686 |
-
}
|
1687 |
-
// We must resend EHLO after TLS negotiation
|
1688 |
-
$this->smtp->hello($hello);
|
1689 |
-
}
|
1690 |
-
if ($this->SMTPAuth) {
|
1691 |
-
if (!$this->smtp->authenticate(
|
1692 |
-
$this->Username,
|
1693 |
-
$this->Password,
|
1694 |
-
$this->AuthType,
|
1695 |
-
$this->Realm,
|
1696 |
-
$this->Workstation
|
1697 |
-
)
|
1698 |
-
) {
|
1699 |
-
throw new phpmailerException($this->lang('authenticate'));
|
1700 |
-
}
|
1701 |
-
}
|
1702 |
-
return true;
|
1703 |
-
} catch (phpmailerException $exc) {
|
1704 |
-
$lastexception = $exc;
|
1705 |
-
$this->edebug($exc->getMessage());
|
1706 |
-
// We must have connected, but then failed TLS or Auth, so close connection nicely
|
1707 |
-
$this->smtp->quit();
|
1708 |
-
}
|
1709 |
-
}
|
1710 |
-
}
|
1711 |
-
// If we get here, all connection attempts have failed, so close connection hard
|
1712 |
-
$this->smtp->close();
|
1713 |
-
// As we've caught all exceptions, just report whatever the last one was
|
1714 |
-
if ($this->exceptions and !is_null($lastexception)) {
|
1715 |
-
throw $lastexception;
|
1716 |
-
}
|
1717 |
-
return false;
|
1718 |
-
}
|
1719 |
-
|
1720 |
-
/**
|
1721 |
-
* Close the active SMTP session if one exists.
|
1722 |
-
* @return void
|
1723 |
-
*/
|
1724 |
-
public function smtpClose()
|
1725 |
-
{
|
1726 |
-
if (is_a($this->smtp, 'SMTP')) {
|
1727 |
-
if ($this->smtp->connected()) {
|
1728 |
-
$this->smtp->quit();
|
1729 |
-
$this->smtp->close();
|
1730 |
-
}
|
1731 |
-
}
|
1732 |
-
}
|
1733 |
-
|
1734 |
-
/**
|
1735 |
-
* Set the language for error messages.
|
1736 |
-
* Returns false if it cannot load the language file.
|
1737 |
-
* The default language is English.
|
1738 |
-
* @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr")
|
1739 |
-
* @param string $lang_path Path to the language file directory, with trailing separator (slash)
|
1740 |
-
* @return boolean
|
1741 |
-
* @access public
|
1742 |
-
*/
|
1743 |
-
public function setLanguage($langcode = 'en', $lang_path = '')
|
1744 |
-
{
|
1745 |
-
// Backwards compatibility for renamed language codes
|
1746 |
-
$renamed_langcodes = array(
|
1747 |
-
'br' => 'pt_br',
|
1748 |
-
'cz' => 'cs',
|
1749 |
-
'dk' => 'da',
|
1750 |
-
'no' => 'nb',
|
1751 |
-
'se' => 'sv',
|
1752 |
-
'sr' => 'rs'
|
1753 |
-
);
|
1754 |
-
|
1755 |
-
if (isset($renamed_langcodes[$langcode])) {
|
1756 |
-
$langcode = $renamed_langcodes[$langcode];
|
1757 |
-
}
|
1758 |
-
|
1759 |
-
// Define full set of translatable strings in English
|
1760 |
-
$PHPMAILER_LANG = array(
|
1761 |
-
'authenticate' => 'SMTP Error: Could not authenticate.',
|
1762 |
-
'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
|
1763 |
-
'data_not_accepted' => 'SMTP Error: data not accepted.',
|
1764 |
-
'empty_message' => 'Message body empty',
|
1765 |
-
'encoding' => 'Unknown encoding: ',
|
1766 |
-
'execute' => 'Could not execute: ',
|
1767 |
-
'file_access' => 'Could not access file: ',
|
1768 |
-
'file_open' => 'File Error: Could not open file: ',
|
1769 |
-
'from_failed' => 'The following From address failed: ',
|
1770 |
-
'instantiate' => 'Could not instantiate mail function.',
|
1771 |
-
'invalid_address' => 'Invalid address: ',
|
1772 |
-
'mailer_not_supported' => ' mailer is not supported.',
|
1773 |
-
'provide_address' => 'You must provide at least one recipient email address.',
|
1774 |
-
'recipients_failed' => 'SMTP Error: The following recipients failed: ',
|
1775 |
-
'signing' => 'Signing Error: ',
|
1776 |
-
'smtp_connect_failed' => 'SMTP connect() failed.',
|
1777 |
-
'smtp_error' => 'SMTP server error: ',
|
1778 |
-
'variable_set' => 'Cannot set or reset variable: ',
|
1779 |
-
'extension_missing' => 'Extension missing: '
|
1780 |
-
);
|
1781 |
-
if (empty($lang_path)) {
|
1782 |
-
// Calculate an absolute path so it can work if CWD is not here
|
1783 |
-
$lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
|
1784 |
-
}
|
1785 |
-
//Validate $langcode
|
1786 |
-
if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {
|
1787 |
-
$langcode = 'en';
|
1788 |
-
}
|
1789 |
-
$foundlang = true;
|
1790 |
-
$lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
|
1791 |
-
// There is no English translation file
|
1792 |
-
if ($langcode != 'en') {
|
1793 |
-
// Make sure language file path is readable
|
1794 |
-
if (!is_readable($lang_file)) {
|
1795 |
-
$foundlang = false;
|
1796 |
-
} else {
|
1797 |
-
// Overwrite language-specific strings.
|
1798 |
-
// This way we'll never have missing translation keys.
|
1799 |
-
$foundlang = include $lang_file;
|
1800 |
-
}
|
1801 |
-
}
|
1802 |
-
$this->language = $PHPMAILER_LANG;
|
1803 |
-
return (boolean)$foundlang; // Returns false if language not found
|
1804 |
-
}
|
1805 |
-
|
1806 |
-
/**
|
1807 |
-
* Get the array of strings for the current language.
|
1808 |
-
* @return array
|
1809 |
-
*/
|
1810 |
-
public function getTranslations()
|
1811 |
-
{
|
1812 |
-
return $this->language;
|
1813 |
-
}
|
1814 |
-
|
1815 |
-
/**
|
1816 |
-
* Create recipient headers.
|
1817 |
-
* @access public
|
1818 |
-
* @param string $type
|
1819 |
-
* @param array $addr An array of recipient,
|
1820 |
-
* where each recipient is a 2-element indexed array with element 0 containing an address
|
1821 |
-
* and element 1 containing a name, like:
|
1822 |
-
* array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User'))
|
1823 |
-
* @return string
|
1824 |
-
*/
|
1825 |
-
public function addrAppend($type, $addr)
|
1826 |
-
{
|
1827 |
-
$addresses = array();
|
1828 |
-
foreach ($addr as $address) {
|
1829 |
-
$addresses[] = $this->addrFormat($address);
|
1830 |
-
}
|
1831 |
-
return $type . ': ' . implode(', ', $addresses) . $this->LE;
|
1832 |
-
}
|
1833 |
-
|
1834 |
-
/**
|
1835 |
-
* Format an address for use in a message header.
|
1836 |
-
* @access public
|
1837 |
-
* @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name
|
1838 |
-
* like array('joe@example.com', 'Joe User')
|
1839 |
-
* @return string
|
1840 |
-
*/
|
1841 |
-
public function addrFormat($addr)
|
1842 |
-
{
|
1843 |
-
if (empty($addr[1])) { // No name provided
|
1844 |
-
return $this->secureHeader($addr[0]);
|
1845 |
-
} else {
|
1846 |
-
return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader(
|
1847 |
-
$addr[0]
|
1848 |
-
) . '>';
|
1849 |
-
}
|
1850 |
-
}
|
1851 |
-
|
1852 |
-
/**
|
1853 |
-
* Word-wrap message.
|
1854 |
-
* For use with mailers that do not automatically perform wrapping
|
1855 |
-
* and for quoted-printable encoded messages.
|
1856 |
-
* Original written by philippe.
|
1857 |
-
* @param string $message The message to wrap
|
1858 |
-
* @param integer $length The line length to wrap to
|
1859 |
-
* @param boolean $qp_mode Whether to run in Quoted-Printable mode
|
1860 |
-
* @access public
|
1861 |
-
* @return string
|
1862 |
-
*/
|
1863 |
-
public function wrapText($message, $length, $qp_mode = false)
|
1864 |
-
{
|
1865 |
-
if ($qp_mode) {
|
1866 |
-
$soft_break = sprintf(' =%s', $this->LE);
|
1867 |
-
} else {
|
1868 |
-
$soft_break = $this->LE;
|
1869 |
-
}
|
1870 |
-
// If utf-8 encoding is used, we will need to make sure we don't
|
1871 |
-
// split multibyte characters when we wrap
|
1872 |
-
$is_utf8 = (strtolower($this->CharSet) == 'utf-8');
|
1873 |
-
$lelen = strlen($this->LE);
|
1874 |
-
$crlflen = strlen(self::CRLF);
|
1875 |
-
|
1876 |
-
$message = $this->fixEOL($message);
|
1877 |
-
//Remove a trailing line break
|
1878 |
-
if (substr($message, -$lelen) == $this->LE) {
|
1879 |
-
$message = substr($message, 0, -$lelen);
|
1880 |
-
}
|
1881 |
-
|
1882 |
-
//Split message into lines
|
1883 |
-
$lines = explode($this->LE, $message);
|
1884 |
-
//Message will be rebuilt in here
|
1885 |
-
$message = '';
|
1886 |
-
foreach ($lines as $line) {
|
1887 |
-
$words = explode(' ', $line);
|
1888 |
-
$buf = '';
|
1889 |
-
$firstword = true;
|
1890 |
-
foreach ($words as $word) {
|
1891 |
-
if ($qp_mode and (strlen($word) > $length)) {
|
1892 |
-
$space_left = $length - strlen($buf) - $crlflen;
|
1893 |
-
if (!$firstword) {
|
1894 |
-
if ($space_left > 20) {
|
1895 |
-
$len = $space_left;
|
1896 |
-
if ($is_utf8) {
|
1897 |
-
$len = $this->utf8CharBoundary($word, $len);
|
1898 |
-
} elseif (substr($word, $len - 1, 1) == '=') {
|
1899 |
-
$len--;
|
1900 |
-
} elseif (substr($word, $len - 2, 1) == '=') {
|
1901 |
-
$len -= 2;
|
1902 |
-
}
|
1903 |
-
$part = substr($word, 0, $len);
|
1904 |
-
$word = substr($word, $len);
|
1905 |
-
$buf .= ' ' . $part;
|
1906 |
-
$message .= $buf . sprintf('=%s', self::CRLF);
|
1907 |
-
} else {
|
1908 |
-
$message .= $buf . $soft_break;
|
1909 |
-
}
|
1910 |
-
$buf = '';
|
1911 |
-
}
|
1912 |
-
while (strlen($word) > 0) {
|
1913 |
-
if ($length <= 0) {
|
1914 |
-
break;
|
1915 |
-
}
|
1916 |
-
$len = $length;
|
1917 |
-
if ($is_utf8) {
|
1918 |
-
$len = $this->utf8CharBoundary($word, $len);
|
1919 |
-
} elseif (substr($word, $len - 1, 1) == '=') {
|
1920 |
-
$len--;
|
1921 |
-
} elseif (substr($word, $len - 2, 1) == '=') {
|
1922 |
-
$len -= 2;
|
1923 |
-
}
|
1924 |
-
$part = substr($word, 0, $len);
|
1925 |
-
$word = substr($word, $len);
|
1926 |
-
|
1927 |
-
if (strlen($word) > 0) {
|
1928 |
-
$message .= $part . sprintf('=%s', self::CRLF);
|
1929 |
-
} else {
|
1930 |
-
$buf = $part;
|
1931 |
-
}
|
1932 |
-
}
|
1933 |
-
} else {
|
1934 |
-
$buf_o = $buf;
|
1935 |
-
if (!$firstword) {
|
1936 |
-
$buf .= ' ';
|
1937 |
-
}
|
1938 |
-
$buf .= $word;
|
1939 |
-
|
1940 |
-
if (strlen($buf) > $length and $buf_o != '') {
|
1941 |
-
$message .= $buf_o . $soft_break;
|
1942 |
-
$buf = $word;
|
1943 |
-
}
|
1944 |
-
}
|
1945 |
-
$firstword = false;
|
1946 |
-
}
|
1947 |
-
$message .= $buf . self::CRLF;
|
1948 |
-
}
|
1949 |
-
|
1950 |
-
return $message;
|
1951 |
-
}
|
1952 |
-
|
1953 |
-
/**
|
1954 |
-
* Find the last character boundary prior to $maxLength in a utf-8
|
1955 |
-
* quoted-printable encoded string.
|
1956 |
-
* Original written by Colin Brown.
|
1957 |
-
* @access public
|
1958 |
-
* @param string $encodedText utf-8 QP text
|
1959 |
-
* @param integer $maxLength Find the last character boundary prior to this length
|
1960 |
-
* @return integer
|
1961 |
-
*/
|
1962 |
-
public function utf8CharBoundary($encodedText, $maxLength)
|
1963 |
-
{
|
1964 |
-
$foundSplitPos = false;
|
1965 |
-
$lookBack = 3;
|
1966 |
-
while (!$foundSplitPos) {
|
1967 |
-
$lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
|
1968 |
-
$encodedCharPos = strpos($lastChunk, '=');
|
1969 |
-
if (false !== $encodedCharPos) {
|
1970 |
-
// Found start of encoded character byte within $lookBack block.
|
1971 |
-
// Check the encoded byte value (the 2 chars after the '=')
|
1972 |
-
$hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
|
1973 |
-
$dec = hexdec($hex);
|
1974 |
-
if ($dec < 128) {
|
1975 |
-
// Single byte character.
|
1976 |
-
// If the encoded char was found at pos 0, it will fit
|
1977 |
-
// otherwise reduce maxLength to start of the encoded char
|
1978 |
-
if ($encodedCharPos > 0) {
|
1979 |
-
$maxLength = $maxLength - ($lookBack - $encodedCharPos);
|
1980 |
-
}
|
1981 |
-
$foundSplitPos = true;
|
1982 |
-
} elseif ($dec >= 192) {
|
1983 |
-
// First byte of a multi byte character
|
1984 |
-
// Reduce maxLength to split at start of character
|
1985 |
-
$maxLength = $maxLength - ($lookBack - $encodedCharPos);
|
1986 |
-
$foundSplitPos = true;
|
1987 |
-
} elseif ($dec < 192) {
|
1988 |
-
// Middle byte of a multi byte character, look further back
|
1989 |
-
$lookBack += 3;
|
1990 |
-
}
|
1991 |
-
} else {
|
1992 |
-
// No encoded character found
|
1993 |
-
$foundSplitPos = true;
|
1994 |
-
}
|
1995 |
-
}
|
1996 |
-
return $maxLength;
|
1997 |
-
}
|
1998 |
-
|
1999 |
-
/**
|
2000 |
-
* Apply word wrapping to the message body.
|
2001 |
-
* Wraps the message body to the number of chars set in the WordWrap property.
|
2002 |
-
* You should only do this to plain-text bodies as wrapping HTML tags may break them.
|
2003 |
-
* This is called automatically by createBody(), so you don't need to call it yourself.
|
2004 |
-
* @access public
|
2005 |
-
* @return void
|
2006 |
-
*/
|
2007 |
-
public function setWordWrap()
|
2008 |
-
{
|
2009 |
-
if ($this->WordWrap < 1) {
|
2010 |
-
return;
|
2011 |
-
}
|
2012 |
-
|
2013 |
-
switch ($this->message_type) {
|
2014 |
-
case 'alt':
|
2015 |
-
case 'alt_inline':
|
2016 |
-
case 'alt_attach':
|
2017 |
-
case 'alt_inline_attach':
|
2018 |
-
$this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap);
|
2019 |
-
break;
|
2020 |
-
default:
|
2021 |
-
$this->Body = $this->wrapText($this->Body, $this->WordWrap);
|
2022 |
-
break;
|
2023 |
-
}
|
2024 |
-
}
|
2025 |
-
|
2026 |
-
/**
|
2027 |
-
* Assemble message headers.
|
2028 |
-
* @access public
|
2029 |
-
* @return string The assembled headers
|
2030 |
-
*/
|
2031 |
-
public function createHeader()
|
2032 |
-
{
|
2033 |
-
$result = '';
|
2034 |
-
|
2035 |
-
$result .= $this->headerLine('Date', $this->MessageDate == '' ? self::rfcDate() : $this->MessageDate);
|
2036 |
-
|
2037 |
-
// To be created automatically by mail()
|
2038 |
-
if ($this->SingleTo) {
|
2039 |
-
if ($this->Mailer != 'mail') {
|
2040 |
-
foreach ($this->to as $toaddr) {
|
2041 |
-
$this->SingleToArray[] = $this->addrFormat($toaddr);
|
2042 |
-
}
|
2043 |
-
}
|
2044 |
-
} else {
|
2045 |
-
if (count($this->to) > 0) {
|
2046 |
-
if ($this->Mailer != 'mail') {
|
2047 |
-
$result .= $this->addrAppend('To', $this->to);
|
2048 |
-
}
|
2049 |
-
} elseif (count($this->cc) == 0) {
|
2050 |
-
$result .= $this->headerLine('To', 'undisclosed-recipients:;');
|
2051 |
-
}
|
2052 |
-
}
|
2053 |
-
|
2054 |
-
$result .= $this->addrAppend('From', array(array(trim($this->From), $this->FromName)));
|
2055 |
-
|
2056 |
-
// sendmail and mail() extract Cc from the header before sending
|
2057 |
-
if (count($this->cc) > 0) {
|
2058 |
-
$result .= $this->addrAppend('Cc', $this->cc);
|
2059 |
-
}
|
2060 |
-
|
2061 |
-
// sendmail and mail() extract Bcc from the header before sending
|
2062 |
-
if ((
|
2063 |
-
$this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail'
|
2064 |
-
)
|
2065 |
-
and count($this->bcc) > 0
|
2066 |
-
) {
|
2067 |
-
$result .= $this->addrAppend('Bcc', $this->bcc);
|
2068 |
-
}
|
2069 |
-
|
2070 |
-
if (count($this->ReplyTo) > 0) {
|
2071 |
-
$result .= $this->addrAppend('Reply-To', $this->ReplyTo);
|
2072 |
-
}
|
2073 |
-
|
2074 |
-
// mail() sets the subject itself
|
2075 |
-
if ($this->Mailer != 'mail') {
|
2076 |
-
$result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject)));
|
2077 |
-
}
|
2078 |
-
|
2079 |
-
// Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
|
2080 |
-
// https://tools.ietf.org/html/rfc5322#section-3.6.4
|
2081 |
-
if ('' != $this->MessageID and preg_match('/^<.*@.*>$/', $this->MessageID)) {
|
2082 |
-
$this->lastMessageID = $this->MessageID;
|
2083 |
-
} else {
|
2084 |
-
$this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
|
2085 |
-
}
|
2086 |
-
$result .= $this->headerLine('Message-ID', $this->lastMessageID);
|
2087 |
-
if (!is_null($this->Priority)) {
|
2088 |
-
$result .= $this->headerLine('X-Priority', $this->Priority);
|
2089 |
-
}
|
2090 |
-
if ($this->XMailer == '') {
|
2091 |
-
$result .= $this->headerLine(
|
2092 |
-
'X-Mailer',
|
2093 |
-
'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer)'
|
2094 |
-
);
|
2095 |
-
} else {
|
2096 |
-
$myXmailer = trim($this->XMailer);
|
2097 |
-
if ($myXmailer) {
|
2098 |
-
$result .= $this->headerLine('X-Mailer', $myXmailer);
|
2099 |
-
}
|
2100 |
-
}
|
2101 |
-
|
2102 |
-
if ($this->ConfirmReadingTo != '') {
|
2103 |
-
$result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>');
|
2104 |
-
}
|
2105 |
-
|
2106 |
-
// Add custom headers
|
2107 |
-
foreach ($this->CustomHeader as $header) {
|
2108 |
-
$result .= $this->headerLine(
|
2109 |
-
trim($header[0]),
|
2110 |
-
$this->encodeHeader(trim($header[1]))
|
2111 |
-
);
|
2112 |
-
}
|
2113 |
-
if (!$this->sign_key_file) {
|
2114 |
-
$result .= $this->headerLine('MIME-Version', '1.0');
|
2115 |
-
$result .= $this->getMailMIME();
|
2116 |
-
}
|
2117 |
-
|
2118 |
-
return $result;
|
2119 |
-
}
|
2120 |
-
|
2121 |
-
/**
|
2122 |
-
* Get the message MIME type headers.
|
2123 |
-
* @access public
|
2124 |
-
* @return string
|
2125 |
-
*/
|
2126 |
-
public function getMailMIME()
|
2127 |
-
{
|
2128 |
-
$result = '';
|
2129 |
-
$ismultipart = true;
|
2130 |
-
switch ($this->message_type) {
|
2131 |
-
case 'inline':
|
2132 |
-
$result .= $this->headerLine('Content-Type', 'multipart/related;');
|
2133 |
-
$result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
|
2134 |
-
break;
|
2135 |
-
case 'attach':
|
2136 |
-
case 'inline_attach':
|
2137 |
-
case 'alt_attach':
|
2138 |
-
case 'alt_inline_attach':
|
2139 |
-
$result .= $this->headerLine('Content-Type', 'multipart/mixed;');
|
2140 |
-
$result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
|
2141 |
-
break;
|
2142 |
-
case 'alt':
|
2143 |
-
case 'alt_inline':
|
2144 |
-
$result .= $this->headerLine('Content-Type', 'multipart/alternative;');
|
2145 |
-
$result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
|
2146 |
-
break;
|
2147 |
-
default:
|
2148 |
-
// Catches case 'plain': and case '':
|
2149 |
-
$result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);
|
2150 |
-
$ismultipart = false;
|
2151 |
-
break;
|
2152 |
-
}
|
2153 |
-
// RFC1341 part 5 says 7bit is assumed if not specified
|
2154 |
-
if ($this->Encoding != '7bit') {
|
2155 |
-
// RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE
|
2156 |
-
if ($ismultipart) {
|
2157 |
-
if ($this->Encoding == '8bit') {
|
2158 |
-
$result .= $this->headerLine('Content-Transfer-Encoding', '8bit');
|
2159 |
-
}
|
2160 |
-
// The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible
|
2161 |
-
} else {
|
2162 |
-
$result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding);
|
2163 |
-
}
|
2164 |
-
}
|
2165 |
-
|
2166 |
-
if ($this->Mailer != 'mail') {
|
2167 |
-
$result .= $this->LE;
|
2168 |
-
}
|
2169 |
-
|
2170 |
-
return $result;
|
2171 |
-
}
|
2172 |
-
|
2173 |
-
/**
|
2174 |
-
* Returns the whole MIME message.
|
2175 |
-
* Includes complete headers and body.
|
2176 |
-
* Only valid post preSend().
|
2177 |
-
* @see PHPMailer::preSend()
|
2178 |
-
* @access public
|
2179 |
-
* @return string
|
2180 |
-
*/
|
2181 |
-
public function getSentMIMEMessage()
|
2182 |
-
{
|
2183 |
-
return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody;
|
2184 |
-
}
|
2185 |
-
|
2186 |
-
/**
|
2187 |
-
* Create unique ID
|
2188 |
-
* @return string
|
2189 |
-
*/
|
2190 |
-
protected function generateId() {
|
2191 |
-
return md5(uniqid(time()));
|
2192 |
-
}
|
2193 |
-
|
2194 |
-
/**
|
2195 |
-
* Assemble the message body.
|
2196 |
-
* Returns an empty string on failure.
|
2197 |
-
* @access public
|
2198 |
-
* @throws phpmailerException
|
2199 |
-
* @return string The assembled message body
|
2200 |
-
*/
|
2201 |
-
public function createBody()
|
2202 |
-
{
|
2203 |
-
$body = '';
|
2204 |
-
//Create unique IDs and preset boundaries
|
2205 |
-
$this->uniqueid = $this->generateId();
|
2206 |
-
$this->boundary[1] = 'b1_' . $this->uniqueid;
|
2207 |
-
$this->boundary[2] = 'b2_' . $this->uniqueid;
|
2208 |
-
$this->boundary[3] = 'b3_' . $this->uniqueid;
|
2209 |
-
|
2210 |
-
if ($this->sign_key_file) {
|
2211 |
-
$body .= $this->getMailMIME() . $this->LE;
|
2212 |
-
}
|
2213 |
-
|
2214 |
-
$this->setWordWrap();
|
2215 |
-
|
2216 |
-
$bodyEncoding = $this->Encoding;
|
2217 |
-
$bodyCharSet = $this->CharSet;
|
2218 |
-
//Can we do a 7-bit downgrade?
|
2219 |
-
if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
|
2220 |
-
$bodyEncoding = '7bit';
|
2221 |
-
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
|
2222 |
-
$bodyCharSet = 'us-ascii';
|
2223 |
-
}
|
2224 |
-
//If lines are too long, and we're not already using an encoding that will shorten them,
|
2225 |
-
//change to quoted-printable transfer encoding for the body part only
|
2226 |
-
if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
|
2227 |
-
$bodyEncoding = 'quoted-printable';
|
2228 |
-
}
|
2229 |
-
|
2230 |
-
$altBodyEncoding = $this->Encoding;
|
2231 |
-
$altBodyCharSet = $this->CharSet;
|
2232 |
-
//Can we do a 7-bit downgrade?
|
2233 |
-
if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
|
2234 |
-
$altBodyEncoding = '7bit';
|
2235 |
-
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
|
2236 |
-
$altBodyCharSet = 'us-ascii';
|
2237 |
-
}
|
2238 |
-
//If lines are too long, and we're not already using an encoding that will shorten them,
|
2239 |
-
//change to quoted-printable transfer encoding for the alt body part only
|
2240 |
-
if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) {
|
2241 |
-
$altBodyEncoding = 'quoted-printable';
|
2242 |
-
}
|
2243 |
-
//Use this as a preamble in all multipart message types
|
2244 |
-
$mimepre = "This is a multi-part message in MIME format." . $this->LE . $this->LE;
|
2245 |
-
switch ($this->message_type) {
|
2246 |
-
case 'inline':
|
2247 |
-
$body .= $mimepre;
|
2248 |
-
$body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);
|
2249 |
-
$body .= $this->encodeString($this->Body, $bodyEncoding);
|
2250 |
-
$body .= $this->LE . $this->LE;
|
2251 |
-
$body .= $this->attachAll('inline', $this->boundary[1]);
|
2252 |
-
break;
|
2253 |
-
case 'attach':
|
2254 |
-
$body .= $mimepre;
|
2255 |
-
$body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);
|
2256 |
-
$body .= $this->encodeString($this->Body, $bodyEncoding);
|
2257 |
-
$body .= $this->LE . $this->LE;
|
2258 |
-
$body .= $this->attachAll('attachment', $this->boundary[1]);
|
2259 |
-
break;
|
2260 |
-
case 'inline_attach':
|
2261 |
-
$body .= $mimepre;
|
2262 |
-
$body .= $this->textLine('--' . $this->boundary[1]);
|
2263 |
-
$body .= $this->headerLine('Content-Type', 'multipart/related;');
|
2264 |
-
$body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
|
2265 |
-
$body .= $this->LE;
|
2266 |
-
$body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding);
|
2267 |
-
$body .= $this->encodeString($this->Body, $bodyEncoding);
|
2268 |
-
$body .= $this->LE . $this->LE;
|
2269 |
-
$body .= $this->attachAll('inline', $this->boundary[2]);
|
2270 |
-
$body .= $this->LE;
|
2271 |
-
$body .= $this->attachAll('attachment', $this->boundary[1]);
|
2272 |
-
break;
|
2273 |
-
case 'alt':
|
2274 |
-
$body .= $mimepre;
|
2275 |
-
$body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding);
|
2276 |
-
$body .= $this->encodeString($this->AltBody, $altBodyEncoding);
|
2277 |
-
$body .= $this->LE . $this->LE;
|
2278 |
-
$body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding);
|
2279 |
-
$body .= $this->encodeString($this->Body, $bodyEncoding);
|
2280 |
-
$body .= $this->LE . $this->LE;
|
2281 |
-
if (!empty($this->Ical)) {
|
2282 |
-
$body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', '');
|
2283 |
-
$body .= $this->encodeString($this->Ical, $this->Encoding);
|
2284 |
-
$body .= $this->LE . $this->LE;
|
2285 |
-
}
|
2286 |
-
$body .= $this->endBoundary($this->boundary[1]);
|
2287 |
-
break;
|
2288 |
-
case 'alt_inline':
|
2289 |
-
$body .= $mimepre;
|
2290 |
-
$body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding);
|
2291 |
-
$body .= $this->encodeString($this->AltBody, $altBodyEncoding);
|
2292 |
-
$body .= $this->LE . $this->LE;
|
2293 |
-
$body .= $this->textLine('--' . $this->boundary[1]);
|
2294 |
-
$body .= $this->headerLine('Content-Type', 'multipart/related;');
|
2295 |
-
$body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
|
2296 |
-
$body .= $this->LE;
|
2297 |
-
$body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding);
|
2298 |
-
$body .= $this->encodeString($this->Body, $bodyEncoding);
|
2299 |
-
$body .= $this->LE . $this->LE;
|
2300 |
-
$body .= $this->attachAll('inline', $this->boundary[2]);
|
2301 |
-
$body .= $this->LE;
|
2302 |
-
$body .= $this->endBoundary($this->boundary[1]);
|
2303 |
-
break;
|
2304 |
-
case 'alt_attach':
|
2305 |
-
$body .= $mimepre;
|
2306 |
-
$body .= $this->textLine('--' . $this->boundary[1]);
|
2307 |
-
$body .= $this->headerLine('Content-Type', 'multipart/alternative;');
|
2308 |
-
$body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
|
2309 |
-
$body .= $this->LE;
|
2310 |
-
$body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding);
|
2311 |
-
$body .= $this->encodeString($this->AltBody, $altBodyEncoding);
|
2312 |
-
$body .= $this->LE . $this->LE;
|
2313 |
-
$body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding);
|
2314 |
-
$body .= $this->encodeString($this->Body, $bodyEncoding);
|
2315 |
-
$body .= $this->LE . $this->LE;
|
2316 |
-
$body .= $this->endBoundary($this->boundary[2]);
|
2317 |
-
$body .= $this->LE;
|
2318 |
-
$body .= $this->attachAll('attachment', $this->boundary[1]);
|
2319 |
-
break;
|
2320 |
-
case 'alt_inline_attach':
|
2321 |
-
$body .= $mimepre;
|
2322 |
-
$body .= $this->textLine('--' . $this->boundary[1]);
|
2323 |
-
$body .= $this->headerLine('Content-Type', 'multipart/alternative;');
|
2324 |
-
$body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
|
2325 |
-
$body .= $this->LE;
|
2326 |
-
$body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding);
|
2327 |
-
$body .= $this->encodeString($this->AltBody, $altBodyEncoding);
|
2328 |
-
$body .= $this->LE . $this->LE;
|
2329 |
-
$body .= $this->textLine('--' . $this->boundary[2]);
|
2330 |
-
$body .= $this->headerLine('Content-Type', 'multipart/related;');
|
2331 |
-
$body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"');
|
2332 |
-
$body .= $this->LE;
|
2333 |
-
$body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding);
|
2334 |
-
$body .= $this->encodeString($this->Body, $bodyEncoding);
|
2335 |
-
$body .= $this->LE . $this->LE;
|
2336 |
-
$body .= $this->attachAll('inline', $this->boundary[3]);
|
2337 |
-
$body .= $this->LE;
|
2338 |
-
$body .= $this->endBoundary($this->boundary[2]);
|
2339 |
-
$body .= $this->LE;
|
2340 |
-
$body .= $this->attachAll('attachment', $this->boundary[1]);
|
2341 |
-
break;
|
2342 |
-
default:
|
2343 |
-
// Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types
|
2344 |
-
//Reset the `Encoding` property in case we changed it for line length reasons
|
2345 |
-
$this->Encoding = $bodyEncoding;
|
2346 |
-
$body .= $this->encodeString($this->Body, $this->Encoding);
|
2347 |
-
break;
|
2348 |
-
}
|
2349 |
-
|
2350 |
-
if ($this->isError()) {
|
2351 |
-
$body = '';
|
2352 |
-
} elseif ($this->sign_key_file) {
|
2353 |
-
try {
|
2354 |
-
if (!defined('PKCS7_TEXT')) {
|
2355 |
-
throw new phpmailerException($this->lang('extension_missing') . 'openssl');
|
2356 |
-
}
|
2357 |
-
// @TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1
|
2358 |
-
$file = tempnam(sys_get_temp_dir(), 'mail');
|
2359 |
-
if (false === file_put_contents($file, $body)) {
|
2360 |
-
throw new phpmailerException($this->lang('signing') . ' Could not write temp file');
|
2361 |
-
}
|
2362 |
-
$signed = tempnam(sys_get_temp_dir(), 'signed');
|
2363 |
-
//Workaround for PHP bug https://bugs.php.net/bug.php?id=69197
|
2364 |
-
if (empty($this->sign_extracerts_file)) {
|
2365 |
-
$sign = @openssl_pkcs7_sign(
|
2366 |
-
$file,
|
2367 |
-
$signed,
|
2368 |
-
'file://' . realpath($this->sign_cert_file),
|
2369 |
-
array('file://' . realpath($this->sign_key_file), $this->sign_key_pass),
|
2370 |
-
null
|
2371 |
-
);
|
2372 |
-
} else {
|
2373 |
-
$sign = @openssl_pkcs7_sign(
|
2374 |
-
$file,
|
2375 |
-
$signed,
|
2376 |
-
'file://' . realpath($this->sign_cert_file),
|
2377 |
-
array('file://' . realpath($this->sign_key_file), $this->sign_key_pass),
|
2378 |
-
null,
|
2379 |
-
PKCS7_DETACHED,
|
2380 |
-
$this->sign_extracerts_file
|
2381 |
-
);
|
2382 |
-
}
|
2383 |
-
if ($sign) {
|
2384 |
-
@unlink($file);
|
2385 |
-
$body = file_get_contents($signed);
|
2386 |
-
@unlink($signed);
|
2387 |
-
//The message returned by openssl contains both headers and body, so need to split them up
|
2388 |
-
$parts = explode("\n\n", $body, 2);
|
2389 |
-
$this->MIMEHeader .= $parts[0] . $this->LE . $this->LE;
|
2390 |
-
$body = $parts[1];
|
2391 |
-
} else {
|
2392 |
-
@unlink($file);
|
2393 |
-
@unlink($signed);
|
2394 |
-
throw new phpmailerException($this->lang('signing') . openssl_error_string());
|
2395 |
-
}
|
2396 |
-
} catch (phpmailerException $exc) {
|
2397 |
-
$body = '';
|
2398 |
-
if ($this->exceptions) {
|
2399 |
-
throw $exc;
|
2400 |
-
}
|
2401 |
-
}
|
2402 |
-
}
|
2403 |
-
return $body;
|
2404 |
-
}
|
2405 |
-
|
2406 |
-
/**
|
2407 |
-
* Return the start of a message boundary.
|
2408 |
-
* @access protected
|
2409 |
-
* @param string $boundary
|
2410 |
-
* @param string $charSet
|
2411 |
-
* @param string $contentType
|
2412 |
-
* @param string $encoding
|
2413 |
-
* @return string
|
2414 |
-
*/
|
2415 |
-
protected function getBoundary($boundary, $charSet, $contentType, $encoding)
|
2416 |
-
{
|
2417 |
-
$result = '';
|
2418 |
-
if ($charSet == '') {
|
2419 |
-
$charSet = $this->CharSet;
|
2420 |
-
}
|
2421 |
-
if ($contentType == '') {
|
2422 |
-
$contentType = $this->ContentType;
|
2423 |
-
}
|
2424 |
-
if ($encoding == '') {
|
2425 |
-
$encoding = $this->Encoding;
|
2426 |
-
}
|
2427 |
-
$result .= $this->textLine('--' . $boundary);
|
2428 |
-
$result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet);
|
2429 |
-
$result .= $this->LE;
|
2430 |
-
// RFC1341 part 5 says 7bit is assumed if not specified
|
2431 |
-
if ($encoding != '7bit') {
|
2432 |
-
$result .= $this->headerLine('Content-Transfer-Encoding', $encoding);
|
2433 |
-
}
|
2434 |
-
$result .= $this->LE;
|
2435 |
-
|
2436 |
-
return $result;
|
2437 |
-
}
|
2438 |
-
|
2439 |
-
/**
|
2440 |
-
* Return the end of a message boundary.
|
2441 |
-
* @access protected
|
2442 |
-
* @param string $boundary
|
2443 |
-
* @return string
|
2444 |
-
*/
|
2445 |
-
protected function endBoundary($boundary)
|
2446 |
-
{
|
2447 |
-
return $this->LE . '--' . $boundary . '--' . $this->LE;
|
2448 |
-
}
|
2449 |
-
|
2450 |
-
/**
|
2451 |
-
* Set the message type.
|
2452 |
-
* PHPMailer only supports some preset message types, not arbitrary MIME structures.
|
2453 |
-
* @access protected
|
2454 |
-
* @return void
|
2455 |
-
*/
|
2456 |
-
protected function setMessageType()
|
2457 |
-
{
|
2458 |
-
$type = array();
|
2459 |
-
if ($this->alternativeExists()) {
|
2460 |
-
$type[] = 'alt';
|
2461 |
-
}
|
2462 |
-
if ($this->inlineImageExists()) {
|
2463 |
-
$type[] = 'inline';
|
2464 |
-
}
|
2465 |
-
if ($this->attachmentExists()) {
|
2466 |
-
$type[] = 'attach';
|
2467 |
-
}
|
2468 |
-
$this->message_type = implode('_', $type);
|
2469 |
-
if ($this->message_type == '') {
|
2470 |
-
//The 'plain' message_type refers to the message having a single body element, not that it is plain-text
|
2471 |
-
$this->message_type = 'plain';
|
2472 |
-
}
|
2473 |
-
}
|
2474 |
-
|
2475 |
-
/**
|
2476 |
-
* Format a header line.
|
2477 |
-
* @access public
|
2478 |
-
* @param string $name
|
2479 |
-
* @param string $value
|
2480 |
-
* @return string
|
2481 |
-
*/
|
2482 |
-
public function headerLine($name, $value)
|
2483 |
-
{
|
2484 |
-
return $name . ': ' . $value . $this->LE;
|
2485 |
-
}
|
2486 |
-
|
2487 |
-
/**
|
2488 |
-
* Return a formatted mail line.
|
2489 |
-
* @access public
|
2490 |
-
* @param string $value
|
2491 |
-
* @return string
|
2492 |
-
*/
|
2493 |
-
public function textLine($value)
|
2494 |
-
{
|
2495 |
-
return $value . $this->LE;
|
2496 |
-
}
|
2497 |
-
|
2498 |
-
/**
|
2499 |
-
* Add an attachment from a path on the filesystem.
|
2500 |
-
* Never use a user-supplied path to a file!
|
2501 |
-
* Returns false if the file could not be found or read.
|
2502 |
-
* @param string $path Path to the attachment.
|
2503 |
-
* @param string $name Overrides the attachment name.
|
2504 |
-
* @param string $encoding File encoding (see $Encoding).
|
2505 |
-
* @param string $type File extension (MIME) type.
|
2506 |
-
* @param string $disposition Disposition to use
|
2507 |
-
* @throws phpmailerException
|
2508 |
-
* @return boolean
|
2509 |
-
*/
|
2510 |
-
public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
|
2511 |
-
{
|
2512 |
-
try {
|
2513 |
-
if (!@is_file($path)) {
|
2514 |
-
throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
|
2515 |
-
}
|
2516 |
-
|
2517 |
-
// If a MIME type is not specified, try to work it out from the file name
|
2518 |
-
if ($type == '') {
|
2519 |
-
$type = self::filenameToType($path);
|
2520 |
-
}
|
2521 |
-
|
2522 |
-
$filename = basename($path);
|
2523 |
-
if ($name == '') {
|
2524 |
-
$name = $filename;
|
2525 |
-
}
|
2526 |
-
|
2527 |
-
$this->attachment[] = array(
|
2528 |
-
0 => $path,
|
2529 |
-
1 => $filename,
|
2530 |
-
2 => $name,
|
2531 |
-
3 => $encoding,
|
2532 |
-
4 => $type,
|
2533 |
-
5 => false, // isStringAttachment
|
2534 |
-
6 => $disposition,
|
2535 |
-
7 => 0
|
2536 |
-
);
|
2537 |
-
|
2538 |
-
} catch (phpmailerException $exc) {
|
2539 |
-
$this->setError($exc->getMessage());
|
2540 |
-
$this->edebug($exc->getMessage());
|
2541 |
-
if ($this->exceptions) {
|
2542 |
-
throw $exc;
|
2543 |
-
}
|
2544 |
-
return false;
|
2545 |
-
}
|
2546 |
-
return true;
|
2547 |
-
}
|
2548 |
-
|
2549 |
-
/**
|
2550 |
-
* Return the array of attachments.
|
2551 |
-
* @return array
|
2552 |
-
*/
|
2553 |
-
public function getAttachments()
|
2554 |
-
{
|
2555 |
-
return $this->attachment;
|
2556 |
-
}
|
2557 |
-
|
2558 |
-
/**
|
2559 |
-
* Attach all file, string, and binary attachments to the message.
|
2560 |
-
* Returns an empty string on failure.
|
2561 |
-
* @access protected
|
2562 |
-
* @param string $disposition_type
|
2563 |
-
* @param string $boundary
|
2564 |
-
* @return string
|
2565 |
-
*/
|
2566 |
-
protected function attachAll($disposition_type, $boundary)
|
2567 |
-
{
|
2568 |
-
// Return text of body
|
2569 |
-
$mime = array();
|
2570 |
-
$cidUniq = array();
|
2571 |
-
$incl = array();
|
2572 |
-
|
2573 |
-
// Add all attachments
|
2574 |
-
foreach ($this->attachment as $attachment) {
|
2575 |
-
// Check if it is a valid disposition_filter
|
2576 |
-
if ($attachment[6] == $disposition_type) {
|
2577 |
-
// Check for string attachment
|
2578 |
-
$string = '';
|
2579 |
-
$path = '';
|
2580 |
-
$bString = $attachment[5];
|
2581 |
-
if ($bString) {
|
2582 |
-
$string = $attachment[0];
|
2583 |
-
} else {
|
2584 |
-
$path = $attachment[0];
|
2585 |
-
}
|
2586 |
-
|
2587 |
-
$inclhash = md5(serialize($attachment));
|
2588 |
-
if (in_array($inclhash, $incl)) {
|
2589 |
-
continue;
|
2590 |
-
}
|
2591 |
-
$incl[] = $inclhash;
|
2592 |
-
$name = $attachment[2];
|
2593 |
-
$encoding = $attachment[3];
|
2594 |
-
$type = $attachment[4];
|
2595 |
-
$disposition = $attachment[6];
|
2596 |
-
$cid = $attachment[7];
|
2597 |
-
if ($disposition == 'inline' && array_key_exists($cid, $cidUniq)) {
|
2598 |
-
continue;
|
2599 |
-
}
|
2600 |
-
$cidUniq[$cid] = true;
|
2601 |
-
|
2602 |
-
$mime[] = sprintf('--%s%s', $boundary, $this->LE);
|
2603 |
-
//Only include a filename property if we have one
|
2604 |
-
if (!empty($name)) {
|
2605 |
-
$mime[] = sprintf(
|
2606 |
-
'Content-Type: %s; name="%s"%s',
|
2607 |
-
$type,
|
2608 |
-
$this->encodeHeader($this->secureHeader($name)),
|
2609 |
-
$this->LE
|
2610 |
-
);
|
2611 |
-
} else {
|
2612 |
-
$mime[] = sprintf(
|
2613 |
-
'Content-Type: %s%s',
|
2614 |
-
$type,
|
2615 |
-
$this->LE
|
2616 |
-
);
|
2617 |
-
}
|
2618 |
-
// RFC1341 part 5 says 7bit is assumed if not specified
|
2619 |
-
if ($encoding != '7bit') {
|
2620 |
-
$mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE);
|
2621 |
-
}
|
2622 |
-
|
2623 |
-
if ($disposition == 'inline') {
|
2624 |
-
$mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE);
|
2625 |
-
}
|
2626 |
-
|
2627 |
-
// If a filename contains any of these chars, it should be quoted,
|
2628 |
-
// but not otherwise: RFC2183 & RFC2045 5.1
|
2629 |
-
// Fixes a warning in IETF's msglint MIME checker
|
2630 |
-
// Allow for bypassing the Content-Disposition header totally
|
2631 |
-
if (!(empty($disposition))) {
|
2632 |
-
$encoded_name = $this->encodeHeader($this->secureHeader($name));
|
2633 |
-
if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $encoded_name)) {
|
2634 |
-
$mime[] = sprintf(
|
2635 |
-
'Content-Disposition: %s; filename="%s"%s',
|
2636 |
-
$disposition,
|
2637 |
-
$encoded_name,
|
2638 |
-
$this->LE . $this->LE
|
2639 |
-
);
|
2640 |
-
} else {
|
2641 |
-
if (!empty($encoded_name)) {
|
2642 |
-
$mime[] = sprintf(
|
2643 |
-
'Content-Disposition: %s; filename=%s%s',
|
2644 |
-
$disposition,
|
2645 |
-
$encoded_name,
|
2646 |
-
$this->LE . $this->LE
|
2647 |
-
);
|
2648 |
-
} else {
|
2649 |
-
$mime[] = sprintf(
|
2650 |
-
'Content-Disposition: %s%s',
|
2651 |
-
$disposition,
|
2652 |
-
$this->LE . $this->LE
|
2653 |
-
);
|
2654 |
-
}
|
2655 |
-
}
|
2656 |
-
} else {
|
2657 |
-
$mime[] = $this->LE;
|
2658 |
-
}
|
2659 |
-
|
2660 |
-
// Encode as string attachment
|
2661 |
-
if ($bString) {
|
2662 |
-
$mime[] = $this->encodeString($string, $encoding);
|
2663 |
-
if ($this->isError()) {
|
2664 |
-
return '';
|
2665 |
-
}
|
2666 |
-
$mime[] = $this->LE . $this->LE;
|
2667 |
-
} else {
|
2668 |
-
$mime[] = $this->encodeFile($path, $encoding);
|
2669 |
-
if ($this->isError()) {
|
2670 |
-
return '';
|
2671 |
-
}
|
2672 |
-
$mime[] = $this->LE . $this->LE;
|
2673 |
-
}
|
2674 |
-
}
|
2675 |
-
}
|
2676 |
-
|
2677 |
-
$mime[] = sprintf('--%s--%s', $boundary, $this->LE);
|
2678 |
-
|
2679 |
-
return implode('', $mime);
|
2680 |
-
}
|
2681 |
-
|
2682 |
-
/**
|
2683 |
-
* Encode a file attachment in requested format.
|
2684 |
-
* Returns an empty string on failure.
|
2685 |
-
* @param string $path The full path to the file
|
2686 |
-
* @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
|
2687 |
-
* @throws phpmailerException
|
2688 |
-
* @access protected
|
2689 |
-
* @return string
|
2690 |
-
*/
|
2691 |
-
protected function encodeFile($path, $encoding = 'base64')
|
2692 |
-
{
|
2693 |
-
try {
|
2694 |
-
if (!is_readable($path)) {
|
2695 |
-
throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
|
2696 |
-
}
|
2697 |
-
$magic_quotes = get_magic_quotes_runtime();
|
2698 |
-
if ($magic_quotes) {
|
2699 |
-
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
|
2700 |
-
set_magic_quotes_runtime(false);
|
2701 |
-
} else {
|
2702 |
-
//Doesn't exist in PHP 5.4, but we don't need to check because
|
2703 |
-
//get_magic_quotes_runtime always returns false in 5.4+
|
2704 |
-
//so it will never get here
|
2705 |
-
ini_set('magic_quotes_runtime', false);
|
2706 |
-
}
|
2707 |
-
}
|
2708 |
-
$file_buffer = file_get_contents($path);
|
2709 |
-
$file_buffer = $this->encodeString($file_buffer, $encoding);
|
2710 |
-
if ($magic_quotes) {
|
2711 |
-
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
|
2712 |
-
set_magic_quotes_runtime($magic_quotes);
|
2713 |
-
} else {
|
2714 |
-
ini_set('magic_quotes_runtime', $magic_quotes);
|
2715 |
-
}
|
2716 |
-
}
|
2717 |
-
return $file_buffer;
|
2718 |
-
} catch (Exception $exc) {
|
2719 |
-
$this->setError($exc->getMessage());
|
2720 |
-
return '';
|
2721 |
-
}
|
2722 |
-
}
|
2723 |
-
|
2724 |
-
/**
|
2725 |
-
* Encode a string in requested format.
|
2726 |
-
* Returns an empty string on failure.
|
2727 |
-
* @param string $str The text to encode
|
2728 |
-
* @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
|
2729 |
-
* @access public
|
2730 |
-
* @return string
|
2731 |
-
*/
|
2732 |
-
public function encodeString($str, $encoding = 'base64')
|
2733 |
-
{
|
2734 |
-
$encoded = '';
|
2735 |
-
switch (strtolower($encoding)) {
|
2736 |
-
case 'base64':
|
2737 |
-
$encoded = chunk_split(base64_encode($str), 76, $this->LE);
|
2738 |
-
break;
|
2739 |
-
case '7bit':
|
2740 |
-
case '8bit':
|
2741 |
-
$encoded = $this->fixEOL($str);
|
2742 |
-
// Make sure it ends with a line break
|
2743 |
-
if (substr($encoded, -(strlen($this->LE))) != $this->LE) {
|
2744 |
-
$encoded .= $this->LE;
|
2745 |
-
}
|
2746 |
-
break;
|
2747 |
-
case 'binary':
|
2748 |
-
$encoded = $str;
|
2749 |
-
break;
|
2750 |
-
case 'quoted-printable':
|
2751 |
-
$encoded = $this->encodeQP($str);
|
2752 |
-
break;
|
2753 |
-
default:
|
2754 |
-
$this->setError($this->lang('encoding') . $encoding);
|
2755 |
-
break;
|
2756 |
-
}
|
2757 |
-
return $encoded;
|
2758 |
-
}
|
2759 |
-
|
2760 |
-
/**
|
2761 |
-
* Encode a header string optimally.
|
2762 |
-
* Picks shortest of Q, B, quoted-printable or none.
|
2763 |
-
* @access public
|
2764 |
-
* @param string $str
|
2765 |
-
* @param string $position
|
2766 |
-
* @return string
|
2767 |
-
*/
|
2768 |
-
public function encodeHeader($str, $position = 'text')
|
2769 |
-
{
|
2770 |
-
$matchcount = 0;
|
2771 |
-
switch (strtolower($position)) {
|
2772 |
-
case 'phrase':
|
2773 |
-
if (!preg_match('/[\200-\377]/', $str)) {
|
2774 |
-
// Can't use addslashes as we don't know the value of magic_quotes_sybase
|
2775 |
-
$encoded = addcslashes($str, "\0..\37\177\\\"");
|
2776 |
-
if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
|
2777 |
-
return ($encoded);
|
2778 |
-
} else {
|
2779 |
-
return ("\"$encoded\"");
|
2780 |
-
}
|
2781 |
-
}
|
2782 |
-
$matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
|
2783 |
-
break;
|
2784 |
-
/** @noinspection PhpMissingBreakStatementInspection */
|
2785 |
-
case 'comment':
|
2786 |
-
$matchcount = preg_match_all('/[()"]/', $str, $matches);
|
2787 |
-
// Intentional fall-through
|
2788 |
-
case 'text':
|
2789 |
-
default:
|
2790 |
-
$matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
|
2791 |
-
break;
|
2792 |
-
}
|
2793 |
-
|
2794 |
-
//There are no chars that need encoding
|
2795 |
-
if ($matchcount == 0) {
|
2796 |
-
return ($str);
|
2797 |
-
}
|
2798 |
-
|
2799 |
-
$maxlen = 75 - 7 - strlen($this->CharSet);
|
2800 |
-
// Try to select the encoding which should produce the shortest output
|
2801 |
-
if ($matchcount > strlen($str) / 3) {
|
2802 |
-
// More than a third of the content will need encoding, so B encoding will be most efficient
|
2803 |
-
$encoding = 'B';
|
2804 |
-
if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) {
|
2805 |
-
// Use a custom function which correctly encodes and wraps long
|
2806 |
-
// multibyte strings without breaking lines within a character
|
2807 |
-
$encoded = $this->base64EncodeWrapMB($str, "\n");
|
2808 |
-
} else {
|
2809 |
-
$encoded = base64_encode($str);
|
2810 |
-
$maxlen -= $maxlen % 4;
|
2811 |
-
$encoded = trim(chunk_split($encoded, $maxlen, "\n"));
|
2812 |
-
}
|
2813 |
-
} else {
|
2814 |
-
$encoding = 'Q';
|
2815 |
-
$encoded = $this->encodeQ($str, $position);
|
2816 |
-
$encoded = $this->wrapText($encoded, $maxlen, true);
|
2817 |
-
$encoded = str_replace('=' . self::CRLF, "\n", trim($encoded));
|
2818 |
-
}
|
2819 |
-
|
2820 |
-
$encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded);
|
2821 |
-
$encoded = trim(str_replace("\n", $this->LE, $encoded));
|
2822 |
-
|
2823 |
-
return $encoded;
|
2824 |
-
}
|
2825 |
-
|
2826 |
-
/**
|
2827 |
-
* Check if a string contains multi-byte characters.
|
2828 |
-
* @access public
|
2829 |
-
* @param string $str multi-byte text to wrap encode
|
2830 |
-
* @return boolean
|
2831 |
-
*/
|
2832 |
-
public function hasMultiBytes($str)
|
2833 |
-
{
|
2834 |
-
if (function_exists('mb_strlen')) {
|
2835 |
-
return (strlen($str) > mb_strlen($str, $this->CharSet));
|
2836 |
-
} else { // Assume no multibytes (we can't handle without mbstring functions anyway)
|
2837 |
-
return false;
|
2838 |
-
}
|
2839 |
-
}
|
2840 |
-
|
2841 |
-
/**
|
2842 |
-
* Does a string contain any 8-bit chars (in any charset)?
|
2843 |
-
* @param string $text
|
2844 |
-
* @return boolean
|
2845 |
-
*/
|
2846 |
-
public function has8bitChars($text)
|
2847 |
-
{
|
2848 |
-
return (boolean)preg_match('/[\x80-\xFF]/', $text);
|
2849 |
-
}
|
2850 |
-
|
2851 |
-
/**
|
2852 |
-
* Encode and wrap long multibyte strings for mail headers
|
2853 |
-
* without breaking lines within a character.
|
2854 |
-
* Adapted from a function by paravoid
|
2855 |
-
* @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283
|
2856 |
-
* @access public
|
2857 |
-
* @param string $str multi-byte text to wrap encode
|
2858 |
-
* @param string $linebreak string to use as linefeed/end-of-line
|
2859 |
-
* @return string
|
2860 |
-
*/
|
2861 |
-
public function base64EncodeWrapMB($str, $linebreak = null)
|
2862 |
-
{
|
2863 |
-
$start = '=?' . $this->CharSet . '?B?';
|
2864 |
-
$end = '?=';
|
2865 |
-
$encoded = '';
|
2866 |
-
if ($linebreak === null) {
|
2867 |
-
$linebreak = $this->LE;
|
2868 |
-
}
|
2869 |
-
|
2870 |
-
$mb_length = mb_strlen($str, $this->CharSet);
|
2871 |
-
// Each line must have length <= 75, including $start and $end
|
2872 |
-
$length = 75 - strlen($start) - strlen($end);
|
2873 |
-
// Average multi-byte ratio
|
2874 |
-
$ratio = $mb_length / strlen($str);
|
2875 |
-
// Base64 has a 4:3 ratio
|
2876 |
-
$avgLength = floor($length * $ratio * .75);
|
2877 |
-
|
2878 |
-
for ($i = 0; $i < $mb_length; $i += $offset) {
|
2879 |
-
$lookBack = 0;
|
2880 |
-
do {
|
2881 |
-
$offset = $avgLength - $lookBack;
|
2882 |
-
$chunk = mb_substr($str, $i, $offset, $this->CharSet);
|
2883 |
-
$chunk = base64_encode($chunk);
|
2884 |
-
$lookBack++;
|
2885 |
-
} while (strlen($chunk) > $length);
|
2886 |
-
$encoded .= $chunk . $linebreak;
|
2887 |
-
}
|
2888 |
-
|
2889 |
-
// Chomp the last linefeed
|
2890 |
-
$encoded = substr($encoded, 0, -strlen($linebreak));
|
2891 |
-
return $encoded;
|
2892 |
-
}
|
2893 |
-
|
2894 |
-
/**
|
2895 |
-
* Encode a string in quoted-printable format.
|
2896 |
-
* According to RFC2045 section 6.7.
|
2897 |
-
* @access public
|
2898 |
-
* @param string $string The text to encode
|
2899 |
-
* @param integer $line_max Number of chars allowed on a line before wrapping
|
2900 |
-
* @return string
|
2901 |
-
* @link http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 Adapted from this comment
|
2902 |
-
*/
|
2903 |
-
public function encodeQP($string, $line_max = 76)
|
2904 |
-
{
|
2905 |
-
// Use native function if it's available (>= PHP5.3)
|
2906 |
-
if (function_exists('quoted_printable_encode')) {
|
2907 |
-
return quoted_printable_encode($string);
|
2908 |
-
}
|
2909 |
-
// Fall back to a pure PHP implementation
|
2910 |
-
$string = str_replace(
|
2911 |
-
array('%20', '%0D%0A.', '%0D%0A', '%'),
|
2912 |
-
array(' ', "\r\n=2E", "\r\n", '='),
|
2913 |
-
rawurlencode($string)
|
2914 |
-
);
|
2915 |
-
return preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string);
|
2916 |
-
}
|
2917 |
-
|
2918 |
-
/**
|
2919 |
-
* Backward compatibility wrapper for an old QP encoding function that was removed.
|
2920 |
-
* @see PHPMailer::encodeQP()
|
2921 |
-
* @access public
|
2922 |
-
* @param string $string
|
2923 |
-
* @param integer $line_max
|
2924 |
-
* @param boolean $space_conv
|
2925 |
-
* @return string
|
2926 |
-
* @deprecated Use encodeQP instead.
|
2927 |
-
*/
|
2928 |
-
public function encodeQPphp(
|
2929 |
-
$string,
|
2930 |
-
$line_max = 76,
|
2931 |
-
/** @noinspection PhpUnusedParameterInspection */ $space_conv = false
|
2932 |
-
) {
|
2933 |
-
return $this->encodeQP($string, $line_max);
|
2934 |
-
}
|
2935 |
-
|
2936 |
-
/**
|
2937 |
-
* Encode a string using Q encoding.
|
2938 |
-
* @link http://tools.ietf.org/html/rfc2047
|
2939 |
-
* @param string $str the text to encode
|
2940 |
-
* @param string $position Where the text is going to be used, see the RFC for what that means
|
2941 |
-
* @access public
|
2942 |
-
* @return string
|
2943 |
-
*/
|
2944 |
-
public function encodeQ($str, $position = 'text')
|
2945 |
-
{
|
2946 |
-
// There should not be any EOL in the string
|
2947 |
-
$pattern = '';
|
2948 |
-
$encoded = str_replace(array("\r", "\n"), '', $str);
|
2949 |
-
switch (strtolower($position)) {
|
2950 |
-
case 'phrase':
|
2951 |
-
// RFC 2047 section 5.3
|
2952 |
-
$pattern = '^A-Za-z0-9!*+\/ -';
|
2953 |
-
break;
|
2954 |
-
/** @noinspection PhpMissingBreakStatementInspection */
|
2955 |
-
case 'comment':
|
2956 |
-
// RFC 2047 section 5.2
|
2957 |
-
$pattern = '\(\)"';
|
2958 |
-
// intentional fall-through
|
2959 |
-
// for this reason we build the $pattern without including delimiters and []
|
2960 |
-
case 'text':
|
2961 |
-
default:
|
2962 |
-
// RFC 2047 section 5.1
|
2963 |
-
// Replace every high ascii, control, =, ? and _ characters
|
2964 |
-
$pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern;
|
2965 |
-
break;
|
2966 |
-
}
|
2967 |
-
$matches = array();
|
2968 |
-
if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) {
|
2969 |
-
// If the string contains an '=', make sure it's the first thing we replace
|
2970 |
-
// so as to avoid double-encoding
|
2971 |
-
$eqkey = array_search('=', $matches[0]);
|
2972 |
-
if (false !== $eqkey) {
|
2973 |
-
unset($matches[0][$eqkey]);
|
2974 |
-
array_unshift($matches[0], '=');
|
2975 |
-
}
|
2976 |
-
foreach (array_unique($matches[0]) as $char) {
|
2977 |
-
$encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded);
|
2978 |
-
}
|
2979 |
-
}
|
2980 |
-
// Replace every spaces to _ (more readable than =20)
|
2981 |
-
return str_replace(' ', '_', $encoded);
|
2982 |
-
}
|
2983 |
-
|
2984 |
-
/**
|
2985 |
-
* Add a string or binary attachment (non-filesystem).
|
2986 |
-
* This method can be used to attach ascii or binary data,
|
2987 |
-
* such as a BLOB record from a database.
|
2988 |
-
* @param string $string String attachment data.
|
2989 |
-
* @param string $filename Name of the attachment.
|
2990 |
-
* @param string $encoding File encoding (see $Encoding).
|
2991 |
-
* @param string $type File extension (MIME) type.
|
2992 |
-
* @param string $disposition Disposition to use
|
2993 |
-
* @return void
|
2994 |
-
*/
|
2995 |
-
public function addStringAttachment(
|
2996 |
-
$string,
|
2997 |
-
$filename,
|
2998 |
-
$encoding = 'base64',
|
2999 |
-
$type = '',
|
3000 |
-
$disposition = 'attachment'
|
3001 |
-
) {
|
3002 |
-
// If a MIME type is not specified, try to work it out from the file name
|
3003 |
-
if ($type == '') {
|
3004 |
-
$type = self::filenameToType($filename);
|
3005 |
-
}
|
3006 |
-
// Append to $attachment array
|
3007 |
-
$this->attachment[] = array(
|
3008 |
-
0 => $string,
|
3009 |
-
1 => $filename,
|
3010 |
-
2 => basename($filename),
|
3011 |
-
3 => $encoding,
|
3012 |
-
4 => $type,
|
3013 |
-
5 => true, // isStringAttachment
|
3014 |
-
6 => $disposition,
|
3015 |
-
7 => 0
|
3016 |
-
);
|
3017 |
-
}
|
3018 |
-
|
3019 |
-
/**
|
3020 |
-
* Add an embedded (inline) attachment from a file.
|
3021 |
-
* This can include images, sounds, and just about any other document type.
|
3022 |
-
* These differ from 'regular' attachments in that they are intended to be
|
3023 |
-
* displayed inline with the message, not just attached for download.
|
3024 |
-
* This is used in HTML messages that embed the images
|
3025 |
-
* the HTML refers to using the $cid value.
|
3026 |
-
* Never use a user-supplied path to a file!
|
3027 |
-
* @param string $path Path to the attachment.
|
3028 |
-
* @param string $cid Content ID of the attachment; Use this to reference
|
3029 |
-
* the content when using an embedded image in HTML.
|
3030 |
-
* @param string $name Overrides the attachment name.
|
3031 |
-
* @param string $encoding File encoding (see $Encoding).
|
3032 |
-
* @param string $type File MIME type.
|
3033 |
-
* @param string $disposition Disposition to use
|
3034 |
-
* @return boolean True on successfully adding an attachment
|
3035 |
-
*/
|
3036 |
-
public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline')
|
3037 |
-
{
|
3038 |
-
if (!@is_file($path)) {
|
3039 |
-
$this->setError($this->lang('file_access') . $path);
|
3040 |
-
return false;
|
3041 |
-
}
|
3042 |
-
|
3043 |
-
// If a MIME type is not specified, try to work it out from the file name
|
3044 |
-
if ($type == '') {
|
3045 |
-
$type = self::filenameToType($path);
|
3046 |
-
}
|
3047 |
-
|
3048 |
-
$filename = basename($path);
|
3049 |
-
if ($name == '') {
|
3050 |
-
$name = $filename;
|
3051 |
-
}
|
3052 |
-
|
3053 |
-
// Append to $attachment array
|
3054 |
-
$this->attachment[] = array(
|
3055 |
-
0 => $path,
|
3056 |
-
1 => $filename,
|
3057 |
-
2 => $name,
|
3058 |
-
3 => $encoding,
|
3059 |
-
4 => $type,
|
3060 |
-
5 => false, // isStringAttachment
|
3061 |
-
6 => $disposition,
|
3062 |
-
7 => $cid
|
3063 |
-
);
|
3064 |
-
return true;
|
3065 |
-
}
|
3066 |
-
|
3067 |
-
/**
|
3068 |
-
* Add an embedded stringified attachment.
|
3069 |
-
* This can include images, sounds, and just about any other document type.
|
3070 |
-
* Be sure to set the $type to an image type for images:
|
3071 |
-
* JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'.
|
3072 |
-
* @param string $string The attachment binary data.
|
3073 |
-
* @param string $cid Content ID of the attachment; Use this to reference
|
3074 |
-
* the content when using an embedded image in HTML.
|
3075 |
-
* @param string $name
|
3076 |
-
* @param string $encoding File encoding (see $Encoding).
|
3077 |
-
* @param string $type MIME type.
|
3078 |
-
* @param string $disposition Disposition to use
|
3079 |
-
* @return boolean True on successfully adding an attachment
|
3080 |
-
*/
|
3081 |
-
public function addStringEmbeddedImage(
|
3082 |
-
$string,
|
3083 |
-
$cid,
|
3084 |
-
$name = '',
|
3085 |
-
$encoding = 'base64',
|
3086 |
-
$type = '',
|
3087 |
-
$disposition = 'inline'
|
3088 |
-
) {
|
3089 |
-
// If a MIME type is not specified, try to work it out from the name
|
3090 |
-
if ($type == '' and !empty($name)) {
|
3091 |
-
$type = self::filenameToType($name);
|
3092 |
-
}
|
3093 |
-
|
3094 |
-
// Append to $attachment array
|
3095 |
-
$this->attachment[] = array(
|
3096 |
-
0 => $string,
|
3097 |
-
1 => $name,
|
3098 |
-
2 => $name,
|
3099 |
-
3 => $encoding,
|
3100 |
-
4 => $type,
|
3101 |
-
5 => true, // isStringAttachment
|
3102 |
-
6 => $disposition,
|
3103 |
-
7 => $cid
|
3104 |
-
);
|
3105 |
-
return true;
|
3106 |
-
}
|
3107 |
-
|
3108 |
-
/**
|
3109 |
-
* Check if an inline attachment is present.
|
3110 |
-
* @access public
|
3111 |
-
* @return boolean
|
3112 |
-
*/
|
3113 |
-
public function inlineImageExists()
|
3114 |
-
{
|
3115 |
-
foreach ($this->attachment as $attachment) {
|
3116 |
-
if ($attachment[6] == 'inline') {
|
3117 |
-
return true;
|
3118 |
-
}
|
3119 |
-
}
|
3120 |
-
return false;
|
3121 |
-
}
|
3122 |
-
|
3123 |
-
/**
|
3124 |
-
* Check if an attachment (non-inline) is present.
|
3125 |
-
* @return boolean
|
3126 |
-
*/
|
3127 |
-
public function attachmentExists()
|
3128 |
-
{
|
3129 |
-
foreach ($this->attachment as $attachment) {
|
3130 |
-
if ($attachment[6] == 'attachment') {
|
3131 |
-
return true;
|
3132 |
-
}
|
3133 |
-
}
|
3134 |
-
return false;
|
3135 |
-
}
|
3136 |
-
|
3137 |
-
/**
|
3138 |
-
* Check if this message has an alternative body set.
|
3139 |
-
* @return boolean
|
3140 |
-
*/
|
3141 |
-
public function alternativeExists()
|
3142 |
-
{
|
3143 |
-
return !empty($this->AltBody);
|
3144 |
-
}
|
3145 |
-
|
3146 |
-
/**
|
3147 |
-
* Clear queued addresses of given kind.
|
3148 |
-
* @access protected
|
3149 |
-
* @param string $kind 'to', 'cc', or 'bcc'
|
3150 |
-
* @return void
|
3151 |
-
*/
|
3152 |
-
public function clearQueuedAddresses($kind)
|
3153 |
-
{
|
3154 |
-
$RecipientsQueue = $this->RecipientsQueue;
|
3155 |
-
foreach ($RecipientsQueue as $address => $params) {
|
3156 |
-
if ($params[0] == $kind) {
|
3157 |
-
unset($this->RecipientsQueue[$address]);
|
3158 |
-
}
|
3159 |
-
}
|
3160 |
-
}
|
3161 |
-
|
3162 |
-
/**
|
3163 |
-
* Clear all To recipients.
|
3164 |
-
* @return void
|
3165 |
-
*/
|
3166 |
-
public function clearAddresses()
|
3167 |
-
{
|
3168 |
-
foreach ($this->to as $to) {
|
3169 |
-
unset($this->all_recipients[strtolower($to[0])]);
|
3170 |
-
}
|
3171 |
-
$this->to = array();
|
3172 |
-
$this->clearQueuedAddresses('to');
|
3173 |
-
}
|
3174 |
-
|
3175 |
-
/**
|
3176 |
-
* Clear all CC recipients.
|
3177 |
-
* @return void
|
3178 |
-
*/
|
3179 |
-
public function clearCCs()
|
3180 |
-
{
|
3181 |
-
foreach ($this->cc as $cc) {
|
3182 |
-
unset($this->all_recipients[strtolower($cc[0])]);
|
3183 |
-
}
|
3184 |
-
$this->cc = array();
|
3185 |
-
$this->clearQueuedAddresses('cc');
|
3186 |
-
}
|
3187 |
-
|
3188 |
-
/**
|
3189 |
-
* Clear all BCC recipients.
|
3190 |
-
* @return void
|
3191 |
-
*/
|
3192 |
-
public function clearBCCs()
|
3193 |
-
{
|
3194 |
-
foreach ($this->bcc as $bcc) {
|
3195 |
-
unset($this->all_recipients[strtolower($bcc[0])]);
|
3196 |
-
}
|
3197 |
-
$this->bcc = array();
|
3198 |
-
$this->clearQueuedAddresses('bcc');
|
3199 |
-
}
|
3200 |
-
|
3201 |
-
/**
|
3202 |
-
* Clear all ReplyTo recipients.
|
3203 |
-
* @return void
|
3204 |
-
*/
|
3205 |
-
public function clearReplyTos()
|
3206 |
-
{
|
3207 |
-
$this->ReplyTo = array();
|
3208 |
-
$this->ReplyToQueue = array();
|
3209 |
-
}
|
3210 |
-
|
3211 |
-
/**
|
3212 |
-
* Clear all recipient types.
|
3213 |
-
* @return void
|
3214 |
-
*/
|
3215 |
-
public function clearAllRecipients()
|
3216 |
-
{
|
3217 |
-
$this->to = array();
|
3218 |
-
$this->cc = array();
|
3219 |
-
$this->bcc = array();
|
3220 |
-
$this->all_recipients = array();
|
3221 |
-
$this->RecipientsQueue = array();
|
3222 |
-
}
|
3223 |
-
|
3224 |
-
/**
|
3225 |
-
* Clear all filesystem, string, and binary attachments.
|
3226 |
-
* @return void
|
3227 |
-
*/
|
3228 |
-
public function clearAttachments()
|
3229 |
-
{
|
3230 |
-
$this->attachment = array();
|
3231 |
-
}
|
3232 |
-
|
3233 |
-
/**
|
3234 |
-
* Clear all custom headers.
|
3235 |
-
* @return void
|
3236 |
-
*/
|
3237 |
-
public function clearCustomHeaders()
|
3238 |
-
{
|
3239 |
-
$this->CustomHeader = array();
|
3240 |
-
}
|
3241 |
-
|
3242 |
-
/**
|
3243 |
-
* Add an error message to the error container.
|
3244 |
-
* @access protected
|
3245 |
-
* @param string $msg
|
3246 |
-
* @return void
|
3247 |
-
*/
|
3248 |
-
protected function setError($msg)
|
3249 |
-
{
|
3250 |
-
$this->error_count++;
|
3251 |
-
if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {
|
3252 |
-
$lasterror = $this->smtp->getError();
|
3253 |
-
if (!empty($lasterror['error'])) {
|
3254 |
-
$msg .= $this->lang('smtp_error') . $lasterror['error'];
|
3255 |
-
if (!empty($lasterror['detail'])) {
|
3256 |
-
$msg .= ' Detail: '. $lasterror['detail'];
|
3257 |
-
}
|
3258 |
-
if (!empty($lasterror['smtp_code'])) {
|
3259 |
-
$msg .= ' SMTP code: ' . $lasterror['smtp_code'];
|
3260 |
-
}
|
3261 |
-
if (!empty($lasterror['smtp_code_ex'])) {
|
3262 |
-
$msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];
|
3263 |
-
}
|
3264 |
-
}
|
3265 |
-
}
|
3266 |
-
$this->ErrorInfo = $msg;
|
3267 |
-
}
|
3268 |
-
|
3269 |
-
/**
|
3270 |
-
* Return an RFC 822 formatted date.
|
3271 |
-
* @access public
|
3272 |
-
* @return string
|
3273 |
-
* @static
|
3274 |
-
*/
|
3275 |
-
public static function rfcDate()
|
3276 |
-
{
|
3277 |
-
// Set the time zone to whatever the default is to avoid 500 errors
|
3278 |
-
// Will default to UTC if it's not set properly in php.ini
|
3279 |
-
date_default_timezone_set(@date_default_timezone_get());
|
3280 |
-
return date('D, j M Y H:i:s O');
|
3281 |
-
}
|
3282 |
-
|
3283 |
-
/**
|
3284 |
-
* Get the server hostname.
|
3285 |
-
* Returns 'localhost.localdomain' if unknown.
|
3286 |
-
* @access protected
|
3287 |
-
* @return string
|
3288 |
-
*/
|
3289 |
-
protected function serverHostname()
|
3290 |
-
{
|
3291 |
-
$result = 'localhost.localdomain';
|
3292 |
-
if (!empty($this->Hostname)) {
|
3293 |
-
$result = $this->Hostname;
|
3294 |
-
} elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
|
3295 |
-
$result = $_SERVER['SERVER_NAME'];
|
3296 |
-
} elseif (function_exists('gethostname') && gethostname() !== false) {
|
3297 |
-
$result = gethostname();
|
3298 |
-
} elseif (php_uname('n') !== false) {
|
3299 |
-
$result = php_uname('n');
|
3300 |
-
}
|
3301 |
-
return $result;
|
3302 |
-
}
|
3303 |
-
|
3304 |
-
/**
|
3305 |
-
* Get an error message in the current language.
|
3306 |
-
* @access protected
|
3307 |
-
* @param string $key
|
3308 |
-
* @return string
|
3309 |
-
*/
|
3310 |
-
protected function lang($key)
|
3311 |
-
{
|
3312 |
-
if (count($this->language) < 1) {
|
3313 |
-
$this->setLanguage('en'); // set the default language
|
3314 |
-
}
|
3315 |
-
|
3316 |
-
if (array_key_exists($key, $this->language)) {
|
3317 |
-
if ($key == 'smtp_connect_failed') {
|
3318 |
-
//Include a link to troubleshooting docs on SMTP connection failure
|
3319 |
-
//this is by far the biggest cause of support questions
|
3320 |
-
//but it's usually not PHPMailer's fault.
|
3321 |
-
return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
|
3322 |
-
}
|
3323 |
-
return $this->language[$key];
|
3324 |
-
} else {
|
3325 |
-
//Return the key as a fallback
|
3326 |
-
return $key;
|
3327 |
-
}
|
3328 |
-
}
|
3329 |
-
|
3330 |
-
/**
|
3331 |
-
* Check if an error occurred.
|
3332 |
-
* @access public
|
3333 |
-
* @return boolean True if an error did occur.
|
3334 |
-
*/
|
3335 |
-
public function isError()
|
3336 |
-
{
|
3337 |
-
return ($this->error_count > 0);
|
3338 |
-
}
|
3339 |
-
|
3340 |
-
/**
|
3341 |
-
* Ensure consistent line endings in a string.
|
3342 |
-
* Changes every end of line from CRLF, CR or LF to $this->LE.
|
3343 |
-
* @access public
|
3344 |
-
* @param string $str String to fixEOL
|
3345 |
-
* @return string
|
3346 |
-
*/
|
3347 |
-
public function fixEOL($str)
|
3348 |
-
{
|
3349 |
-
// Normalise to \n
|
3350 |
-
$nstr = str_replace(array("\r\n", "\r"), "\n", $str);
|
3351 |
-
// Now convert LE as needed
|
3352 |
-
if ($this->LE !== "\n") {
|
3353 |
-
$nstr = str_replace("\n", $this->LE, $nstr);
|
3354 |
-
}
|
3355 |
-
return $nstr;
|
3356 |
-
}
|
3357 |
-
|
3358 |
-
/**
|
3359 |
-
* Add a custom header.
|
3360 |
-
* $name value can be overloaded to contain
|
3361 |
-
* both header name and value (name:value)
|
3362 |
-
* @access public
|
3363 |
-
* @param string $name Custom header name
|
3364 |
-
* @param string $value Header value
|
3365 |
-
* @return void
|
3366 |
-
*/
|
3367 |
-
public function addCustomHeader($name, $value = null)
|
3368 |
-
{
|
3369 |
-
if ($value === null) {
|
3370 |
-
// Value passed in as name:value
|
3371 |
-
$this->CustomHeader[] = explode(':', $name, 2);
|
3372 |
-
} else {
|
3373 |
-
$this->CustomHeader[] = array($name, $value);
|
3374 |
-
}
|
3375 |
-
}
|
3376 |
-
|
3377 |
-
/**
|
3378 |
-
* Returns all custom headers.
|
3379 |
-
* @return array
|
3380 |
-
*/
|
3381 |
-
public function getCustomHeaders()
|
3382 |
-
{
|
3383 |
-
return $this->CustomHeader;
|
3384 |
-
}
|
3385 |
-
|
3386 |
-
/**
|
3387 |
-
* Create a message body from an HTML string.
|
3388 |
-
* Automatically inlines images and creates a plain-text version by converting the HTML,
|
3389 |
-
* overwriting any existing values in Body and AltBody.
|
3390 |
-
* Do not source $message content from user input!
|
3391 |
-
* $basedir is prepended when handling relative URLs, e.g. <img src="/images/a.png"> and must not be empty
|
3392 |
-
* will look for an image file in $basedir/images/a.png and convert it to inline.
|
3393 |
-
* If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email)
|
3394 |
-
* If you don't want to apply these transformations to your HTML, just set Body and AltBody directly.
|
3395 |
-
* @access public
|
3396 |
-
* @param string $message HTML message string
|
3397 |
-
* @param string $basedir Absolute path to a base directory to prepend to relative paths to images
|
3398 |
-
* @param boolean|callable $advanced Whether to use the internal HTML to text converter
|
3399 |
-
* or your own custom converter @see PHPMailer::html2text()
|
3400 |
-
* @return string $message The transformed message Body
|
3401 |
-
*/
|
3402 |
-
public function msgHTML($message, $basedir = '', $advanced = false)
|
3403 |
-
{
|
3404 |
-
preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
|
3405 |
-
if (array_key_exists(2, $images)) {
|
3406 |
-
if (strlen($basedir) > 1 && substr($basedir, -1) != '/') {
|
3407 |
-
// Ensure $basedir has a trailing /
|
3408 |
-
$basedir .= '/';
|
3409 |
-
}
|
3410 |
-
foreach ($images[2] as $imgindex => $url) {
|
3411 |
-
// Convert data URIs into embedded images
|
3412 |
-
if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) {
|
3413 |
-
$data = substr($url, strpos($url, ','));
|
3414 |
-
if ($match[2]) {
|
3415 |
-
$data = base64_decode($data);
|
3416 |
-
} else {
|
3417 |
-
$data = rawurldecode($data);
|
3418 |
-
}
|
3419 |
-
$cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
|
3420 |
-
if ($this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1])) {
|
3421 |
-
$message = str_replace(
|
3422 |
-
$images[0][$imgindex],
|
3423 |
-
$images[1][$imgindex] . '="cid:' . $cid . '"',
|
3424 |
-
$message
|
3425 |
-
);
|
3426 |
-
}
|
3427 |
-
continue;
|
3428 |
-
}
|
3429 |
-
if (
|
3430 |
-
// Only process relative URLs if a basedir is provided (i.e. no absolute local paths)
|
3431 |
-
!empty($basedir)
|
3432 |
-
// Ignore URLs containing parent dir traversal (..)
|
3433 |
-
&& (strpos($url, '..') === false)
|
3434 |
-
// Do not change urls that are already inline images
|
3435 |
-
&& substr($url, 0, 4) !== 'cid:'
|
3436 |
-
// Do not change absolute URLs, including anonymous protocol
|
3437 |
-
&& !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url)
|
3438 |
-
) {
|
3439 |
-
$filename = basename($url);
|
3440 |
-
$directory = dirname($url);
|
3441 |
-
if ($directory == '.') {
|
3442 |
-
$directory = '';
|
3443 |
-
}
|
3444 |
-
$cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
|
3445 |
-
if (strlen($directory) > 1 && substr($directory, -1) != '/') {
|
3446 |
-
$directory .= '/';
|
3447 |
-
}
|
3448 |
-
if ($this->addEmbeddedImage(
|
3449 |
-
$basedir . $directory . $filename,
|
3450 |
-
$cid,
|
3451 |
-
$filename,
|
3452 |
-
'base64',
|
3453 |
-
self::_mime_types((string)self::mb_pathinfo($filename, PATHINFO_EXTENSION))
|
3454 |
-
)
|
3455 |
-
) {
|
3456 |
-
$message = preg_replace(
|
3457 |
-
'/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui',
|
3458 |
-
$images[1][$imgindex] . '="cid:' . $cid . '"',
|
3459 |
-
$message
|
3460 |
-
);
|
3461 |
-
}
|
3462 |
-
}
|
3463 |
-
}
|
3464 |
-
}
|
3465 |
-
$this->isHTML(true);
|
3466 |
-
// Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better
|
3467 |
-
$this->Body = $this->normalizeBreaks($message);
|
3468 |
-
$this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced));
|
3469 |
-
if (!$this->alternativeExists()) {
|
3470 |
-
$this->AltBody = 'To view this email message, open it in a program that understands HTML!' .
|
3471 |
-
self::CRLF . self::CRLF;
|
3472 |
-
}
|
3473 |
-
return $this->Body;
|
3474 |
-
}
|
3475 |
-
|
3476 |
-
/**
|
3477 |
-
* Convert an HTML string into plain text.
|
3478 |
-
* This is used by msgHTML().
|
3479 |
-
* Note - older versions of this function used a bundled advanced converter
|
3480 |
-
* which was been removed for license reasons in #232.
|
3481 |
-
* Example usage:
|
3482 |
-
* <code>
|
3483 |
-
* // Use default conversion
|
3484 |
-
* $plain = $mail->html2text($html);
|
3485 |
-
* // Use your own custom converter
|
3486 |
-
* $plain = $mail->html2text($html, function($html) {
|
3487 |
-
* $converter = new MyHtml2text($html);
|
3488 |
-
* return $converter->get_text();
|
3489 |
-
* });
|
3490 |
-
* </code>
|
3491 |
-
* @param string $html The HTML text to convert
|
3492 |
-
* @param boolean|callable $advanced Any boolean value to use the internal converter,
|
3493 |
-
* or provide your own callable for custom conversion.
|
3494 |
-
* @return string
|
3495 |
-
*/
|
3496 |
-
public function html2text($html, $advanced = false)
|
3497 |
-
{
|
3498 |
-
if (is_callable($advanced)) {
|
3499 |
-
return call_user_func($advanced, $html);
|
3500 |
-
}
|
3501 |
-
return html_entity_decode(
|
3502 |
-
trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))),
|
3503 |
-
ENT_QUOTES,
|
3504 |
-
$this->CharSet
|
3505 |
-
);
|
3506 |
-
}
|
3507 |
-
|
3508 |
-
/**
|
3509 |
-
* Get the MIME type for a file extension.
|
3510 |
-
* @param string $ext File extension
|
3511 |
-
* @access public
|
3512 |
-
* @return string MIME type of file.
|
3513 |
-
* @static
|
3514 |
-
*/
|
3515 |
-
public static function _mime_types($ext = '')
|
3516 |
-
{
|
3517 |
-
$mimes = array(
|
3518 |
-
'xl' => 'application/excel',
|
3519 |
-
'js' => 'application/javascript',
|
3520 |
-
'hqx' => 'application/mac-binhex40',
|
3521 |
-
'cpt' => 'application/mac-compactpro',
|
3522 |
-
'bin' => 'application/macbinary',
|
3523 |
-
'doc' => 'application/msword',
|
3524 |
-
'word' => 'application/msword',
|
3525 |
-
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
3526 |
-
'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
|
3527 |
-
'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
|
3528 |
-
'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
|
3529 |
-
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
3530 |
-
'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
|
3531 |
-
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
3532 |
-
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
|
3533 |
-
'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
|
3534 |
-
'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
|
3535 |
-
'class' => 'application/octet-stream',
|
3536 |
-
'dll' => 'application/octet-stream',
|
3537 |
-
'dms' => 'application/octet-stream',
|
3538 |
-
'exe' => 'application/octet-stream',
|
3539 |
-
'lha' => 'application/octet-stream',
|
3540 |
-
'lzh' => 'application/octet-stream',
|
3541 |
-
'psd' => 'application/octet-stream',
|
3542 |
-
'sea' => 'application/octet-stream',
|
3543 |
-
'so' => 'application/octet-stream',
|
3544 |
-
'oda' => 'application/oda',
|
3545 |
-
'pdf' => 'application/pdf',
|
3546 |
-
'ai' => 'application/postscript',
|
3547 |
-
'eps' => 'application/postscript',
|
3548 |
-
'ps' => 'application/postscript',
|
3549 |
-
'smi' => 'application/smil',
|
3550 |
-
'smil' => 'application/smil',
|
3551 |
-
'mif' => 'application/vnd.mif',
|
3552 |
-
'xls' => 'application/vnd.ms-excel',
|
3553 |
-
'ppt' => 'application/vnd.ms-powerpoint',
|
3554 |
-
'wbxml' => 'application/vnd.wap.wbxml',
|
3555 |
-
'wmlc' => 'application/vnd.wap.wmlc',
|
3556 |
-
'dcr' => 'application/x-director',
|
3557 |
-
'dir' => 'application/x-director',
|
3558 |
-
'dxr' => 'application/x-director',
|
3559 |
-
'dvi' => 'application/x-dvi',
|
3560 |
-
'gtar' => 'application/x-gtar',
|
3561 |
-
'php3' => 'application/x-httpd-php',
|
3562 |
-
'php4' => 'application/x-httpd-php',
|
3563 |
-
'php' => 'application/x-httpd-php',
|
3564 |
-
'phtml' => 'application/x-httpd-php',
|
3565 |
-
'phps' => 'application/x-httpd-php-source',
|
3566 |
-
'swf' => 'application/x-shockwave-flash',
|
3567 |
-
'sit' => 'application/x-stuffit',
|
3568 |
-
'tar' => 'application/x-tar',
|
3569 |
-
'tgz' => 'application/x-tar',
|
3570 |
-
'xht' => 'application/xhtml+xml',
|
3571 |
-
'xhtml' => 'application/xhtml+xml',
|
3572 |
-
'zip' => 'application/zip',
|
3573 |
-
'mid' => 'audio/midi',
|
3574 |
-
'midi' => 'audio/midi',
|
3575 |
-
'mp2' => 'audio/mpeg',
|
3576 |
-
'mp3' => 'audio/mpeg',
|
3577 |
-
'mpga' => 'audio/mpeg',
|
3578 |
-
'aif' => 'audio/x-aiff',
|
3579 |
-
'aifc' => 'audio/x-aiff',
|
3580 |
-
'aiff' => 'audio/x-aiff',
|
3581 |
-
'ram' => 'audio/x-pn-realaudio',
|
3582 |
-
'rm' => 'audio/x-pn-realaudio',
|
3583 |
-
'rpm' => 'audio/x-pn-realaudio-plugin',
|
3584 |
-
'ra' => 'audio/x-realaudio',
|
3585 |
-
'wav' => 'audio/x-wav',
|
3586 |
-
'bmp' => 'image/bmp',
|
3587 |
-
'gif' => 'image/gif',
|
3588 |
-
'jpeg' => 'image/jpeg',
|
3589 |
-
'jpe' => 'image/jpeg',
|
3590 |
-
'jpg' => 'image/jpeg',
|
3591 |
-
'png' => 'image/png',
|
3592 |
-
'tiff' => 'image/tiff',
|
3593 |
-
'tif' => 'image/tiff',
|
3594 |
-
'eml' => 'message/rfc822',
|
3595 |
-
'css' => 'text/css',
|
3596 |
-
'html' => 'text/html',
|
3597 |
-
'htm' => 'text/html',
|
3598 |
-
'shtml' => 'text/html',
|
3599 |
-
'log' => 'text/plain',
|
3600 |
-
'text' => 'text/plain',
|
3601 |
-
'txt' => 'text/plain',
|
3602 |
-
'rtx' => 'text/richtext',
|
3603 |
-
'rtf' => 'text/rtf',
|
3604 |
-
'vcf' => 'text/vcard',
|
3605 |
-
'vcard' => 'text/vcard',
|
3606 |
-
'xml' => 'text/xml',
|
3607 |
-
'xsl' => 'text/xml',
|
3608 |
-
'mpeg' => 'video/mpeg',
|
3609 |
-
'mpe' => 'video/mpeg',
|
3610 |
-
'mpg' => 'video/mpeg',
|
3611 |
-
'mov' => 'video/quicktime',
|
3612 |
-
'qt' => 'video/quicktime',
|
3613 |
-
'rv' => 'video/vnd.rn-realvideo',
|
3614 |
-
'avi' => 'video/x-msvideo',
|
3615 |
-
'movie' => 'video/x-sgi-movie'
|
3616 |
-
);
|
3617 |
-
if (array_key_exists(strtolower($ext), $mimes)) {
|
3618 |
-
return $mimes[strtolower($ext)];
|
3619 |
-
}
|
3620 |
-
return 'application/octet-stream';
|
3621 |
-
}
|
3622 |
-
|
3623 |
-
/**
|
3624 |
-
* Map a file name to a MIME type.
|
3625 |
-
* Defaults to 'application/octet-stream', i.e.. arbitrary binary data.
|
3626 |
-
* @param string $filename A file name or full path, does not need to exist as a file
|
3627 |
-
* @return string
|
3628 |
-
* @static
|
3629 |
-
*/
|
3630 |
-
public static function filenameToType($filename)
|
3631 |
-
{
|
3632 |
-
// In case the path is a URL, strip any query string before getting extension
|
3633 |
-
$qpos = strpos($filename, '?');
|
3634 |
-
if (false !== $qpos) {
|
3635 |
-
$filename = substr($filename, 0, $qpos);
|
3636 |
-
}
|
3637 |
-
$pathinfo = self::mb_pathinfo($filename);
|
3638 |
-
return self::_mime_types($pathinfo['extension']);
|
3639 |
-
}
|
3640 |
-
|
3641 |
-
/**
|
3642 |
-
* Multi-byte-safe pathinfo replacement.
|
3643 |
-
* Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe.
|
3644 |
-
* Works similarly to the one in PHP >= 5.2.0
|
3645 |
-
* @link http://www.php.net/manual/en/function.pathinfo.php#107461
|
3646 |
-
* @param string $path A filename or path, does not need to exist as a file
|
3647 |
-
* @param integer|string $options Either a PATHINFO_* constant,
|
3648 |
-
* or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2
|
3649 |
-
* @return string|array
|
3650 |
-
* @static
|
3651 |
-
*/
|
3652 |
-
public static function mb_pathinfo($path, $options = null)
|
3653 |
-
{
|
3654 |
-
$ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '');
|
3655 |
-
$pathinfo = array();
|
3656 |
-
if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) {
|
3657 |
-
if (array_key_exists(1, $pathinfo)) {
|
3658 |
-
$ret['dirname'] = $pathinfo[1];
|
3659 |
-
}
|
3660 |
-
if (array_key_exists(2, $pathinfo)) {
|
3661 |
-
$ret['basename'] = $pathinfo[2];
|
3662 |
-
}
|
3663 |
-
if (array_key_exists(5, $pathinfo)) {
|
3664 |
-
$ret['extension'] = $pathinfo[5];
|
3665 |
-
}
|
3666 |
-
if (array_key_exists(3, $pathinfo)) {
|
3667 |
-
$ret['filename'] = $pathinfo[3];
|
3668 |
-
}
|
3669 |
-
}
|
3670 |
-
switch ($options) {
|
3671 |
-
case PATHINFO_DIRNAME:
|
3672 |
-
case 'dirname':
|
3673 |
-
return $ret['dirname'];
|
3674 |
-
case PATHINFO_BASENAME:
|
3675 |
-
case 'basename':
|
3676 |
-
return $ret['basename'];
|
3677 |
-
case PATHINFO_EXTENSION:
|
3678 |
-
case 'extension':
|
3679 |
-
return $ret['extension'];
|
3680 |
-
case PATHINFO_FILENAME:
|
3681 |
-
case 'filename':
|
3682 |
-
return $ret['filename'];
|
3683 |
-
default:
|
3684 |
-
return $ret;
|
3685 |
-
}
|
3686 |
-
}
|
3687 |
-
|
3688 |
-
/**
|
3689 |
-
* Set or reset instance properties.
|
3690 |
-
* You should avoid this function - it's more verbose, less efficient, more error-prone and
|
3691 |
-
* harder to debug than setting properties directly.
|
3692 |
-
* Usage Example:
|
3693 |
-
* `$mail->set('SMTPSecure', 'tls');`
|
3694 |
-
* is the same as:
|
3695 |
-
* `$mail->SMTPSecure = 'tls';`
|
3696 |
-
* @access public
|
3697 |
-
* @param string $name The property name to set
|
3698 |
-
* @param mixed $value The value to set the property to
|
3699 |
-
* @return boolean
|
3700 |
-
* @TODO Should this not be using the __set() magic function?
|
3701 |
-
*/
|
3702 |
-
public function set($name, $value = '')
|
3703 |
-
{
|
3704 |
-
if (property_exists($this, $name)) {
|
3705 |
-
$this->$name = $value;
|
3706 |
-
return true;
|
3707 |
-
} else {
|
3708 |
-
$this->setError($this->lang('variable_set') . $name);
|
3709 |
-
return false;
|
3710 |
-
}
|
3711 |
-
}
|
3712 |
-
|
3713 |
-
/**
|
3714 |
-
* Strip newlines to prevent header injection.
|
3715 |
-
* @access public
|
3716 |
-
* @param string $str
|
3717 |
-
* @return string
|
3718 |
-
*/
|
3719 |
-
public function secureHeader($str)
|
3720 |
-
{
|
3721 |
-
return trim(str_replace(array("\r", "\n"), '', $str));
|
3722 |
-
}
|
3723 |
-
|
3724 |
-
/**
|
3725 |
-
* Normalize line breaks in a string.
|
3726 |
-
* Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format.
|
3727 |
-
* Defaults to CRLF (for message bodies) and preserves consecutive breaks.
|
3728 |
-
* @param string $text
|
3729 |
-
* @param string $breaktype What kind of line break to use, defaults to CRLF
|
3730 |
-
* @return string
|
3731 |
-
* @access public
|
3732 |
-
* @static
|
3733 |
-
*/
|
3734 |
-
public static function normalizeBreaks($text, $breaktype = "\r\n")
|
3735 |
-
{
|
3736 |
-
return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text);
|
3737 |
-
}
|
3738 |
-
|
3739 |
-
/**
|
3740 |
-
* Set the public and private key files and password for S/MIME signing.
|
3741 |
-
* @access public
|
3742 |
-
* @param string $cert_filename
|
3743 |
-
* @param string $key_filename
|
3744 |
-
* @param string $key_pass Password for private key
|
3745 |
-
* @param string $extracerts_filename Optional path to chain certificate
|
3746 |
-
*/
|
3747 |
-
public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '')
|
3748 |
-
{
|
3749 |
-
$this->sign_cert_file = $cert_filename;
|
3750 |
-
$this->sign_key_file = $key_filename;
|
3751 |
-
$this->sign_key_pass = $key_pass;
|
3752 |
-
$this->sign_extracerts_file = $extracerts_filename;
|
3753 |
-
}
|
3754 |
-
|
3755 |
-
/**
|
3756 |
-
* Quoted-Printable-encode a DKIM header.
|
3757 |
-
* @access public
|
3758 |
-
* @param string $txt
|
3759 |
-
* @return string
|
3760 |
-
*/
|
3761 |
-
public function DKIM_QP($txt)
|
3762 |
-
{
|
3763 |
-
$line = '';
|
3764 |
-
for ($i = 0; $i < strlen($txt); $i++) {
|
3765 |
-
$ord = ord($txt[$i]);
|
3766 |
-
if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) {
|
3767 |
-
$line .= $txt[$i];
|
3768 |
-
} else {
|
3769 |
-
$line .= '=' . sprintf('%02X', $ord);
|
3770 |
-
}
|
3771 |
-
}
|
3772 |
-
return $line;
|
3773 |
-
}
|
3774 |
-
|
3775 |
-
/**
|
3776 |
-
* Generate a DKIM signature.
|
3777 |
-
* @access public
|
3778 |
-
* @param string $signHeader
|
3779 |
-
* @throws phpmailerException
|
3780 |
-
* @return string The DKIM signature value
|
3781 |
-
*/
|
3782 |
-
public function DKIM_Sign($signHeader)
|
3783 |
-
{
|
3784 |
-
if (!defined('PKCS7_TEXT')) {
|
3785 |
-
if ($this->exceptions) {
|
3786 |
-
throw new phpmailerException($this->lang('extension_missing') . 'openssl');
|
3787 |
-
}
|
3788 |
-
return '';
|
3789 |
-
}
|
3790 |
-
$privKeyStr = !empty($this->DKIM_private_string) ? $this->DKIM_private_string : file_get_contents($this->DKIM_private);
|
3791 |
-
if ('' != $this->DKIM_passphrase) {
|
3792 |
-
$privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
|
3793 |
-
} else {
|
3794 |
-
$privKey = openssl_pkey_get_private($privKeyStr);
|
3795 |
-
}
|
3796 |
-
//Workaround for missing digest algorithms in old PHP & OpenSSL versions
|
3797 |
-
//@link http://stackoverflow.com/a/11117338/333340
|
3798 |
-
if (version_compare(PHP_VERSION, '5.3.0') >= 0 and
|
3799 |
-
in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) {
|
3800 |
-
if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
|
3801 |
-
openssl_pkey_free($privKey);
|
3802 |
-
return base64_encode($signature);
|
3803 |
-
}
|
3804 |
-
} else {
|
3805 |
-
$pinfo = openssl_pkey_get_details($privKey);
|
3806 |
-
$hash = hash('sha256', $signHeader);
|
3807 |
-
//'Magic' constant for SHA256 from RFC3447
|
3808 |
-
//@link https://tools.ietf.org/html/rfc3447#page-43
|
3809 |
-
$t = '3031300d060960864801650304020105000420' . $hash;
|
3810 |
-
$pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3);
|
3811 |
-
$eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t);
|
3812 |
-
|
3813 |
-
if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) {
|
3814 |
-
openssl_pkey_free($privKey);
|
3815 |
-
return base64_encode($signature);
|
3816 |
-
}
|
3817 |
-
}
|
3818 |
-
openssl_pkey_free($privKey);
|
3819 |
-
return '';
|
3820 |
-
}
|
3821 |
-
|
3822 |
-
/**
|
3823 |
-
* Generate a DKIM canonicalization header.
|
3824 |
-
* @access public
|
3825 |
-
* @param string $signHeader Header
|
3826 |
-
* @return string
|
3827 |
-
*/
|
3828 |
-
public function DKIM_HeaderC($signHeader)
|
3829 |
-
{
|
3830 |
-
$signHeader = preg_replace('/\r\n\s+/', ' ', $signHeader);
|
3831 |
-
$lines = explode("\r\n", $signHeader);
|
3832 |
-
foreach ($lines as $key => $line) {
|
3833 |
-
list($heading, $value) = explode(':', $line, 2);
|
3834 |
-
$heading = strtolower($heading);
|
3835 |
-
$value = preg_replace('/\s{2,}/', ' ', $value); // Compress useless spaces
|
3836 |
-
$lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value
|
3837 |
-
}
|
3838 |
-
$signHeader = implode("\r\n", $lines);
|
3839 |
-
return $signHeader;
|
3840 |
-
}
|
3841 |
-
|
3842 |
-
/**
|
3843 |
-
* Generate a DKIM canonicalization body.
|
3844 |
-
* @access public
|
3845 |
-
* @param string $body Message Body
|
3846 |
-
* @return string
|
3847 |
-
*/
|
3848 |
-
public function DKIM_BodyC($body)
|
3849 |
-
{
|
3850 |
-
if ($body == '') {
|
3851 |
-
return "\r\n";
|
3852 |
-
}
|
3853 |
-
// stabilize line endings
|
3854 |
-
$body = str_replace("\r\n", "\n", $body);
|
3855 |
-
$body = str_replace("\n", "\r\n", $body);
|
3856 |
-
// END stabilize line endings
|
3857 |
-
while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") {
|
3858 |
-
$body = substr($body, 0, strlen($body) - 2);
|
3859 |
-
}
|
3860 |
-
return $body;
|
3861 |
-
}
|
3862 |
-
|
3863 |
-
/**
|
3864 |
-
* Create the DKIM header and body in a new message header.
|
3865 |
-
* @access public
|
3866 |
-
* @param string $headers_line Header lines
|
3867 |
-
* @param string $subject Subject
|
3868 |
-
* @param string $body Body
|
3869 |
-
* @return string
|
3870 |
-
*/
|
3871 |
-
public function DKIM_Add($headers_line, $subject, $body)
|
3872 |
-
{
|
3873 |
-
$DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms
|
3874 |
-
$DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
|
3875 |
-
$DKIMquery = 'dns/txt'; // Query method
|
3876 |
-
$DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone)
|
3877 |
-
$subject_header = "Subject: $subject";
|
3878 |
-
$headers = explode($this->LE, $headers_line);
|
3879 |
-
$from_header = '';
|
3880 |
-
$to_header = '';
|
3881 |
-
$date_header = '';
|
3882 |
-
$current = '';
|
3883 |
-
foreach ($headers as $header) {
|
3884 |
-
if (strpos($header, 'From:') === 0) {
|
3885 |
-
$from_header = $header;
|
3886 |
-
$current = 'from_header';
|
3887 |
-
} elseif (strpos($header, 'To:') === 0) {
|
3888 |
-
$to_header = $header;
|
3889 |
-
$current = 'to_header';
|
3890 |
-
} elseif (strpos($header, 'Date:') === 0) {
|
3891 |
-
$date_header = $header;
|
3892 |
-
$current = 'date_header';
|
3893 |
-
} else {
|
3894 |
-
if (!empty($$current) && strpos($header, ' =?') === 0) {
|
3895 |
-
$$current .= $header;
|
3896 |
-
} else {
|
3897 |
-
$current = '';
|
3898 |
-
}
|
3899 |
-
}
|
3900 |
-
}
|
3901 |
-
$from = str_replace('|', '=7C', $this->DKIM_QP($from_header));
|
3902 |
-
$to = str_replace('|', '=7C', $this->DKIM_QP($to_header));
|
3903 |
-
$date = str_replace('|', '=7C', $this->DKIM_QP($date_header));
|
3904 |
-
$subject = str_replace(
|
3905 |
-
'|',
|
3906 |
-
'=7C',
|
3907 |
-
$this->DKIM_QP($subject_header)
|
3908 |
-
); // Copied header fields (dkim-quoted-printable)
|
3909 |
-
$body = $this->DKIM_BodyC($body);
|
3910 |
-
$DKIMlen = strlen($body); // Length of body
|
3911 |
-
$DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body
|
3912 |
-
if ('' == $this->DKIM_identity) {
|
3913 |
-
$ident = '';
|
3914 |
-
} else {
|
3915 |
-
$ident = ' i=' . $this->DKIM_identity . ';';
|
3916 |
-
}
|
3917 |
-
$dkimhdrs = 'DKIM-Signature: v=1; a=' .
|
3918 |
-
$DKIMsignatureType . '; q=' .
|
3919 |
-
$DKIMquery . '; l=' .
|
3920 |
-
$DKIMlen . '; s=' .
|
3921 |
-
$this->DKIM_selector .
|
3922 |
-
";\r\n" .
|
3923 |
-
"\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" .
|
3924 |
-
"\th=From:To:Date:Subject;\r\n" .
|
3925 |
-
"\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" .
|
3926 |
-
"\tz=$from\r\n" .
|
3927 |
-
"\t|$to\r\n" .
|
3928 |
-
"\t|$date\r\n" .
|
3929 |
-
"\t|$subject;\r\n" .
|
3930 |
-
"\tbh=" . $DKIMb64 . ";\r\n" .
|
3931 |
-
"\tb=";
|
3932 |
-
$toSign = $this->DKIM_HeaderC(
|
3933 |
-
$from_header . "\r\n" .
|
3934 |
-
$to_header . "\r\n" .
|
3935 |
-
$date_header . "\r\n" .
|
3936 |
-
$subject_header . "\r\n" .
|
3937 |
-
$dkimhdrs
|
3938 |
-
);
|
3939 |
-
$signed = $this->DKIM_Sign($toSign);
|
3940 |
-
return $dkimhdrs . $signed . "\r\n";
|
3941 |
-
}
|
3942 |
-
|
3943 |
-
/**
|
3944 |
-
* Detect if a string contains a line longer than the maximum line length allowed.
|
3945 |
-
* @param string $str
|
3946 |
-
* @return boolean
|
3947 |
-
* @static
|
3948 |
-
*/
|
3949 |
-
public static function hasLineLongerThanMax($str)
|
3950 |
-
{
|
3951 |
-
//+2 to include CRLF line break for a 1000 total
|
3952 |
-
return (boolean)preg_match('/^(.{'.(self::MAX_LINE_LENGTH + 2).',})/m', $str);
|
3953 |
-
}
|
3954 |
-
|
3955 |
-
/**
|
3956 |
-
* Allows for public read access to 'to' property.
|
3957 |
-
* @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
|
3958 |
-
* @access public
|
3959 |
-
* @return array
|
3960 |
-
*/
|
3961 |
-
public function getToAddresses()
|
3962 |
-
{
|
3963 |
-
return $this->to;
|
3964 |
-
}
|
3965 |
-
|
3966 |
-
/**
|
3967 |
-
* Allows for public read access to 'cc' property.
|
3968 |
-
* @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
|
3969 |
-
* @access public
|
3970 |
-
* @return array
|
3971 |
-
*/
|
3972 |
-
public function getCcAddresses()
|
3973 |
-
{
|
3974 |
-
return $this->cc;
|
3975 |
-
}
|
3976 |
-
|
3977 |
-
/**
|
3978 |
-
* Allows for public read access to 'bcc' property.
|
3979 |
-
* @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
|
3980 |
-
* @access public
|
3981 |
-
* @return array
|
3982 |
-
*/
|
3983 |
-
public function getBccAddresses()
|
3984 |
-
{
|
3985 |
-
return $this->bcc;
|
3986 |
-
}
|
3987 |
-
|
3988 |
-
/**
|
3989 |
-
* Allows for public read access to 'ReplyTo' property.
|
3990 |
-
* @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
|
3991 |
-
* @access public
|
3992 |
-
* @return array
|
3993 |
-
*/
|
3994 |
-
public function getReplyToAddresses()
|
3995 |
-
{
|
3996 |
-
return $this->ReplyTo;
|
3997 |
-
}
|
3998 |
-
|
3999 |
-
/**
|
4000 |
-
* Allows for public read access to 'all_recipients' property.
|
4001 |
-
* @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
|
4002 |
-
* @access public
|
4003 |
-
* @return array
|
4004 |
-
*/
|
4005 |
-
public function getAllRecipientAddresses()
|
4006 |
-
{
|
4007 |
-
return $this->all_recipients;
|
4008 |
-
}
|
4009 |
-
|
4010 |
-
/**
|
4011 |
-
* Perform a callback.
|
4012 |
-
* @param boolean $isSent
|
4013 |
-
* @param array $to
|
4014 |
-
* @param array $cc
|
4015 |
-
* @param array $bcc
|
4016 |
-
* @param string $subject
|
4017 |
-
* @param string $body
|
4018 |
-
* @param string $from
|
4019 |
-
*/
|
4020 |
-
protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from)
|
4021 |
-
{
|
4022 |
-
if (!empty($this->action_function) && is_callable($this->action_function)) {
|
4023 |
-
$params = array($isSent, $to, $cc, $bcc, $subject, $body, $from);
|
4024 |
-
call_user_func_array($this->action_function, $params);
|
4025 |
-
}
|
4026 |
-
}
|
4027 |
-
}
|
4028 |
-
|
4029 |
-
/**
|
4030 |
-
* PHPMailer exception handler
|
4031 |
-
* @package PHPMailer
|
4032 |
-
*/
|
4033 |
-
class phpmailerException extends Exception
|
4034 |
-
{
|
4035 |
-
/**
|
4036 |
-
* Prettify error message output
|
4037 |
-
* @return string
|
4038 |
-
*/
|
4039 |
-
public function errorMessage()
|
4040 |
-
{
|
4041 |
-
$errorMsg = '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n";
|
4042 |
-
return $errorMsg;
|
4043 |
-
}
|
4044 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/class.phpmaileroauth.php
DELETED
@@ -1,197 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PHPMailer - PHP email creation and transport class.
|
4 |
-
* PHP Version 5.4
|
5 |
-
* @package PHPMailer
|
6 |
-
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
7 |
-
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
8 |
-
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
9 |
-
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
10 |
-
* @author Brent R. Matzelle (original founder)
|
11 |
-
* @copyright 2012 - 2014 Marcus Bointon
|
12 |
-
* @copyright 2010 - 2012 Jim Jagielski
|
13 |
-
* @copyright 2004 - 2009 Andy Prevost
|
14 |
-
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
15 |
-
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
16 |
-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE.
|
18 |
-
*/
|
19 |
-
|
20 |
-
/**
|
21 |
-
* PHPMailerOAuth - PHPMailer subclass adding OAuth support.
|
22 |
-
* @package PHPMailer
|
23 |
-
* @author @sherryl4george
|
24 |
-
* @author Marcus Bointon (@Synchro) <phpmailer@synchromedia.co.uk>
|
25 |
-
*/
|
26 |
-
class PHPMailerOAuth extends PHPMailer
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* The OAuth user's email address
|
30 |
-
* @var string
|
31 |
-
*/
|
32 |
-
public $oauthUserEmail = '';
|
33 |
-
|
34 |
-
/**
|
35 |
-
* The OAuth refresh token
|
36 |
-
* @var string
|
37 |
-
*/
|
38 |
-
public $oauthRefreshToken = '';
|
39 |
-
|
40 |
-
/**
|
41 |
-
* The OAuth client ID
|
42 |
-
* @var string
|
43 |
-
*/
|
44 |
-
public $oauthClientId = '';
|
45 |
-
|
46 |
-
/**
|
47 |
-
* The OAuth client secret
|
48 |
-
* @var string
|
49 |
-
*/
|
50 |
-
public $oauthClientSecret = '';
|
51 |
-
|
52 |
-
/**
|
53 |
-
* An instance of the PHPMailerOAuthGoogle class.
|
54 |
-
* @var PHPMailerOAuthGoogle
|
55 |
-
* @access protected
|
56 |
-
*/
|
57 |
-
protected $oauth = null;
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Get a PHPMailerOAuthGoogle instance to use.
|
61 |
-
* @return PHPMailerOAuthGoogle
|
62 |
-
*/
|
63 |
-
public function getOAUTHInstance()
|
64 |
-
{
|
65 |
-
if (!is_object($this->oauth)) {
|
66 |
-
$this->oauth = new PHPMailerOAuthGoogle(
|
67 |
-
$this->oauthUserEmail,
|
68 |
-
$this->oauthClientSecret,
|
69 |
-
$this->oauthClientId,
|
70 |
-
$this->oauthRefreshToken
|
71 |
-
);
|
72 |
-
}
|
73 |
-
return $this->oauth;
|
74 |
-
}
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Initiate a connection to an SMTP server.
|
78 |
-
* Overrides the original smtpConnect method to add support for OAuth.
|
79 |
-
* @param array $options An array of options compatible with stream_context_create()
|
80 |
-
* @uses SMTP
|
81 |
-
* @access public
|
82 |
-
* @return bool
|
83 |
-
* @throws phpmailerException
|
84 |
-
*/
|
85 |
-
public function smtpConnect($options = array())
|
86 |
-
{
|
87 |
-
if (is_null($this->smtp)) {
|
88 |
-
$this->smtp = $this->getSMTPInstance();
|
89 |
-
}
|
90 |
-
|
91 |
-
if (is_null($this->oauth)) {
|
92 |
-
$this->oauth = $this->getOAUTHInstance();
|
93 |
-
}
|
94 |
-
|
95 |
-
// Already connected?
|
96 |
-
if ($this->smtp->connected()) {
|
97 |
-
return true;
|
98 |
-
}
|
99 |
-
|
100 |
-
$this->smtp->setTimeout($this->Timeout);
|
101 |
-
$this->smtp->setDebugLevel($this->SMTPDebug);
|
102 |
-
$this->smtp->setDebugOutput($this->Debugoutput);
|
103 |
-
$this->smtp->setVerp($this->do_verp);
|
104 |
-
$hosts = explode(';', $this->Host);
|
105 |
-
$lastexception = null;
|
106 |
-
|
107 |
-
foreach ($hosts as $hostentry) {
|
108 |
-
$hostinfo = array();
|
109 |
-
if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) {
|
110 |
-
// Not a valid host entry
|
111 |
-
continue;
|
112 |
-
}
|
113 |
-
// $hostinfo[2]: optional ssl or tls prefix
|
114 |
-
// $hostinfo[3]: the hostname
|
115 |
-
// $hostinfo[4]: optional port number
|
116 |
-
// The host string prefix can temporarily override the current setting for SMTPSecure
|
117 |
-
// If it's not specified, the default value is used
|
118 |
-
$prefix = '';
|
119 |
-
$secure = $this->SMTPSecure;
|
120 |
-
$tls = ($this->SMTPSecure == 'tls');
|
121 |
-
if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
|
122 |
-
$prefix = 'ssl://';
|
123 |
-
$tls = false; // Can't have SSL and TLS at the same time
|
124 |
-
$secure = 'ssl';
|
125 |
-
} elseif ($hostinfo[2] == 'tls') {
|
126 |
-
$tls = true;
|
127 |
-
// tls doesn't use a prefix
|
128 |
-
$secure = 'tls';
|
129 |
-
}
|
130 |
-
//Do we need the OpenSSL extension?
|
131 |
-
$sslext = defined('OPENSSL_ALGO_SHA1');
|
132 |
-
if ('tls' === $secure or 'ssl' === $secure) {
|
133 |
-
//Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
|
134 |
-
if (!$sslext) {
|
135 |
-
throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL);
|
136 |
-
}
|
137 |
-
}
|
138 |
-
$host = $hostinfo[3];
|
139 |
-
$port = $this->Port;
|
140 |
-
$tport = (integer)$hostinfo[4];
|
141 |
-
if ($tport > 0 and $tport < 65536) {
|
142 |
-
$port = $tport;
|
143 |
-
}
|
144 |
-
if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
|
145 |
-
try {
|
146 |
-
if ($this->Helo) {
|
147 |
-
$hello = $this->Helo;
|
148 |
-
} else {
|
149 |
-
$hello = $this->serverHostname();
|
150 |
-
}
|
151 |
-
$this->smtp->hello($hello);
|
152 |
-
//Automatically enable TLS encryption if:
|
153 |
-
// * it's not disabled
|
154 |
-
// * we have openssl extension
|
155 |
-
// * we are not already using SSL
|
156 |
-
// * the server offers STARTTLS
|
157 |
-
if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) {
|
158 |
-
$tls = true;
|
159 |
-
}
|
160 |
-
if ($tls) {
|
161 |
-
if (!$this->smtp->startTLS()) {
|
162 |
-
throw new phpmailerException($this->lang('connect_host'));
|
163 |
-
}
|
164 |
-
// We must resend HELO after tls negotiation
|
165 |
-
$this->smtp->hello($hello);
|
166 |
-
}
|
167 |
-
if ($this->SMTPAuth) {
|
168 |
-
if (!$this->smtp->authenticate(
|
169 |
-
$this->Username,
|
170 |
-
$this->Password,
|
171 |
-
$this->AuthType,
|
172 |
-
$this->Realm,
|
173 |
-
$this->Workstation,
|
174 |
-
$this->oauth
|
175 |
-
)
|
176 |
-
) {
|
177 |
-
throw new phpmailerException($this->lang('authenticate'));
|
178 |
-
}
|
179 |
-
}
|
180 |
-
return true;
|
181 |
-
} catch (phpmailerException $exc) {
|
182 |
-
$lastexception = $exc;
|
183 |
-
$this->edebug($exc->getMessage());
|
184 |
-
// We must have connected, but then failed TLS or Auth, so close connection nicely
|
185 |
-
$this->smtp->quit();
|
186 |
-
}
|
187 |
-
}
|
188 |
-
}
|
189 |
-
// If we get here, all connection attempts have failed, so close connection hard
|
190 |
-
$this->smtp->close();
|
191 |
-
// As we've caught all exceptions, just report whatever the last one was
|
192 |
-
if ($this->exceptions and !is_null($lastexception)) {
|
193 |
-
throw $lastexception;
|
194 |
-
}
|
195 |
-
return false;
|
196 |
-
}
|
197 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/class.phpmaileroauthgoogle.php
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PHPMailer - PHP email creation and transport class.
|
4 |
-
* PHP Version 5.4
|
5 |
-
* @package PHPMailer
|
6 |
-
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
7 |
-
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
8 |
-
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
9 |
-
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
10 |
-
* @author Brent R. Matzelle (original founder)
|
11 |
-
* @copyright 2012 - 2014 Marcus Bointon
|
12 |
-
* @copyright 2010 - 2012 Jim Jagielski
|
13 |
-
* @copyright 2004 - 2009 Andy Prevost
|
14 |
-
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
15 |
-
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
16 |
-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE.
|
18 |
-
*/
|
19 |
-
|
20 |
-
/**
|
21 |
-
* PHPMailerOAuthGoogle - Wrapper for League OAuth2 Google provider.
|
22 |
-
* @package PHPMailer
|
23 |
-
* @author @sherryl4george
|
24 |
-
* @author Marcus Bointon (@Synchro) <phpmailer@synchromedia.co.uk>
|
25 |
-
* @link https://github.com/thephpleague/oauth2-client
|
26 |
-
*/
|
27 |
-
class PHPMailerOAuthGoogle
|
28 |
-
{
|
29 |
-
private $oauthUserEmail = '';
|
30 |
-
private $oauthRefreshToken = '';
|
31 |
-
private $oauthClientId = '';
|
32 |
-
private $oauthClientSecret = '';
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @param string $UserEmail
|
36 |
-
* @param string $ClientSecret
|
37 |
-
* @param string $ClientId
|
38 |
-
* @param string $RefreshToken
|
39 |
-
*/
|
40 |
-
public function __construct(
|
41 |
-
$UserEmail,
|
42 |
-
$ClientSecret,
|
43 |
-
$ClientId,
|
44 |
-
$RefreshToken
|
45 |
-
) {
|
46 |
-
$this->oauthClientId = $ClientId;
|
47 |
-
$this->oauthClientSecret = $ClientSecret;
|
48 |
-
$this->oauthRefreshToken = $RefreshToken;
|
49 |
-
$this->oauthUserEmail = $UserEmail;
|
50 |
-
}
|
51 |
-
|
52 |
-
private function getProvider()
|
53 |
-
{
|
54 |
-
return new League\OAuth2\Client\Provider\Google([
|
55 |
-
'clientId' => $this->oauthClientId,
|
56 |
-
'clientSecret' => $this->oauthClientSecret
|
57 |
-
]);
|
58 |
-
}
|
59 |
-
|
60 |
-
private function getGrant()
|
61 |
-
{
|
62 |
-
return new \League\OAuth2\Client\Grant\RefreshToken();
|
63 |
-
}
|
64 |
-
|
65 |
-
private function getToken()
|
66 |
-
{
|
67 |
-
$provider = $this->getProvider();
|
68 |
-
$grant = $this->getGrant();
|
69 |
-
return $provider->getAccessToken($grant, ['refresh_token' => $this->oauthRefreshToken]);
|
70 |
-
}
|
71 |
-
|
72 |
-
public function getOauth64()
|
73 |
-
{
|
74 |
-
$token = $this->getToken();
|
75 |
-
return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001");
|
76 |
-
}
|
77 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/class.pop3.php
DELETED
@@ -1,407 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PHPMailer POP-Before-SMTP Authentication Class.
|
4 |
-
* PHP Version 5
|
5 |
-
* @package PHPMailer
|
6 |
-
* @link https://github.com/PHPMailer/PHPMailer/
|
7 |
-
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
8 |
-
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
9 |
-
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
10 |
-
* @author Brent R. Matzelle (original founder)
|
11 |
-
* @copyright 2012 - 2014 Marcus Bointon
|
12 |
-
* @copyright 2010 - 2012 Jim Jagielski
|
13 |
-
* @copyright 2004 - 2009 Andy Prevost
|
14 |
-
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
15 |
-
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
16 |
-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE.
|
18 |
-
*/
|
19 |
-
|
20 |
-
/**
|
21 |
-
* PHPMailer POP-Before-SMTP Authentication Class.
|
22 |
-
* Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
|
23 |
-
* Does not support APOP.
|
24 |
-
* @package PHPMailer
|
25 |
-
* @author Richard Davey (original author) <rich@corephp.co.uk>
|
26 |
-
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
27 |
-
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
28 |
-
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
29 |
-
*/
|
30 |
-
class POP3
|
31 |
-
{
|
32 |
-
/**
|
33 |
-
* The POP3 PHPMailer Version number.
|
34 |
-
* @var string
|
35 |
-
* @access public
|
36 |
-
*/
|
37 |
-
public $Version = '5.2.26';
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Default POP3 port number.
|
41 |
-
* @var integer
|
42 |
-
* @access public
|
43 |
-
*/
|
44 |
-
public $POP3_PORT = 110;
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Default timeout in seconds.
|
48 |
-
* @var integer
|
49 |
-
* @access public
|
50 |
-
*/
|
51 |
-
public $POP3_TIMEOUT = 30;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* POP3 Carriage Return + Line Feed.
|
55 |
-
* @var string
|
56 |
-
* @access public
|
57 |
-
* @deprecated Use the constant instead
|
58 |
-
*/
|
59 |
-
public $CRLF = "\r\n";
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Debug display level.
|
63 |
-
* Options: 0 = no, 1+ = yes
|
64 |
-
* @var integer
|
65 |
-
* @access public
|
66 |
-
*/
|
67 |
-
public $do_debug = 0;
|
68 |
-
|
69 |
-
/**
|
70 |
-
* POP3 mail server hostname.
|
71 |
-
* @var string
|
72 |
-
* @access public
|
73 |
-
*/
|
74 |
-
public $host;
|
75 |
-
|
76 |
-
/**
|
77 |
-
* POP3 port number.
|
78 |
-
* @var integer
|
79 |
-
* @access public
|
80 |
-
*/
|
81 |
-
public $port;
|
82 |
-
|
83 |
-
/**
|
84 |
-
* POP3 Timeout Value in seconds.
|
85 |
-
* @var integer
|
86 |
-
* @access public
|
87 |
-
*/
|
88 |
-
public $tval;
|
89 |
-
|
90 |
-
/**
|
91 |
-
* POP3 username
|
92 |
-
* @var string
|
93 |
-
* @access public
|
94 |
-
*/
|
95 |
-
public $username;
|
96 |
-
|
97 |
-
/**
|
98 |
-
* POP3 password.
|
99 |
-
* @var string
|
100 |
-
* @access public
|
101 |
-
*/
|
102 |
-
public $password;
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Resource handle for the POP3 connection socket.
|
106 |
-
* @var resource
|
107 |
-
* @access protected
|
108 |
-
*/
|
109 |
-
protected $pop_conn;
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Are we connected?
|
113 |
-
* @var boolean
|
114 |
-
* @access protected
|
115 |
-
*/
|
116 |
-
protected $connected = false;
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Error container.
|
120 |
-
* @var array
|
121 |
-
* @access protected
|
122 |
-
*/
|
123 |
-
protected $errors = array();
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Line break constant
|
127 |
-
*/
|
128 |
-
const CRLF = "\r\n";
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Simple static wrapper for all-in-one POP before SMTP
|
132 |
-
* @param $host
|
133 |
-
* @param integer|boolean $port The port number to connect to
|
134 |
-
* @param integer|boolean $timeout The timeout value
|
135 |
-
* @param string $username
|
136 |
-
* @param string $password
|
137 |
-
* @param integer $debug_level
|
138 |
-
* @return boolean
|
139 |
-
*/
|
140 |
-
public static function popBeforeSmtp(
|
141 |
-
$host,
|
142 |
-
$port = false,
|
143 |
-
$timeout = false,
|
144 |
-
$username = '',
|
145 |
-
$password = '',
|
146 |
-
$debug_level = 0
|
147 |
-
) {
|
148 |
-
$pop = new POP3;
|
149 |
-
return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
|
150 |
-
}
|
151 |
-
|
152 |
-
/**
|
153 |
-
* Authenticate with a POP3 server.
|
154 |
-
* A connect, login, disconnect sequence
|
155 |
-
* appropriate for POP-before SMTP authorisation.
|
156 |
-
* @access public
|
157 |
-
* @param string $host The hostname to connect to
|
158 |
-
* @param integer|boolean $port The port number to connect to
|
159 |
-
* @param integer|boolean $timeout The timeout value
|
160 |
-
* @param string $username
|
161 |
-
* @param string $password
|
162 |
-
* @param integer $debug_level
|
163 |
-
* @return boolean
|
164 |
-
*/
|
165 |
-
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
|
166 |
-
{
|
167 |
-
$this->host = $host;
|
168 |
-
// If no port value provided, use default
|
169 |
-
if (false === $port) {
|
170 |
-
$this->port = $this->POP3_PORT;
|
171 |
-
} else {
|
172 |
-
$this->port = (integer)$port;
|
173 |
-
}
|
174 |
-
// If no timeout value provided, use default
|
175 |
-
if (false === $timeout) {
|
176 |
-
$this->tval = $this->POP3_TIMEOUT;
|
177 |
-
} else {
|
178 |
-
$this->tval = (integer)$timeout;
|
179 |
-
}
|
180 |
-
$this->do_debug = $debug_level;
|
181 |
-
$this->username = $username;
|
182 |
-
$this->password = $password;
|
183 |
-
// Reset the error log
|
184 |
-
$this->errors = array();
|
185 |
-
// connect
|
186 |
-
$result = $this->connect($this->host, $this->port, $this->tval);
|
187 |
-
if ($result) {
|
188 |
-
$login_result = $this->login($this->username, $this->password);
|
189 |
-
if ($login_result) {
|
190 |
-
$this->disconnect();
|
191 |
-
return true;
|
192 |
-
}
|
193 |
-
}
|
194 |
-
// We need to disconnect regardless of whether the login succeeded
|
195 |
-
$this->disconnect();
|
196 |
-
return false;
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* Connect to a POP3 server.
|
201 |
-
* @access public
|
202 |
-
* @param string $host
|
203 |
-
* @param integer|boolean $port
|
204 |
-
* @param integer $tval
|
205 |
-
* @return boolean
|
206 |
-
*/
|
207 |
-
public function connect($host, $port = false, $tval = 30)
|
208 |
-
{
|
209 |
-
// Are we already connected?
|
210 |
-
if ($this->connected) {
|
211 |
-
return true;
|
212 |
-
}
|
213 |
-
|
214 |
-
//On Windows this will raise a PHP Warning error if the hostname doesn't exist.
|
215 |
-
//Rather than suppress it with @fsockopen, capture it cleanly instead
|
216 |
-
set_error_handler(array($this, 'catchWarning'));
|
217 |
-
|
218 |
-
if (false === $port) {
|
219 |
-
$port = $this->POP3_PORT;
|
220 |
-
}
|
221 |
-
|
222 |
-
// connect to the POP3 server
|
223 |
-
$this->pop_conn = fsockopen(
|
224 |
-
$host, // POP3 Host
|
225 |
-
$port, // Port #
|
226 |
-
$errno, // Error Number
|
227 |
-
$errstr, // Error Message
|
228 |
-
$tval
|
229 |
-
); // Timeout (seconds)
|
230 |
-
// Restore the error handler
|
231 |
-
restore_error_handler();
|
232 |
-
|
233 |
-
// Did we connect?
|
234 |
-
if (false === $this->pop_conn) {
|
235 |
-
// It would appear not...
|
236 |
-
$this->setError(array(
|
237 |
-
'error' => "Failed to connect to server $host on port $port",
|
238 |
-
'errno' => $errno,
|
239 |
-
'errstr' => $errstr
|
240 |
-
));
|
241 |
-
return false;
|
242 |
-
}
|
243 |
-
|
244 |
-
// Increase the stream time-out
|
245 |
-
stream_set_timeout($this->pop_conn, $tval, 0);
|
246 |
-
|
247 |
-
// Get the POP3 server response
|
248 |
-
$pop3_response = $this->getResponse();
|
249 |
-
// Check for the +OK
|
250 |
-
if ($this->checkResponse($pop3_response)) {
|
251 |
-
// The connection is established and the POP3 server is talking
|
252 |
-
$this->connected = true;
|
253 |
-
return true;
|
254 |
-
}
|
255 |
-
return false;
|
256 |
-
}
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Log in to the POP3 server.
|
260 |
-
* Does not support APOP (RFC 2828, 4949).
|
261 |
-
* @access public
|
262 |
-
* @param string $username
|
263 |
-
* @param string $password
|
264 |
-
* @return boolean
|
265 |
-
*/
|
266 |
-
public function login($username = '', $password = '')
|
267 |
-
{
|
268 |
-
if (!$this->connected) {
|
269 |
-
$this->setError('Not connected to POP3 server');
|
270 |
-
}
|
271 |
-
if (empty($username)) {
|
272 |
-
$username = $this->username;
|
273 |
-
}
|
274 |
-
if (empty($password)) {
|
275 |
-
$password = $this->password;
|
276 |
-
}
|
277 |
-
|
278 |
-
// Send the Username
|
279 |
-
$this->sendString("USER $username" . self::CRLF);
|
280 |
-
$pop3_response = $this->getResponse();
|
281 |
-
if ($this->checkResponse($pop3_response)) {
|
282 |
-
// Send the Password
|
283 |
-
$this->sendString("PASS $password" . self::CRLF);
|
284 |
-
$pop3_response = $this->getResponse();
|
285 |
-
if ($this->checkResponse($pop3_response)) {
|
286 |
-
return true;
|
287 |
-
}
|
288 |
-
}
|
289 |
-
return false;
|
290 |
-
}
|
291 |
-
|
292 |
-
/**
|
293 |
-
* Disconnect from the POP3 server.
|
294 |
-
* @access public
|
295 |
-
*/
|
296 |
-
public function disconnect()
|
297 |
-
{
|
298 |
-
$this->sendString('QUIT');
|
299 |
-
//The QUIT command may cause the daemon to exit, which will kill our connection
|
300 |
-
//So ignore errors here
|
301 |
-
try {
|
302 |
-
@fclose($this->pop_conn);
|
303 |
-
} catch (Exception $e) {
|
304 |
-
//Do nothing
|
305 |
-
};
|
306 |
-
}
|
307 |
-
|
308 |
-
/**
|
309 |
-
* Get a response from the POP3 server.
|
310 |
-
* $size is the maximum number of bytes to retrieve
|
311 |
-
* @param integer $size
|
312 |
-
* @return string
|
313 |
-
* @access protected
|
314 |
-
*/
|
315 |
-
protected function getResponse($size = 128)
|
316 |
-
{
|
317 |
-
$response = fgets($this->pop_conn, $size);
|
318 |
-
if ($this->do_debug >= 1) {
|
319 |
-
echo "Server -> Client: $response";
|
320 |
-
}
|
321 |
-
return $response;
|
322 |
-
}
|
323 |
-
|
324 |
-
/**
|
325 |
-
* Send raw data to the POP3 server.
|
326 |
-
* @param string $string
|
327 |
-
* @return integer
|
328 |
-
* @access protected
|
329 |
-
*/
|
330 |
-
protected function sendString($string)
|
331 |
-
{
|
332 |
-
if ($this->pop_conn) {
|
333 |
-
if ($this->do_debug >= 2) { //Show client messages when debug >= 2
|
334 |
-
echo "Client -> Server: $string";
|
335 |
-
}
|
336 |
-
return fwrite($this->pop_conn, $string, strlen($string));
|
337 |
-
}
|
338 |
-
return 0;
|
339 |
-
}
|
340 |
-
|
341 |
-
/**
|
342 |
-
* Checks the POP3 server response.
|
343 |
-
* Looks for for +OK or -ERR.
|
344 |
-
* @param string $string
|
345 |
-
* @return boolean
|
346 |
-
* @access protected
|
347 |
-
*/
|
348 |
-
protected function checkResponse($string)
|
349 |
-
{
|
350 |
-
if (substr($string, 0, 3) !== '+OK') {
|
351 |
-
$this->setError(array(
|
352 |
-
'error' => "Server reported an error: $string",
|
353 |
-
'errno' => 0,
|
354 |
-
'errstr' => ''
|
355 |
-
));
|
356 |
-
return false;
|
357 |
-
} else {
|
358 |
-
return true;
|
359 |
-
}
|
360 |
-
}
|
361 |
-
|
362 |
-
/**
|
363 |
-
* Add an error to the internal error store.
|
364 |
-
* Also display debug output if it's enabled.
|
365 |
-
* @param $error
|
366 |
-
* @access protected
|
367 |
-
*/
|
368 |
-
protected function setError($error)
|
369 |
-
{
|
370 |
-
$this->errors[] = $error;
|
371 |
-
if ($this->do_debug >= 1) {
|
372 |
-
echo '<pre>';
|
373 |
-
foreach ($this->errors as $error) {
|
374 |
-
print_r($error);
|
375 |
-
}
|
376 |
-
echo '</pre>';
|
377 |
-
}
|
378 |
-
}
|
379 |
-
|
380 |
-
/**
|
381 |
-
* Get an array of error messages, if any.
|
382 |
-
* @return array
|
383 |
-
*/
|
384 |
-
public function getErrors()
|
385 |
-
{
|
386 |
-
return $this->errors;
|
387 |
-
}
|
388 |
-
|
389 |
-
/**
|
390 |
-
* POP3 connection error handler.
|
391 |
-
* @param integer $errno
|
392 |
-
* @param string $errstr
|
393 |
-
* @param string $errfile
|
394 |
-
* @param integer $errline
|
395 |
-
* @access protected
|
396 |
-
*/
|
397 |
-
protected function catchWarning($errno, $errstr, $errfile, $errline)
|
398 |
-
{
|
399 |
-
$this->setError(array(
|
400 |
-
'error' => "Connecting to the POP3 server raised a PHP warning: ",
|
401 |
-
'errno' => $errno,
|
402 |
-
'errstr' => $errstr,
|
403 |
-
'errfile' => $errfile,
|
404 |
-
'errline' => $errline
|
405 |
-
));
|
406 |
-
}
|
407 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/class.smtp.php
DELETED
@@ -1,1276 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PHPMailer RFC821 SMTP email transport class.
|
4 |
-
* PHP Version 5
|
5 |
-
* @package PHPMailer
|
6 |
-
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
7 |
-
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
8 |
-
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
9 |
-
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
10 |
-
* @author Brent R. Matzelle (original founder)
|
11 |
-
* @copyright 2014 Marcus Bointon
|
12 |
-
* @copyright 2010 - 2012 Jim Jagielski
|
13 |
-
* @copyright 2004 - 2009 Andy Prevost
|
14 |
-
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
15 |
-
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
16 |
-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE.
|
18 |
-
*/
|
19 |
-
|
20 |
-
/**
|
21 |
-
* PHPMailer RFC821 SMTP email transport class.
|
22 |
-
* Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server.
|
23 |
-
* @package PHPMailer
|
24 |
-
* @author Chris Ryan
|
25 |
-
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
26 |
-
*/
|
27 |
-
class SMTP
|
28 |
-
{
|
29 |
-
/**
|
30 |
-
* The PHPMailer SMTP version number.
|
31 |
-
* @var string
|
32 |
-
*/
|
33 |
-
const VERSION = '5.2.26';
|
34 |
-
|
35 |
-
/**
|
36 |
-
* SMTP line break constant.
|
37 |
-
* @var string
|
38 |
-
*/
|
39 |
-
const CRLF = "\r\n";
|
40 |
-
|
41 |
-
/**
|
42 |
-
* The SMTP port to use if one is not specified.
|
43 |
-
* @var integer
|
44 |
-
*/
|
45 |
-
const DEFAULT_SMTP_PORT = 25;
|
46 |
-
|
47 |
-
/**
|
48 |
-
* The maximum line length allowed by RFC 2822 section 2.1.1
|
49 |
-
* @var integer
|
50 |
-
*/
|
51 |
-
const MAX_LINE_LENGTH = 998;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Debug level for no output
|
55 |
-
*/
|
56 |
-
const DEBUG_OFF = 0;
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Debug level to show client -> server messages
|
60 |
-
*/
|
61 |
-
const DEBUG_CLIENT = 1;
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Debug level to show client -> server and server -> client messages
|
65 |
-
*/
|
66 |
-
const DEBUG_SERVER = 2;
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Debug level to show connection status, client -> server and server -> client messages
|
70 |
-
*/
|
71 |
-
const DEBUG_CONNECTION = 3;
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Debug level to show all messages
|
75 |
-
*/
|
76 |
-
const DEBUG_LOWLEVEL = 4;
|
77 |
-
|
78 |
-
/**
|
79 |
-
* The PHPMailer SMTP Version number.
|
80 |
-
* @var string
|
81 |
-
* @deprecated Use the `VERSION` constant instead
|
82 |
-
* @see SMTP::VERSION
|
83 |
-
*/
|
84 |
-
public $Version = '5.2.26';
|
85 |
-
|
86 |
-
/**
|
87 |
-
* SMTP server port number.
|
88 |
-
* @var integer
|
89 |
-
* @deprecated This is only ever used as a default value, so use the `DEFAULT_SMTP_PORT` constant instead
|
90 |
-
* @see SMTP::DEFAULT_SMTP_PORT
|
91 |
-
*/
|
92 |
-
public $SMTP_PORT = 25;
|
93 |
-
|
94 |
-
/**
|
95 |
-
* SMTP reply line ending.
|
96 |
-
* @var string
|
97 |
-
* @deprecated Use the `CRLF` constant instead
|
98 |
-
* @see SMTP::CRLF
|
99 |
-
*/
|
100 |
-
public $CRLF = "\r\n";
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Debug output level.
|
104 |
-
* Options:
|
105 |
-
* * self::DEBUG_OFF (`0`) No debug output, default
|
106 |
-
* * self::DEBUG_CLIENT (`1`) Client commands
|
107 |
-
* * self::DEBUG_SERVER (`2`) Client commands and server responses
|
108 |
-
* * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status
|
109 |
-
* * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages
|
110 |
-
* @var integer
|
111 |
-
*/
|
112 |
-
public $do_debug = self::DEBUG_OFF;
|
113 |
-
|
114 |
-
/**
|
115 |
-
* How to handle debug output.
|
116 |
-
* Options:
|
117 |
-
* * `echo` Output plain-text as-is, appropriate for CLI
|
118 |
-
* * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
|
119 |
-
* * `error_log` Output to error log as configured in php.ini
|
120 |
-
*
|
121 |
-
* Alternatively, you can provide a callable expecting two params: a message string and the debug level:
|
122 |
-
* <code>
|
123 |
-
* $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
|
124 |
-
* </code>
|
125 |
-
* @var string|callable
|
126 |
-
*/
|
127 |
-
public $Debugoutput = 'echo';
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Whether to use VERP.
|
131 |
-
* @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
|
132 |
-
* @link http://www.postfix.org/VERP_README.html Info on VERP
|
133 |
-
* @var boolean
|
134 |
-
*/
|
135 |
-
public $do_verp = false;
|
136 |
-
|
137 |
-
/**
|
138 |
-
* The timeout value for connection, in seconds.
|
139 |
-
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
|
140 |
-
* This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
|
141 |
-
* @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2
|
142 |
-
* @var integer
|
143 |
-
*/
|
144 |
-
public $Timeout = 300;
|
145 |
-
|
146 |
-
/**
|
147 |
-
* How long to wait for commands to complete, in seconds.
|
148 |
-
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
|
149 |
-
* @var integer
|
150 |
-
*/
|
151 |
-
public $Timelimit = 300;
|
152 |
-
|
153 |
-
/**
|
154 |
-
* @var array Patterns to extract an SMTP transaction id from reply to a DATA command.
|
155 |
-
* The first capture group in each regex will be used as the ID.
|
156 |
-
*/
|
157 |
-
protected $smtp_transaction_id_patterns = array(
|
158 |
-
'exim' => '/[0-9]{3} OK id=(.*)/',
|
159 |
-
'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/',
|
160 |
-
'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/'
|
161 |
-
);
|
162 |
-
|
163 |
-
/**
|
164 |
-
* @var string The last transaction ID issued in response to a DATA command,
|
165 |
-
* if one was detected
|
166 |
-
*/
|
167 |
-
protected $last_smtp_transaction_id;
|
168 |
-
|
169 |
-
/**
|
170 |
-
* The socket for the server connection.
|
171 |
-
* @var resource
|
172 |
-
*/
|
173 |
-
protected $smtp_conn;
|
174 |
-
|
175 |
-
/**
|
176 |
-
* Error information, if any, for the last SMTP command.
|
177 |
-
* @var array
|
178 |
-
*/
|
179 |
-
protected $error = array(
|
180 |
-
'error' => '',
|
181 |
-
'detail' => '',
|
182 |
-
'smtp_code' => '',
|
183 |
-
'smtp_code_ex' => ''
|
184 |
-
);
|
185 |
-
|
186 |
-
/**
|
187 |
-
* The reply the server sent to us for HELO.
|
188 |
-
* If null, no HELO string has yet been received.
|
189 |
-
* @var string|null
|
190 |
-
*/
|
191 |
-
protected $helo_rply = null;
|
192 |
-
|
193 |
-
/**
|
194 |
-
* The set of SMTP extensions sent in reply to EHLO command.
|
195 |
-
* Indexes of the array are extension names.
|
196 |
-
* Value at index 'HELO' or 'EHLO' (according to command that was sent)
|
197 |
-
* represents the server name. In case of HELO it is the only element of the array.
|
198 |
-
* Other values can be boolean TRUE or an array containing extension options.
|
199 |
-
* If null, no HELO/EHLO string has yet been received.
|
200 |
-
* @var array|null
|
201 |
-
*/
|
202 |
-
protected $server_caps = null;
|
203 |
-
|
204 |
-
/**
|
205 |
-
* The most recent reply received from the server.
|
206 |
-
* @var string
|
207 |
-
*/
|
208 |
-
protected $last_reply = '';
|
209 |
-
|
210 |
-
/**
|
211 |
-
* Output debugging info via a user-selected method.
|
212 |
-
* @see SMTP::$Debugoutput
|
213 |
-
* @see SMTP::$do_debug
|
214 |
-
* @param string $str Debug string to output
|
215 |
-
* @param integer $level The debug level of this message; see DEBUG_* constants
|
216 |
-
* @return void
|
217 |
-
*/
|
218 |
-
protected function edebug($str, $level = 0)
|
219 |
-
{
|
220 |
-
if ($level > $this->do_debug) {
|
221 |
-
return;
|
222 |
-
}
|
223 |
-
//Avoid clash with built-in function names
|
224 |
-
if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
|
225 |
-
call_user_func($this->Debugoutput, $str, $level);
|
226 |
-
return;
|
227 |
-
}
|
228 |
-
switch ($this->Debugoutput) {
|
229 |
-
case 'error_log':
|
230 |
-
//Don't output, just log
|
231 |
-
error_log($str);
|
232 |
-
break;
|
233 |
-
case 'html':
|
234 |
-
//Cleans up output a bit for a better looking, HTML-safe output
|
235 |
-
echo gmdate('Y-m-d H:i:s') . ' ' . htmlentities(
|
236 |
-
preg_replace('/[\r\n]+/', '', $str),
|
237 |
-
ENT_QUOTES,
|
238 |
-
'UTF-8'
|
239 |
-
) . "<br>\n";
|
240 |
-
break;
|
241 |
-
case 'echo':
|
242 |
-
default:
|
243 |
-
//Normalize line breaks
|
244 |
-
$str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
|
245 |
-
echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
|
246 |
-
"\n",
|
247 |
-
"\n \t ",
|
248 |
-
trim($str)
|
249 |
-
) . "\n";
|
250 |
-
}
|
251 |
-
}
|
252 |
-
|
253 |
-
/**
|
254 |
-
* Connect to an SMTP server.
|
255 |
-
* @param string $host SMTP server IP or host name
|
256 |
-
* @param integer $port The port number to connect to
|
257 |
-
* @param integer $timeout How long to wait for the connection to open
|
258 |
-
* @param array $options An array of options for stream_context_create()
|
259 |
-
* @access public
|
260 |
-
* @return boolean
|
261 |
-
*/
|
262 |
-
public function connect($host, $port = null, $timeout = 30, $options = array())
|
263 |
-
{
|
264 |
-
static $streamok;
|
265 |
-
//This is enabled by default since 5.0.0 but some providers disable it
|
266 |
-
//Check this once and cache the result
|
267 |
-
if (is_null($streamok)) {
|
268 |
-
$streamok = function_exists('stream_socket_client');
|
269 |
-
}
|
270 |
-
// Clear errors to avoid confusion
|
271 |
-
$this->setError('');
|
272 |
-
// Make sure we are __not__ connected
|
273 |
-
if ($this->connected()) {
|
274 |
-
// Already connected, generate error
|
275 |
-
$this->setError('Already connected to a server');
|
276 |
-
return false;
|
277 |
-
}
|
278 |
-
if (empty($port)) {
|
279 |
-
$port = self::DEFAULT_SMTP_PORT;
|
280 |
-
}
|
281 |
-
// Connect to the SMTP server
|
282 |
-
$this->edebug(
|
283 |
-
"Connection: opening to $host:$port, timeout=$timeout, options=" .
|
284 |
-
var_export($options, true),
|
285 |
-
self::DEBUG_CONNECTION
|
286 |
-
);
|
287 |
-
$errno = 0;
|
288 |
-
$errstr = '';
|
289 |
-
if ($streamok) {
|
290 |
-
$socket_context = stream_context_create($options);
|
291 |
-
set_error_handler(array($this, 'errorHandler'));
|
292 |
-
$this->smtp_conn = stream_socket_client(
|
293 |
-
$host . ":" . $port,
|
294 |
-
$errno,
|
295 |
-
$errstr,
|
296 |
-
$timeout,
|
297 |
-
STREAM_CLIENT_CONNECT,
|
298 |
-
$socket_context
|
299 |
-
);
|
300 |
-
restore_error_handler();
|
301 |
-
} else {
|
302 |
-
//Fall back to fsockopen which should work in more places, but is missing some features
|
303 |
-
$this->edebug(
|
304 |
-
"Connection: stream_socket_client not available, falling back to fsockopen",
|
305 |
-
self::DEBUG_CONNECTION
|
306 |
-
);
|
307 |
-
set_error_handler(array($this, 'errorHandler'));
|
308 |
-
$this->smtp_conn = fsockopen(
|
309 |
-
$host,
|
310 |
-
$port,
|
311 |
-
$errno,
|
312 |
-
$errstr,
|
313 |
-
$timeout
|
314 |
-
);
|
315 |
-
restore_error_handler();
|
316 |
-
}
|
317 |
-
// Verify we connected properly
|
318 |
-
if (!is_resource($this->smtp_conn)) {
|
319 |
-
$this->setError(
|
320 |
-
'Failed to connect to server',
|
321 |
-
$errno,
|
322 |
-
$errstr
|
323 |
-
);
|
324 |
-
$this->edebug(
|
325 |
-
'SMTP ERROR: ' . $this->error['error']
|
326 |
-
. ": $errstr ($errno)",
|
327 |
-
self::DEBUG_CLIENT
|
328 |
-
);
|
329 |
-
return false;
|
330 |
-
}
|
331 |
-
$this->edebug('Connection: opened', self::DEBUG_CONNECTION);
|
332 |
-
// SMTP server can take longer to respond, give longer timeout for first read
|
333 |
-
// Windows does not have support for this timeout function
|
334 |
-
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
335 |
-
$max = ini_get('max_execution_time');
|
336 |
-
// Don't bother if unlimited
|
337 |
-
if ($max != 0 && $timeout > $max) {
|
338 |
-
@set_time_limit($timeout);
|
339 |
-
}
|
340 |
-
stream_set_timeout($this->smtp_conn, $timeout, 0);
|
341 |
-
}
|
342 |
-
// Get any announcement
|
343 |
-
$announce = $this->get_lines();
|
344 |
-
$this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
|
345 |
-
return true;
|
346 |
-
}
|
347 |
-
|
348 |
-
/**
|
349 |
-
* Initiate a TLS (encrypted) session.
|
350 |
-
* @access public
|
351 |
-
* @return boolean
|
352 |
-
*/
|
353 |
-
public function startTLS()
|
354 |
-
{
|
355 |
-
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
|
356 |
-
return false;
|
357 |
-
}
|
358 |
-
|
359 |
-
//Allow the best TLS version(s) we can
|
360 |
-
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
|
361 |
-
|
362 |
-
//PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
|
363 |
-
//so add them back in manually if we can
|
364 |
-
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
|
365 |
-
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
|
366 |
-
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
|
367 |
-
}
|
368 |
-
|
369 |
-
// Begin encrypted connection
|
370 |
-
set_error_handler(array($this, 'errorHandler'));
|
371 |
-
$crypto_ok = stream_socket_enable_crypto(
|
372 |
-
$this->smtp_conn,
|
373 |
-
true,
|
374 |
-
$crypto_method
|
375 |
-
);
|
376 |
-
restore_error_handler();
|
377 |
-
return $crypto_ok;
|
378 |
-
}
|
379 |
-
|
380 |
-
/**
|
381 |
-
* Perform SMTP authentication.
|
382 |
-
* Must be run after hello().
|
383 |
-
* @see hello()
|
384 |
-
* @param string $username The user name
|
385 |
-
* @param string $password The password
|
386 |
-
* @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2)
|
387 |
-
* @param string $realm The auth realm for NTLM
|
388 |
-
* @param string $workstation The auth workstation for NTLM
|
389 |
-
* @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth)
|
390 |
-
* @return bool True if successfully authenticated.* @access public
|
391 |
-
*/
|
392 |
-
public function authenticate(
|
393 |
-
$username,
|
394 |
-
$password,
|
395 |
-
$authtype = null,
|
396 |
-
$realm = '',
|
397 |
-
$workstation = '',
|
398 |
-
$OAuth = null
|
399 |
-
) {
|
400 |
-
if (!$this->server_caps) {
|
401 |
-
$this->setError('Authentication is not allowed before HELO/EHLO');
|
402 |
-
return false;
|
403 |
-
}
|
404 |
-
|
405 |
-
if (array_key_exists('EHLO', $this->server_caps)) {
|
406 |
-
// SMTP extensions are available; try to find a proper authentication method
|
407 |
-
if (!array_key_exists('AUTH', $this->server_caps)) {
|
408 |
-
$this->setError('Authentication is not allowed at this stage');
|
409 |
-
// 'at this stage' means that auth may be allowed after the stage changes
|
410 |
-
// e.g. after STARTTLS
|
411 |
-
return false;
|
412 |
-
}
|
413 |
-
|
414 |
-
self::edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL);
|
415 |
-
self::edebug(
|
416 |
-
'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']),
|
417 |
-
self::DEBUG_LOWLEVEL
|
418 |
-
);
|
419 |
-
|
420 |
-
if (empty($authtype)) {
|
421 |
-
foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'NTLM', 'XOAUTH2') as $method) {
|
422 |
-
if (in_array($method, $this->server_caps['AUTH'])) {
|
423 |
-
$authtype = $method;
|
424 |
-
break;
|
425 |
-
}
|
426 |
-
}
|
427 |
-
if (empty($authtype)) {
|
428 |
-
$this->setError('No supported authentication methods found');
|
429 |
-
return false;
|
430 |
-
}
|
431 |
-
self::edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL);
|
432 |
-
}
|
433 |
-
|
434 |
-
if (!in_array($authtype, $this->server_caps['AUTH'])) {
|
435 |
-
$this->setError("The requested authentication method \"$authtype\" is not supported by the server");
|
436 |
-
return false;
|
437 |
-
}
|
438 |
-
} elseif (empty($authtype)) {
|
439 |
-
$authtype = 'LOGIN';
|
440 |
-
}
|
441 |
-
switch ($authtype) {
|
442 |
-
case 'PLAIN':
|
443 |
-
// Start authentication
|
444 |
-
if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) {
|
445 |
-
return false;
|
446 |
-
}
|
447 |
-
// Send encoded username and password
|
448 |
-
if (!$this->sendCommand(
|
449 |
-
'User & Password',
|
450 |
-
base64_encode("\0" . $username . "\0" . $password),
|
451 |
-
235
|
452 |
-
)
|
453 |
-
) {
|
454 |
-
return false;
|
455 |
-
}
|
456 |
-
break;
|
457 |
-
case 'LOGIN':
|
458 |
-
// Start authentication
|
459 |
-
if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) {
|
460 |
-
return false;
|
461 |
-
}
|
462 |
-
if (!$this->sendCommand("Username", base64_encode($username), 334)) {
|
463 |
-
return false;
|
464 |
-
}
|
465 |
-
if (!$this->sendCommand("Password", base64_encode($password), 235)) {
|
466 |
-
return false;
|
467 |
-
}
|
468 |
-
break;
|
469 |
-
case 'XOAUTH2':
|
470 |
-
//If the OAuth Instance is not set. Can be a case when PHPMailer is used
|
471 |
-
//instead of PHPMailerOAuth
|
472 |
-
if (is_null($OAuth)) {
|
473 |
-
return false;
|
474 |
-
}
|
475 |
-
$oauth = $OAuth->getOauth64();
|
476 |
-
|
477 |
-
// Start authentication
|
478 |
-
if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
|
479 |
-
return false;
|
480 |
-
}
|
481 |
-
break;
|
482 |
-
case 'NTLM':
|
483 |
-
/*
|
484 |
-
* ntlm_sasl_client.php
|
485 |
-
* Bundled with Permission
|
486 |
-
*
|
487 |
-
* How to telnet in windows:
|
488 |
-
* http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx
|
489 |
-
* PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication
|
490 |
-
*/
|
491 |
-
require_once 'extras/ntlm_sasl_client.php';
|
492 |
-
$temp = new stdClass;
|
493 |
-
$ntlm_client = new ntlm_sasl_client_class;
|
494 |
-
//Check that functions are available
|
495 |
-
if (!$ntlm_client->initialize($temp)) {
|
496 |
-
$this->setError($temp->error);
|
497 |
-
$this->edebug(
|
498 |
-
'You need to enable some modules in your php.ini file: '
|
499 |
-
. $this->error['error'],
|
500 |
-
self::DEBUG_CLIENT
|
501 |
-
);
|
502 |
-
return false;
|
503 |
-
}
|
504 |
-
//msg1
|
505 |
-
$msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1
|
506 |
-
|
507 |
-
if (!$this->sendCommand(
|
508 |
-
'AUTH NTLM',
|
509 |
-
'AUTH NTLM ' . base64_encode($msg1),
|
510 |
-
334
|
511 |
-
)
|
512 |
-
) {
|
513 |
-
return false;
|
514 |
-
}
|
515 |
-
//Though 0 based, there is a white space after the 3 digit number
|
516 |
-
//msg2
|
517 |
-
$challenge = substr($this->last_reply, 3);
|
518 |
-
$challenge = base64_decode($challenge);
|
519 |
-
$ntlm_res = $ntlm_client->NTLMResponse(
|
520 |
-
substr($challenge, 24, 8),
|
521 |
-
$password
|
522 |
-
);
|
523 |
-
//msg3
|
524 |
-
$msg3 = $ntlm_client->typeMsg3(
|
525 |
-
$ntlm_res,
|
526 |
-
$username,
|
527 |
-
$realm,
|
528 |
-
$workstation
|
529 |
-
);
|
530 |
-
// send encoded username
|
531 |
-
return $this->sendCommand('Username', base64_encode($msg3), 235);
|
532 |
-
case 'CRAM-MD5':
|
533 |
-
// Start authentication
|
534 |
-
if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) {
|
535 |
-
return false;
|
536 |
-
}
|
537 |
-
// Get the challenge
|
538 |
-
$challenge = base64_decode(substr($this->last_reply, 4));
|
539 |
-
|
540 |
-
// Build the response
|
541 |
-
$response = $username . ' ' . $this->hmac($challenge, $password);
|
542 |
-
|
543 |
-
// send encoded credentials
|
544 |
-
return $this->sendCommand('Username', base64_encode($response), 235);
|
545 |
-
default:
|
546 |
-
$this->setError("Authentication method \"$authtype\" is not supported");
|
547 |
-
return false;
|
548 |
-
}
|
549 |
-
return true;
|
550 |
-
}
|
551 |
-
|
552 |
-
/**
|
553 |
-
* Calculate an MD5 HMAC hash.
|
554 |
-
* Works like hash_hmac('md5', $data, $key)
|
555 |
-
* in case that function is not available
|
556 |
-
* @param string $data The data to hash
|
557 |
-
* @param string $key The key to hash with
|
558 |
-
* @access protected
|
559 |
-
* @return string
|
560 |
-
*/
|
561 |
-
protected function hmac($data, $key)
|
562 |
-
{
|
563 |
-
if (function_exists('hash_hmac')) {
|
564 |
-
return hash_hmac('md5', $data, $key);
|
565 |
-
}
|
566 |
-
|
567 |
-
// The following borrowed from
|
568 |
-
// http://php.net/manual/en/function.mhash.php#27225
|
569 |
-
|
570 |
-
// RFC 2104 HMAC implementation for php.
|
571 |
-
// Creates an md5 HMAC.
|
572 |
-
// Eliminates the need to install mhash to compute a HMAC
|
573 |
-
// by Lance Rushing
|
574 |
-
|
575 |
-
$bytelen = 64; // byte length for md5
|
576 |
-
if (strlen($key) > $bytelen) {
|
577 |
-
$key = pack('H*', md5($key));
|
578 |
-
}
|
579 |
-
$key = str_pad($key, $bytelen, chr(0x00));
|
580 |
-
$ipad = str_pad('', $bytelen, chr(0x36));
|
581 |
-
$opad = str_pad('', $bytelen, chr(0x5c));
|
582 |
-
$k_ipad = $key ^ $ipad;
|
583 |
-
$k_opad = $key ^ $opad;
|
584 |
-
|
585 |
-
return md5($k_opad . pack('H*', md5($k_ipad . $data)));
|
586 |
-
}
|
587 |
-
|
588 |
-
/**
|
589 |
-
* Check connection state.
|
590 |
-
* @access public
|
591 |
-
* @return boolean True if connected.
|
592 |
-
*/
|
593 |
-
public function connected()
|
594 |
-
{
|
595 |
-
if (is_resource($this->smtp_conn)) {
|
596 |
-
$sock_status = stream_get_meta_data($this->smtp_conn);
|
597 |
-
if ($sock_status['eof']) {
|
598 |
-
// The socket is valid but we are not connected
|
599 |
-
$this->edebug(
|
600 |
-
'SMTP NOTICE: EOF caught while checking if connected',
|
601 |
-
self::DEBUG_CLIENT
|
602 |
-
);
|
603 |
-
$this->close();
|
604 |
-
return false;
|
605 |
-
}
|
606 |
-
return true; // everything looks good
|
607 |
-
}
|
608 |
-
return false;
|
609 |
-
}
|
610 |
-
|
611 |
-
/**
|
612 |
-
* Close the socket and clean up the state of the class.
|
613 |
-
* Don't use this function without first trying to use QUIT.
|
614 |
-
* @see quit()
|
615 |
-
* @access public
|
616 |
-
* @return void
|
617 |
-
*/
|
618 |
-
public function close()
|
619 |
-
{
|
620 |
-
$this->setError('');
|
621 |
-
$this->server_caps = null;
|
622 |
-
$this->helo_rply = null;
|
623 |
-
if (is_resource($this->smtp_conn)) {
|
624 |
-
// close the connection and cleanup
|
625 |
-
fclose($this->smtp_conn);
|
626 |
-
$this->smtp_conn = null; //Makes for cleaner serialization
|
627 |
-
$this->edebug('Connection: closed', self::DEBUG_CONNECTION);
|
628 |
-
}
|
629 |
-
}
|
630 |
-
|
631 |
-
/**
|
632 |
-
* Send an SMTP DATA command.
|
633 |
-
* Issues a data command and sends the msg_data to the server,
|
634 |
-
* finializing the mail transaction. $msg_data is the message
|
635 |
-
* that is to be send with the headers. Each header needs to be
|
636 |
-
* on a single line followed by a <CRLF> with the message headers
|
637 |
-
* and the message body being separated by and additional <CRLF>.
|
638 |
-
* Implements rfc 821: DATA <CRLF>
|
639 |
-
* @param string $msg_data Message data to send
|
640 |
-
* @access public
|
641 |
-
* @return boolean
|
642 |
-
*/
|
643 |
-
public function data($msg_data)
|
644 |
-
{
|
645 |
-
//This will use the standard timelimit
|
646 |
-
if (!$this->sendCommand('DATA', 'DATA', 354)) {
|
647 |
-
return false;
|
648 |
-
}
|
649 |
-
|
650 |
-
/* The server is ready to accept data!
|
651 |
-
* According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF)
|
652 |
-
* so we will break the data up into lines by \r and/or \n then if needed we will break each of those into
|
653 |
-
* smaller lines to fit within the limit.
|
654 |
-
* We will also look for lines that start with a '.' and prepend an additional '.'.
|
655 |
-
* NOTE: this does not count towards line-length limit.
|
656 |
-
*/
|
657 |
-
|
658 |
-
// Normalize line breaks before exploding
|
659 |
-
$lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data));
|
660 |
-
|
661 |
-
/* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
|
662 |
-
* of the first line (':' separated) does not contain a space then it _should_ be a header and we will
|
663 |
-
* process all lines before a blank line as headers.
|
664 |
-
*/
|
665 |
-
|
666 |
-
$field = substr($lines[0], 0, strpos($lines[0], ':'));
|
667 |
-
$in_headers = false;
|
668 |
-
if (!empty($field) && strpos($field, ' ') === false) {
|
669 |
-
$in_headers = true;
|
670 |
-
}
|
671 |
-
|
672 |
-
foreach ($lines as $line) {
|
673 |
-
$lines_out = array();
|
674 |
-
if ($in_headers and $line == '') {
|
675 |
-
$in_headers = false;
|
676 |
-
}
|
677 |
-
//Break this line up into several smaller lines if it's too long
|
678 |
-
//Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len),
|
679 |
-
while (isset($line[self::MAX_LINE_LENGTH])) {
|
680 |
-
//Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on
|
681 |
-
//so as to avoid breaking in the middle of a word
|
682 |
-
$pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' ');
|
683 |
-
//Deliberately matches both false and 0
|
684 |
-
if (!$pos) {
|
685 |
-
//No nice break found, add a hard break
|
686 |
-
$pos = self::MAX_LINE_LENGTH - 1;
|
687 |
-
$lines_out[] = substr($line, 0, $pos);
|
688 |
-
$line = substr($line, $pos);
|
689 |
-
} else {
|
690 |
-
//Break at the found point
|
691 |
-
$lines_out[] = substr($line, 0, $pos);
|
692 |
-
//Move along by the amount we dealt with
|
693 |
-
$line = substr($line, $pos + 1);
|
694 |
-
}
|
695 |
-
//If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1
|
696 |
-
if ($in_headers) {
|
697 |
-
$line = "\t" . $line;
|
698 |
-
}
|
699 |
-
}
|
700 |
-
$lines_out[] = $line;
|
701 |
-
|
702 |
-
//Send the lines to the server
|
703 |
-
foreach ($lines_out as $line_out) {
|
704 |
-
//RFC2821 section 4.5.2
|
705 |
-
if (!empty($line_out) and $line_out[0] == '.') {
|
706 |
-
$line_out = '.' . $line_out;
|
707 |
-
}
|
708 |
-
$this->client_send($line_out . self::CRLF);
|
709 |
-
}
|
710 |
-
}
|
711 |
-
|
712 |
-
//Message data has been sent, complete the command
|
713 |
-
//Increase timelimit for end of DATA command
|
714 |
-
$savetimelimit = $this->Timelimit;
|
715 |
-
$this->Timelimit = $this->Timelimit * 2;
|
716 |
-
$result = $this->sendCommand('DATA END', '.', 250);
|
717 |
-
$this->recordLastTransactionID();
|
718 |
-
//Restore timelimit
|
719 |
-
$this->Timelimit = $savetimelimit;
|
720 |
-
return $result;
|
721 |
-
}
|
722 |
-
|
723 |
-
/**
|
724 |
-
* Send an SMTP HELO or EHLO command.
|
725 |
-
* Used to identify the sending server to the receiving server.
|
726 |
-
* This makes sure that client and server are in a known state.
|
727 |
-
* Implements RFC 821: HELO <SP> <domain> <CRLF>
|
728 |
-
* and RFC 2821 EHLO.
|
729 |
-
* @param string $host The host name or IP to connect to
|
730 |
-
* @access public
|
731 |
-
* @return boolean
|
732 |
-
*/
|
733 |
-
public function hello($host = '')
|
734 |
-
{
|
735 |
-
//Try extended hello first (RFC 2821)
|
736 |
-
return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
|
737 |
-
}
|
738 |
-
|
739 |
-
/**
|
740 |
-
* Send an SMTP HELO or EHLO command.
|
741 |
-
* Low-level implementation used by hello()
|
742 |
-
* @see hello()
|
743 |
-
* @param string $hello The HELO string
|
744 |
-
* @param string $host The hostname to say we are
|
745 |
-
* @access protected
|
746 |
-
* @return boolean
|
747 |
-
*/
|
748 |
-
protected function sendHello($hello, $host)
|
749 |
-
{
|
750 |
-
$noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
|
751 |
-
$this->helo_rply = $this->last_reply;
|
752 |
-
if ($noerror) {
|
753 |
-
$this->parseHelloFields($hello);
|
754 |
-
} else {
|
755 |
-
$this->server_caps = null;
|
756 |
-
}
|
757 |
-
return $noerror;
|
758 |
-
}
|
759 |
-
|
760 |
-
/**
|
761 |
-
* Parse a reply to HELO/EHLO command to discover server extensions.
|
762 |
-
* In case of HELO, the only parameter that can be discovered is a server name.
|
763 |
-
* @access protected
|
764 |
-
* @param string $type - 'HELO' or 'EHLO'
|
765 |
-
*/
|
766 |
-
protected function parseHelloFields($type)
|
767 |
-
{
|
768 |
-
$this->server_caps = array();
|
769 |
-
$lines = explode("\n", $this->helo_rply);
|
770 |
-
|
771 |
-
foreach ($lines as $n => $s) {
|
772 |
-
//First 4 chars contain response code followed by - or space
|
773 |
-
$s = trim(substr($s, 4));
|
774 |
-
if (empty($s)) {
|
775 |
-
continue;
|
776 |
-
}
|
777 |
-
$fields = explode(' ', $s);
|
778 |
-
if (!empty($fields)) {
|
779 |
-
if (!$n) {
|
780 |
-
$name = $type;
|
781 |
-
$fields = $fields[0];
|
782 |
-
} else {
|
783 |
-
$name = array_shift($fields);
|
784 |
-
switch ($name) {
|
785 |
-
case 'SIZE':
|
786 |
-
$fields = ($fields ? $fields[0] : 0);
|
787 |
-
break;
|
788 |
-
case 'AUTH':
|
789 |
-
if (!is_array($fields)) {
|
790 |
-
$fields = array();
|
791 |
-
}
|
792 |
-
break;
|
793 |
-
default:
|
794 |
-
$fields = true;
|
795 |
-
}
|
796 |
-
}
|
797 |
-
$this->server_caps[$name] = $fields;
|
798 |
-
}
|
799 |
-
}
|
800 |
-
}
|
801 |
-
|
802 |
-
/**
|
803 |
-
* Send an SMTP MAIL command.
|
804 |
-
* Starts a mail transaction from the email address specified in
|
805 |
-
* $from. Returns true if successful or false otherwise. If True
|
806 |
-
* the mail transaction is started and then one or more recipient
|
807 |
-
* commands may be called followed by a data command.
|
808 |
-
* Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
|
809 |
-
* @param string $from Source address of this message
|
810 |
-
* @access public
|
811 |
-
* @return boolean
|
812 |
-
*/
|
813 |
-
public function mail($from)
|
814 |
-
{
|
815 |
-
$useVerp = ($this->do_verp ? ' XVERP' : '');
|
816 |
-
return $this->sendCommand(
|
817 |
-
'MAIL FROM',
|
818 |
-
'MAIL FROM:<' . $from . '>' . $useVerp,
|
819 |
-
250
|
820 |
-
);
|
821 |
-
}
|
822 |
-
|
823 |
-
/**
|
824 |
-
* Send an SMTP QUIT command.
|
825 |
-
* Closes the socket if there is no error or the $close_on_error argument is true.
|
826 |
-
* Implements from rfc 821: QUIT <CRLF>
|
827 |
-
* @param boolean $close_on_error Should the connection close if an error occurs?
|
828 |
-
* @access public
|
829 |
-
* @return boolean
|
830 |
-
*/
|
831 |
-
public function quit($close_on_error = true)
|
832 |
-
{
|
833 |
-
$noerror = $this->sendCommand('QUIT', 'QUIT', 221);
|
834 |
-
$err = $this->error; //Save any error
|
835 |
-
if ($noerror or $close_on_error) {
|
836 |
-
$this->close();
|
837 |
-
$this->error = $err; //Restore any error from the quit command
|
838 |
-
}
|
839 |
-
return $noerror;
|
840 |
-
}
|
841 |
-
|
842 |
-
/**
|
843 |
-
* Send an SMTP RCPT command.
|
844 |
-
* Sets the TO argument to $toaddr.
|
845 |
-
* Returns true if the recipient was accepted false if it was rejected.
|
846 |
-
* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
|
847 |
-
* @param string $address The address the message is being sent to
|
848 |
-
* @access public
|
849 |
-
* @return boolean
|
850 |
-
*/
|
851 |
-
public function recipient($address)
|
852 |
-
{
|
853 |
-
return $this->sendCommand(
|
854 |
-
'RCPT TO',
|
855 |
-
'RCPT TO:<' . $address . '>',
|
856 |
-
array(250, 251)
|
857 |
-
);
|
858 |
-
}
|
859 |
-
|
860 |
-
/**
|
861 |
-
* Send an SMTP RSET command.
|
862 |
-
* Abort any transaction that is currently in progress.
|
863 |
-
* Implements rfc 821: RSET <CRLF>
|
864 |
-
* @access public
|
865 |
-
* @return boolean True on success.
|
866 |
-
*/
|
867 |
-
public function reset()
|
868 |
-
{
|
869 |
-
return $this->sendCommand('RSET', 'RSET', 250);
|
870 |
-
}
|
871 |
-
|
872 |
-
/**
|
873 |
-
* Send a command to an SMTP server and check its return code.
|
874 |
-
* @param string $command The command name - not sent to the server
|
875 |
-
* @param string $commandstring The actual command to send
|
876 |
-
* @param integer|array $expect One or more expected integer success codes
|
877 |
-
* @access protected
|
878 |
-
* @return boolean True on success.
|
879 |
-
*/
|
880 |
-
protected function sendCommand($command, $commandstring, $expect)
|
881 |
-
{
|
882 |
-
if (!$this->connected()) {
|
883 |
-
$this->setError("Called $command without being connected");
|
884 |
-
return false;
|
885 |
-
}
|
886 |
-
//Reject line breaks in all commands
|
887 |
-
if (strpos($commandstring, "\n") !== false or strpos($commandstring, "\r") !== false) {
|
888 |
-
$this->setError("Command '$command' contained line breaks");
|
889 |
-
return false;
|
890 |
-
}
|
891 |
-
$this->client_send($commandstring . self::CRLF);
|
892 |
-
|
893 |
-
$this->last_reply = $this->get_lines();
|
894 |
-
// Fetch SMTP code and possible error code explanation
|
895 |
-
$matches = array();
|
896 |
-
if (preg_match("/^([0-9]{3})[ -](?:([0-9]\\.[0-9]\\.[0-9]) )?/", $this->last_reply, $matches)) {
|
897 |
-
$code = $matches[1];
|
898 |
-
$code_ex = (count($matches) > 2 ? $matches[2] : null);
|
899 |
-
// Cut off error code from each response line
|
900 |
-
$detail = preg_replace(
|
901 |
-
"/{$code}[ -]" .
|
902 |
-
($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . "/m",
|
903 |
-
'',
|
904 |
-
$this->last_reply
|
905 |
-
);
|
906 |
-
} else {
|
907 |
-
// Fall back to simple parsing if regex fails
|
908 |
-
$code = substr($this->last_reply, 0, 3);
|
909 |
-
$code_ex = null;
|
910 |
-
$detail = substr($this->last_reply, 4);
|
911 |
-
}
|
912 |
-
|
913 |
-
$this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
|
914 |
-
|
915 |
-
if (!in_array($code, (array)$expect)) {
|
916 |
-
$this->setError(
|
917 |
-
"$command command failed",
|
918 |
-
$detail,
|
919 |
-
$code,
|
920 |
-
$code_ex
|
921 |
-
);
|
922 |
-
$this->edebug(
|
923 |
-
'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply,
|
924 |
-
self::DEBUG_CLIENT
|
925 |
-
);
|
926 |
-
return false;
|
927 |
-
}
|
928 |
-
|
929 |
-
$this->setError('');
|
930 |
-
return true;
|
931 |
-
}
|
932 |
-
|
933 |
-
/**
|
934 |
-
* Send an SMTP SAML command.
|
935 |
-
* Starts a mail transaction from the email address specified in $from.
|
936 |
-
* Returns true if successful or false otherwise. If True
|
937 |
-
* the mail transaction is started and then one or more recipient
|
938 |
-
* commands may be called followed by a data command. This command
|
939 |
-
* will send the message to the users terminal if they are logged
|
940 |
-
* in and send them an email.
|
941 |
-
* Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
|
942 |
-
* @param string $from The address the message is from
|
943 |
-
* @access public
|
944 |
-
* @return boolean
|
945 |
-
*/
|
946 |
-
public function sendAndMail($from)
|
947 |
-
{
|
948 |
-
return $this->sendCommand('SAML', "SAML FROM:$from", 250);
|
949 |
-
}
|
950 |
-
|
951 |
-
/**
|
952 |
-
* Send an SMTP VRFY command.
|
953 |
-
* @param string $name The name to verify
|
954 |
-
* @access public
|
955 |
-
* @return boolean
|
956 |
-
*/
|
957 |
-
public function verify($name)
|
958 |
-
{
|
959 |
-
return $this->sendCommand('VRFY', "VRFY $name", array(250, 251));
|
960 |
-
}
|
961 |
-
|
962 |
-
/**
|
963 |
-
* Send an SMTP NOOP command.
|
964 |
-
* Used to keep keep-alives alive, doesn't actually do anything
|
965 |
-
* @access public
|
966 |
-
* @return boolean
|
967 |
-
*/
|
968 |
-
public function noop()
|
969 |
-
{
|
970 |
-
return $this->sendCommand('NOOP', 'NOOP', 250);
|
971 |
-
}
|
972 |
-
|
973 |
-
/**
|
974 |
-
* Send an SMTP TURN command.
|
975 |
-
* This is an optional command for SMTP that this class does not support.
|
976 |
-
* This method is here to make the RFC821 Definition complete for this class
|
977 |
-
* and _may_ be implemented in future
|
978 |
-
* Implements from rfc 821: TURN <CRLF>
|
979 |
-
* @access public
|
980 |
-
* @return boolean
|
981 |
-
*/
|
982 |
-
public function turn()
|
983 |
-
{
|
984 |
-
$this->setError('The SMTP TURN command is not implemented');
|
985 |
-
$this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
|
986 |
-
return false;
|
987 |
-
}
|
988 |
-
|
989 |
-
/**
|
990 |
-
* Send raw data to the server.
|
991 |
-
* @param string $data The data to send
|
992 |
-
* @access public
|
993 |
-
* @return integer|boolean The number of bytes sent to the server or false on error
|
994 |
-
*/
|
995 |
-
public function client_send($data)
|
996 |
-
{
|
997 |
-
$this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
|
998 |
-
set_error_handler(array($this, 'errorHandler'));
|
999 |
-
$result = fwrite($this->smtp_conn, $data);
|
1000 |
-
restore_error_handler();
|
1001 |
-
return $result;
|
1002 |
-
}
|
1003 |
-
|
1004 |
-
/**
|
1005 |
-
* Get the latest error.
|
1006 |
-
* @access public
|
1007 |
-
* @return array
|
1008 |
-
*/
|
1009 |
-
public function getError()
|
1010 |
-
{
|
1011 |
-
return $this->error;
|
1012 |
-
}
|
1013 |
-
|
1014 |
-
/**
|
1015 |
-
* Get SMTP extensions available on the server
|
1016 |
-
* @access public
|
1017 |
-
* @return array|null
|
1018 |
-
*/
|
1019 |
-
public function getServerExtList()
|
1020 |
-
{
|
1021 |
-
return $this->server_caps;
|
1022 |
-
}
|
1023 |
-
|
1024 |
-
/**
|
1025 |
-
* A multipurpose method
|
1026 |
-
* The method works in three ways, dependent on argument value and current state
|
1027 |
-
* 1. HELO/EHLO was not sent - returns null and set up $this->error
|
1028 |
-
* 2. HELO was sent
|
1029 |
-
* $name = 'HELO': returns server name
|
1030 |
-
* $name = 'EHLO': returns boolean false
|
1031 |
-
* $name = any string: returns null and set up $this->error
|
1032 |
-
* 3. EHLO was sent
|
1033 |
-
* $name = 'HELO'|'EHLO': returns server name
|
1034 |
-
* $name = any string: if extension $name exists, returns boolean True
|
1035 |
-
* or its options. Otherwise returns boolean False
|
1036 |
-
* In other words, one can use this method to detect 3 conditions:
|
1037 |
-
* - null returned: handshake was not or we don't know about ext (refer to $this->error)
|
1038 |
-
* - false returned: the requested feature exactly not exists
|
1039 |
-
* - positive value returned: the requested feature exists
|
1040 |
-
* @param string $name Name of SMTP extension or 'HELO'|'EHLO'
|
1041 |
-
* @return mixed
|
1042 |
-
*/
|
1043 |
-
public function getServerExt($name)
|
1044 |
-
{
|
1045 |
-
if (!$this->server_caps) {
|
1046 |
-
$this->setError('No HELO/EHLO was sent');
|
1047 |
-
return null;
|
1048 |
-
}
|
1049 |
-
|
1050 |
-
// the tight logic knot ;)
|
1051 |
-
if (!array_key_exists($name, $this->server_caps)) {
|
1052 |
-
if ($name == 'HELO') {
|
1053 |
-
return $this->server_caps['EHLO'];
|
1054 |
-
}
|
1055 |
-
if ($name == 'EHLO' || array_key_exists('EHLO', $this->server_caps)) {
|
1056 |
-
return false;
|
1057 |
-
}
|
1058 |
-
$this->setError('HELO handshake was used. Client knows nothing about server extensions');
|
1059 |
-
return null;
|
1060 |
-
}
|
1061 |
-
|
1062 |
-
return $this->server_caps[$name];
|
1063 |
-
}
|
1064 |
-
|
1065 |
-
/**
|
1066 |
-
* Get the last reply from the server.
|
1067 |
-
* @access public
|
1068 |
-
* @return string
|
1069 |
-
*/
|
1070 |
-
public function getLastReply()
|
1071 |
-
{
|
1072 |
-
return $this->last_reply;
|
1073 |
-
}
|
1074 |
-
|
1075 |
-
/**
|
1076 |
-
* Read the SMTP server's response.
|
1077 |
-
* Either before eof or socket timeout occurs on the operation.
|
1078 |
-
* With SMTP we can tell if we have more lines to read if the
|
1079 |
-
* 4th character is '-' symbol. If it is a space then we don't
|
1080 |
-
* need to read anything else.
|
1081 |
-
* @access protected
|
1082 |
-
* @return string
|
1083 |
-
*/
|
1084 |
-
protected function get_lines()
|
1085 |
-
{
|
1086 |
-
// If the connection is bad, give up straight away
|
1087 |
-
if (!is_resource($this->smtp_conn)) {
|
1088 |
-
return '';
|
1089 |
-
}
|
1090 |
-
$data = '';
|
1091 |
-
$endtime = 0;
|
1092 |
-
stream_set_timeout($this->smtp_conn, $this->Timeout);
|
1093 |
-
if ($this->Timelimit > 0) {
|
1094 |
-
$endtime = time() + $this->Timelimit;
|
1095 |
-
}
|
1096 |
-
while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
|
1097 |
-
$str = @fgets($this->smtp_conn, 515);
|
1098 |
-
$this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
|
1099 |
-
$this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL);
|
1100 |
-
$data .= $str;
|
1101 |
-
// If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled),
|
1102 |
-
// or 4th character is a space, we are done reading, break the loop,
|
1103 |
-
// string array access is a micro-optimisation over strlen
|
1104 |
-
if (!isset($str[3]) or (isset($str[3]) and $str[3] == ' ')) {
|
1105 |
-
break;
|
1106 |
-
}
|
1107 |
-
// Timed-out? Log and break
|
1108 |
-
$info = stream_get_meta_data($this->smtp_conn);
|
1109 |
-
if ($info['timed_out']) {
|
1110 |
-
$this->edebug(
|
1111 |
-
'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)',
|
1112 |
-
self::DEBUG_LOWLEVEL
|
1113 |
-
);
|
1114 |
-
break;
|
1115 |
-
}
|
1116 |
-
// Now check if reads took too long
|
1117 |
-
if ($endtime and time() > $endtime) {
|
1118 |
-
$this->edebug(
|
1119 |
-
'SMTP -> get_lines(): timelimit reached (' .
|
1120 |
-
$this->Timelimit . ' sec)',
|
1121 |
-
self::DEBUG_LOWLEVEL
|
1122 |
-
);
|
1123 |
-
break;
|
1124 |
-
}
|
1125 |
-
}
|
1126 |
-
return $data;
|
1127 |
-
}
|
1128 |
-
|
1129 |
-
/**
|
1130 |
-
* Enable or disable VERP address generation.
|
1131 |
-
* @param boolean $enabled
|
1132 |
-
*/
|
1133 |
-
public function setVerp($enabled = false)
|
1134 |
-
{
|
1135 |
-
$this->do_verp = $enabled;
|
1136 |
-
}
|
1137 |
-
|
1138 |
-
/**
|
1139 |
-
* Get VERP address generation mode.
|
1140 |
-
* @return boolean
|
1141 |
-
*/
|
1142 |
-
public function getVerp()
|
1143 |
-
{
|
1144 |
-
return $this->do_verp;
|
1145 |
-
}
|
1146 |
-
|
1147 |
-
/**
|
1148 |
-
* Set error messages and codes.
|
1149 |
-
* @param string $message The error message
|
1150 |
-
* @param string $detail Further detail on the error
|
1151 |
-
* @param string $smtp_code An associated SMTP error code
|
1152 |
-
* @param string $smtp_code_ex Extended SMTP code
|
1153 |
-
*/
|
1154 |
-
protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')
|
1155 |
-
{
|
1156 |
-
$this->error = array(
|
1157 |
-
'error' => $message,
|
1158 |
-
'detail' => $detail,
|
1159 |
-
'smtp_code' => $smtp_code,
|
1160 |
-
'smtp_code_ex' => $smtp_code_ex
|
1161 |
-
);
|
1162 |
-
}
|
1163 |
-
|
1164 |
-
/**
|
1165 |
-
* Set debug output method.
|
1166 |
-
* @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it.
|
1167 |
-
*/
|
1168 |
-
public function setDebugOutput($method = 'echo')
|
1169 |
-
{
|
1170 |
-
$this->Debugoutput = $method;
|
1171 |
-
}
|
1172 |
-
|
1173 |
-
/**
|
1174 |
-
* Get debug output method.
|
1175 |
-
* @return string
|
1176 |
-
*/
|
1177 |
-
public function getDebugOutput()
|
1178 |
-
{
|
1179 |
-
return $this->Debugoutput;
|
1180 |
-
}
|
1181 |
-
|
1182 |
-
/**
|
1183 |
-
* Set debug output level.
|
1184 |
-
* @param integer $level
|
1185 |
-
*/
|
1186 |
-
public function setDebugLevel($level = 0)
|
1187 |
-
{
|
1188 |
-
$this->do_debug = $level;
|
1189 |
-
}
|
1190 |
-
|
1191 |
-
/**
|
1192 |
-
* Get debug output level.
|
1193 |
-
* @return integer
|
1194 |
-
*/
|
1195 |
-
public function getDebugLevel()
|
1196 |
-
{
|
1197 |
-
return $this->do_debug;
|
1198 |
-
}
|
1199 |
-
|
1200 |
-
/**
|
1201 |
-
* Set SMTP timeout.
|
1202 |
-
* @param integer $timeout
|
1203 |
-
*/
|
1204 |
-
public function setTimeout($timeout = 0)
|
1205 |
-
{
|
1206 |
-
$this->Timeout = $timeout;
|
1207 |
-
}
|
1208 |
-
|
1209 |
-
/**
|
1210 |
-
* Get SMTP timeout.
|
1211 |
-
* @return integer
|
1212 |
-
*/
|
1213 |
-
public function getTimeout()
|
1214 |
-
{
|
1215 |
-
return $this->Timeout;
|
1216 |
-
}
|
1217 |
-
|
1218 |
-
/**
|
1219 |
-
* Reports an error number and string.
|
1220 |
-
* @param integer $errno The error number returned by PHP.
|
1221 |
-
* @param string $errmsg The error message returned by PHP.
|
1222 |
-
* @param string $errfile The file the error occurred in
|
1223 |
-
* @param integer $errline The line number the error occurred on
|
1224 |
-
*/
|
1225 |
-
protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0)
|
1226 |
-
{
|
1227 |
-
$notice = 'Connection failed.';
|
1228 |
-
$this->setError(
|
1229 |
-
$notice,
|
1230 |
-
$errno,
|
1231 |
-
$errmsg
|
1232 |
-
);
|
1233 |
-
$this->edebug(
|
1234 |
-
$notice . ' Error #' . $errno . ': ' . $errmsg . " [$errfile line $errline]",
|
1235 |
-
self::DEBUG_CONNECTION
|
1236 |
-
);
|
1237 |
-
}
|
1238 |
-
|
1239 |
-
/**
|
1240 |
-
* Extract and return the ID of the last SMTP transaction based on
|
1241 |
-
* a list of patterns provided in SMTP::$smtp_transaction_id_patterns.
|
1242 |
-
* Relies on the host providing the ID in response to a DATA command.
|
1243 |
-
* If no reply has been received yet, it will return null.
|
1244 |
-
* If no pattern was matched, it will return false.
|
1245 |
-
* @return bool|null|string
|
1246 |
-
*/
|
1247 |
-
protected function recordLastTransactionID()
|
1248 |
-
{
|
1249 |
-
$reply = $this->getLastReply();
|
1250 |
-
|
1251 |
-
if (empty($reply)) {
|
1252 |
-
$this->last_smtp_transaction_id = null;
|
1253 |
-
} else {
|
1254 |
-
$this->last_smtp_transaction_id = false;
|
1255 |
-
foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
|
1256 |
-
if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
|
1257 |
-
$this->last_smtp_transaction_id = $matches[1];
|
1258 |
-
}
|
1259 |
-
}
|
1260 |
-
}
|
1261 |
-
|
1262 |
-
return $this->last_smtp_transaction_id;
|
1263 |
-
}
|
1264 |
-
|
1265 |
-
/**
|
1266 |
-
* Get the queue/transaction ID of the last SMTP transaction
|
1267 |
-
* If no reply has been received yet, it will return null.
|
1268 |
-
* If no pattern was matched, it will return false.
|
1269 |
-
* @return bool|null|string
|
1270 |
-
* @see recordLastTransactionID()
|
1271 |
-
*/
|
1272 |
-
public function getLastTransactionID()
|
1273 |
-
{
|
1274 |
-
return $this->last_smtp_transaction_id;
|
1275 |
-
}
|
1276 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/get_oauth_token.php
DELETED
@@ -1,162 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Get an OAuth2 token from Google.
|
4 |
-
* * Install this script on your server so that it's accessible
|
5 |
-
* as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
|
6 |
-
* e.g.: http://localhost/phpmail/get_oauth_token.php
|
7 |
-
* * Ensure dependencies are installed with 'composer install'
|
8 |
-
* * Set up an app in your Google developer console
|
9 |
-
* * Set the script address as the app's redirect URL
|
10 |
-
* If no refresh token is obtained when running this file, revoke access to your app
|
11 |
-
* using link: https://accounts.google.com/b/0/IssuedAuthSubTokens and run the script again.
|
12 |
-
* This script requires PHP 5.4 or later
|
13 |
-
* PHP Version 5.4
|
14 |
-
*/
|
15 |
-
|
16 |
-
namespace League\OAuth2\Client\Provider;
|
17 |
-
|
18 |
-
require 'vendor/autoload.php';
|
19 |
-
|
20 |
-
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
|
21 |
-
use League\OAuth2\Client\Token\AccessToken;
|
22 |
-
use League\OAuth2\Client\Tool\BearerAuthorizationTrait;
|
23 |
-
use Psr\Http\Message\ResponseInterface;
|
24 |
-
|
25 |
-
session_start();
|
26 |
-
|
27 |
-
//If this automatic URL doesn't work, set it yourself manually
|
28 |
-
$redirectUri = isset($_SERVER['HTTPS']) ? 'https://' : 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
|
29 |
-
//$redirectUri = 'http://localhost/phpmailer/get_oauth_token.php';
|
30 |
-
|
31 |
-
//These details obtained are by setting up app in Google developer console.
|
32 |
-
$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
|
33 |
-
$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
|
34 |
-
|
35 |
-
class Google extends AbstractProvider
|
36 |
-
{
|
37 |
-
use BearerAuthorizationTrait;
|
38 |
-
|
39 |
-
const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'id';
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @var string If set, this will be sent to google as the "access_type" parameter.
|
43 |
-
* @link https://developers.google.com/accounts/docs/OAuth2WebServer#offline
|
44 |
-
*/
|
45 |
-
protected $accessType;
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @var string If set, this will be sent to google as the "hd" parameter.
|
49 |
-
* @link https://developers.google.com/accounts/docs/OAuth2Login#hd-param
|
50 |
-
*/
|
51 |
-
protected $hostedDomain;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @var string If set, this will be sent to google as the "scope" parameter.
|
55 |
-
* @link https://developers.google.com/gmail/api/auth/scopes
|
56 |
-
*/
|
57 |
-
protected $scope;
|
58 |
-
|
59 |
-
public function getBaseAuthorizationUrl()
|
60 |
-
{
|
61 |
-
return 'https://accounts.google.com/o/oauth2/auth';
|
62 |
-
}
|
63 |
-
|
64 |
-
public function getBaseAccessTokenUrl(array $params)
|
65 |
-
{
|
66 |
-
return 'https://accounts.google.com/o/oauth2/token';
|
67 |
-
}
|
68 |
-
|
69 |
-
public function getResourceOwnerDetailsUrl(AccessToken $token)
|
70 |
-
{
|
71 |
-
return ' ';
|
72 |
-
}
|
73 |
-
|
74 |
-
protected function getAuthorizationParameters(array $options)
|
75 |
-
{
|
76 |
-
if (is_array($this->scope)) {
|
77 |
-
$separator = $this->getScopeSeparator();
|
78 |
-
$this->scope = implode($separator, $this->scope);
|
79 |
-
}
|
80 |
-
|
81 |
-
$params = array_merge(
|
82 |
-
parent::getAuthorizationParameters($options),
|
83 |
-
array_filter([
|
84 |
-
'hd' => $this->hostedDomain,
|
85 |
-
'access_type' => $this->accessType,
|
86 |
-
'scope' => $this->scope,
|
87 |
-
// if the user is logged in with more than one account ask which one to use for the login!
|
88 |
-
'authuser' => '-1'
|
89 |
-
])
|
90 |
-
);
|
91 |
-
return $params;
|
92 |
-
}
|
93 |
-
|
94 |
-
protected function getDefaultScopes()
|
95 |
-
{
|
96 |
-
return [
|
97 |
-
'email',
|
98 |
-
'openid',
|
99 |
-
'profile',
|
100 |
-
];
|
101 |
-
}
|
102 |
-
|
103 |
-
protected function getScopeSeparator()
|
104 |
-
{
|
105 |
-
return ' ';
|
106 |
-
}
|
107 |
-
|
108 |
-
protected function checkResponse(ResponseInterface $response, $data)
|
109 |
-
{
|
110 |
-
if (!empty($data['error'])) {
|
111 |
-
$code = 0;
|
112 |
-
$error = $data['error'];
|
113 |
-
|
114 |
-
if (is_array($error)) {
|
115 |
-
$code = $error['code'];
|
116 |
-
$error = $error['message'];
|
117 |
-
}
|
118 |
-
|
119 |
-
throw new IdentityProviderException($error, $code, $data);
|
120 |
-
}
|
121 |
-
}
|
122 |
-
|
123 |
-
protected function createResourceOwner(array $response, AccessToken $token)
|
124 |
-
{
|
125 |
-
return new GoogleUser($response);
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
|
130 |
-
//Set Redirect URI in Developer Console as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
|
131 |
-
$provider = new Google(
|
132 |
-
array(
|
133 |
-
'clientId' => $clientId,
|
134 |
-
'clientSecret' => $clientSecret,
|
135 |
-
'redirectUri' => $redirectUri,
|
136 |
-
'scope' => array('https://mail.google.com/'),
|
137 |
-
'accessType' => 'offline'
|
138 |
-
)
|
139 |
-
);
|
140 |
-
|
141 |
-
if (!isset($_GET['code'])) {
|
142 |
-
// If we don't have an authorization code then get one
|
143 |
-
$authUrl = $provider->getAuthorizationUrl();
|
144 |
-
$_SESSION['oauth2state'] = $provider->getState();
|
145 |
-
header('Location: ' . $authUrl);
|
146 |
-
exit;
|
147 |
-
// Check given state against previously stored one to mitigate CSRF attack
|
148 |
-
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
|
149 |
-
unset($_SESSION['oauth2state']);
|
150 |
-
exit('Invalid state');
|
151 |
-
} else {
|
152 |
-
// Try to get an access token (using the authorization code grant)
|
153 |
-
$token = $provider->getAccessToken(
|
154 |
-
'authorization_code',
|
155 |
-
array(
|
156 |
-
'code' => $_GET['code']
|
157 |
-
)
|
158 |
-
);
|
159 |
-
|
160 |
-
// Use this to get a new access token if the old one expires
|
161 |
-
echo 'Refresh Token: ' . $token->getRefreshToken();
|
162 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-am.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Armenian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Hrayr Grigoryan <hrayr@bits.am>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Հաղորդագրությունը դատարկ է';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Կոդավորման անհայտ տեսակ: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Չհաջողվեց իրականացնել հրամանը: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Ֆայլը հասանելի չէ: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Ֆայլի սխալ: ֆայլը չհաջողվեց բացել: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Ուղարկողի հետևյալ հասցեն սխալ է: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Հնարավոր չէ կանչել mail ֆունկցիան.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Հասցեն սխալ է: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' փոստային սերվերի հետ չի աշխատում.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Անհրաժեշտ է տրամադրել գոնե մեկ ստացողի e-mail հասցե.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP -ի սխալ: չի հաջողվել ուղարկել հետևյալ ստացողների հասցեներին: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Ստորագրման սխալ: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP -ի connect() ֆունկցիան չի հաջողվել';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP սերվերի սխալ: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Չի հաջողվում ստեղծել կամ վերափոխել փոփոխականը: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'Հավելվածը բացակայում է: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-ar.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Arabic PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author bahjat al mostafa <bahjat983@hotmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'خطأ SMTP : لا يمكن تأكيد الهوية.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'خطأ SMTP: لم يتم قبول المعلومات .';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'نص الرسالة فارغ';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'لا يمكن تنفيذ : ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'لا يمكن الوصول للملف: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'خطأ في الملف: لا يمكن فتحه: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'خطأ على مستوى عنوان المرسل : ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة البريد.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية ' .
|
22 |
-
'فشل في الارسال لكل من : ';
|
23 |
-
$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: ';
|
24 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.';
|
25 |
-
$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: ';
|
26 |
-
$PHPMAILER_LANG['variable_set'] = 'لا يمكن تعيين أو إعادة تعيين متغير: ';
|
27 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-az.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Azerbaijani PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author @mirjalal
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP xətası: Giriş uğursuz oldu.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP xətası: SMTP serverinə qoşulma uğursuz oldu.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP xətası: Verilənlər qəbul edilməyib.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Boş mesaj göndərilə bilməz.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Qeyri-müəyyən kodlaşdırma: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Əmr yerinə yetirilmədi: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Fayla giriş yoxdur: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Fayl xətası: Fayl açıla bilmədi: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Göstərilən poçtlara göndərmə uğursuz oldu: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Mail funksiyası işə salına bilmədi.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Düzgün olmayan e-mail adresi: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' - e-mail kitabxanası dəstəklənmir.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Ən azı bir e-mail adresi daxil edilməlidir.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP xətası: Aşağıdakı ünvanlar üzrə alıcılara göndərmə uğursuzdur: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'İmzalama xətası: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP serverinə qoşulma uğursuz oldu.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri xətası: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Dəyişənin quraşdırılması uğursuz oldu: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-ba.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Bosnian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Ermin Islamagić <ermin@islamagic.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela prijava.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Ne moguće se spojiti sa SMTP serverom.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Nepoznata kriptografija: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje sa navedenih e-mail adresa nije uspjelo: ';
|
17 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedene e-mail adrese nije uspjelo: ';
|
18 |
-
$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.';
|
19 |
-
$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: ';
|
20 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.';
|
21 |
-
$PHPMAILER_LANG['provide_address'] = 'Definišite barem jednu adresu primaoca.';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP greška: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-be.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Belarusian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Aleksander Maksymiuk <info@setpro.pl>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'Памылка SMTP: памылка ідэнтыфікацыі.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Памылка SMTP: звесткі непрынятыя.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Пустое паведамленне.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Невядомая кадыроўка тэксту: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Нельга выканаць каманду: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Няма доступу да файла: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Нельга адкрыць файл: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Няправільны адрас адпраўніка: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Нельга прымяніць функцыю mail().';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Нельга даслаць паведамленне, няправільны email атрымальніка: ';
|
19 |
-
$PHPMAILER_LANG['provide_address'] = 'Запоўніце, калі ласка, правільны email атрымальніка.';
|
20 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Памылка SMTP: няправільныя атрымальнікі: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Памылка подпісу паведамлення: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Памылка сувязі з SMTP-серверам.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Памылка SMTP: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-bg.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Bulgarian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Mikhail Kyosev <mialygk@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Не може да се удостовери пред сървъра.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Не може да се свърже с SMTP хоста.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не са приети.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Съдържанието на съобщението е празно';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Неизвестно кодиране: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Не може да се изпълни: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Няма достъп до файл: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Не може да се отвори файл: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Следните адреси за подател са невалидни: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Не може да се инстанцира функцията mail.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Невалиден адрес: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Трябва да предоставите поне един email адрес за получател.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреси за Получател са невалидни: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Грешка при подписване: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP сървърна грешка: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Не може да се установи или възстанови променлива: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'Липсва разширение: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-ca.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Catalan PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Ivan <web AT microstudi DOT com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s’ha pogut autenticar.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'El cos del missatge està buit.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'No es pot executar: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l’arxiu: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Error d’Arxiu: No es pot obrir l’arxiu: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'No s’ha pogut crear una instància de la funció Mail.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Adreça d’email invalida: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'S’ha de proveir almenys una adreça d’email com a destinatari.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Error al signar: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ha fallat el SMTP Connect().';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'No s’ha pogut establir o restablir la variable: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-ch.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Chinese PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author LiuXin <http://www.80x86.cn/blog/>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。';
|
11 |
-
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
12 |
-
$PHPMAILER_LANG['encoding'] = '未知编码:';
|
13 |
-
$PHPMAILER_LANG['execute'] = '不能执行: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = '不能访问文件:';
|
15 |
-
$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。';
|
18 |
-
//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: ';
|
22 |
-
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
23 |
-
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
24 |
-
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
25 |
-
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-cs.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Czech PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
*/
|
6 |
-
|
7 |
-
$PHPMAILER_LANG['authenticate'] = 'Chyba SMTP: Autentizace selhala.';
|
8 |
-
$PHPMAILER_LANG['connect_host'] = 'Chyba SMTP: Nelze navázat spojení se SMTP serverem.';
|
9 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Chyba SMTP: Data nebyla přijata.';
|
10 |
-
$PHPMAILER_LANG['empty_message'] = 'Prázdné tělo zprávy';
|
11 |
-
$PHPMAILER_LANG['encoding'] = 'Neznámé kódování: ';
|
12 |
-
$PHPMAILER_LANG['execute'] = 'Nelze provést: ';
|
13 |
-
$PHPMAILER_LANG['file_access'] = 'Nelze získat přístup k souboru: ';
|
14 |
-
$PHPMAILER_LANG['file_open'] = 'Chyba souboru: Nelze otevřít soubor pro čtení: ';
|
15 |
-
$PHPMAILER_LANG['from_failed'] = 'Následující adresa odesílatele je nesprávná: ';
|
16 |
-
$PHPMAILER_LANG['instantiate'] = 'Nelze vytvořit instanci emailové funkce.';
|
17 |
-
$PHPMAILER_LANG['invalid_address'] = 'Neplatná adresa: ';
|
18 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer není podporován.';
|
19 |
-
$PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoň jednu emailovou adresu příjemce.';
|
20 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Chyba SMTP: Následující adresy příjemců nejsou správně: ';
|
21 |
-
$PHPMAILER_LANG['signing'] = 'Chyba přihlašování: ';
|
22 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() selhal.';
|
23 |
-
$PHPMAILER_LANG['smtp_error'] = 'Chyba SMTP serveru: ';
|
24 |
-
$PHPMAILER_LANG['variable_set'] = 'Nelze nastavit nebo změnit proměnnou: ';
|
25 |
-
$PHPMAILER_LANG['extension_missing'] = 'Chybí rozšíření: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-da.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Danish PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Mikael Stokkebro <info@stokkebro.dk>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.';
|
11 |
-
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.';
|
18 |
-
//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: ';
|
22 |
-
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
23 |
-
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
24 |
-
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
25 |
-
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-de.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* German PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
*/
|
6 |
-
|
7 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.';
|
8 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP-Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
|
9 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-Fehler: Daten werden nicht akzeptiert.';
|
10 |
-
$PHPMAILER_LANG['empty_message'] = 'E-Mail-Inhalt ist leer.';
|
11 |
-
$PHPMAILER_LANG['encoding'] = 'Unbekannte Kodierung: ';
|
12 |
-
$PHPMAILER_LANG['execute'] = 'Konnte folgenden Befehl nicht ausführen: ';
|
13 |
-
$PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschlagen: ';
|
14 |
-
$PHPMAILER_LANG['file_open'] = 'Dateifehler: Konnte folgende Datei nicht öffnen: ';
|
15 |
-
$PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: ';
|
16 |
-
$PHPMAILER_LANG['instantiate'] = 'Mail-Funktion konnte nicht initialisiert werden.';
|
17 |
-
$PHPMAILER_LANG['invalid_address'] = 'Die Adresse ist ungültig: ';
|
18 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
|
19 |
-
$PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfängeradresse an.';
|
20 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-Fehler: Die folgenden Empfänger sind nicht korrekt: ';
|
21 |
-
$PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: ';
|
22 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zum SMTP-Server fehlgeschlagen.';
|
23 |
-
$PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP-Server: ';
|
24 |
-
$PHPMAILER_LANG['variable_set'] = 'Kann Variable nicht setzen oder zurücksetzen: ';
|
25 |
-
$PHPMAILER_LANG['extension_missing'] = 'Fehlende Erweiterung: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-el.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Greek PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
*/
|
6 |
-
|
7 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP Σφάλμα: Αδυναμία πιστοποίησης (authentication).';
|
8 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP Σφάλμα: Αδυναμία σύνδεσης στον SMTP-Host.';
|
9 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Σφάλμα: Τα δεδομένα δεν έγιναν αποδεκτά.';
|
10 |
-
$PHPMAILER_LANG['empty_message'] = 'Το E-Mail δεν έχει περιεχόμενο .';
|
11 |
-
$PHPMAILER_LANG['encoding'] = 'Αγνωστο Encoding-Format: ';
|
12 |
-
$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης ακόλουθης εντολής: ';
|
13 |
-
$PHPMAILER_LANG['file_access'] = 'Αδυναμία προσπέλασης του αρχείου: ';
|
14 |
-
$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Δεν είναι δυνατό το άνοιγμα του ακόλουθου αρχείου: ';
|
15 |
-
$PHPMAILER_LANG['from_failed'] = 'Η παρακάτω διεύθυνση αποστολέα δεν είναι σωστή: ';
|
16 |
-
$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης Mail function.';
|
17 |
-
$PHPMAILER_LANG['invalid_address'] = 'Το μήνυμα δεν εστάλη, η διεύθυνση δεν είναι έγκυρη: ';
|
18 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer δεν υποστηρίζεται.';
|
19 |
-
$PHPMAILER_LANG['provide_address'] = 'Παρακαλούμε δώστε τουλάχιστον μια e-mail διεύθυνση παραλήπτη.';
|
20 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Σφάλμα: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: ';
|
21 |
-
$PHPMAILER_LANG['signing'] = 'Σφάλμα υπογραφής: ';
|
22 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης στον SMTP Server.';
|
23 |
-
$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα από τον SMTP Server: ';
|
24 |
-
$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή αρχικοποίησης μεταβλητής: ';
|
25 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-eo.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Esperanto PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
*/
|
6 |
-
|
7 |
-
$PHPMAILER_LANG['authenticate'] = 'Eraro de servilo SMTP : aŭtentigo malsukcesis.';
|
8 |
-
$PHPMAILER_LANG['connect_host'] = 'Eraro de servilo SMTP : konektado al servilo malsukcesis.';
|
9 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Eraro de servilo SMTP : neĝustaj datumoj.';
|
10 |
-
$PHPMAILER_LANG['empty_message'] = 'Teksto de mesaĝo mankas.';
|
11 |
-
$PHPMAILER_LANG['encoding'] = 'Nekonata kodoprezento: ';
|
12 |
-
$PHPMAILER_LANG['execute'] = 'Lanĉi rulumadon ne eblis: ';
|
13 |
-
$PHPMAILER_LANG['file_access'] = 'Aliro al dosiero ne sukcesis: ';
|
14 |
-
$PHPMAILER_LANG['file_open'] = 'Eraro de dosiero: malfermo neeblas: ';
|
15 |
-
$PHPMAILER_LANG['from_failed'] = 'Jena adreso de sendinto malsukcesis: ';
|
16 |
-
$PHPMAILER_LANG['instantiate'] = 'Genero de retmesaĝa funkcio neeblis.';
|
17 |
-
$PHPMAILER_LANG['invalid_address'] = 'Retadreso ne validas: ';
|
18 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mesaĝilo ne subtenata.';
|
19 |
-
$PHPMAILER_LANG['provide_address'] = 'Vi devas tajpi almenaŭ unu recevontan retadreson.';
|
20 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Eraro de servilo SMTP : la jenaj poŝtrecivuloj kaŭzis eraron: ';
|
21 |
-
$PHPMAILER_LANG['signing'] = 'Eraro de subskribo: ';
|
22 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP konektado malsukcesis.';
|
23 |
-
$PHPMAILER_LANG['smtp_error'] = 'Eraro de servilo SMTP : ';
|
24 |
-
$PHPMAILER_LANG['variable_set'] = 'Variablo ne pravalorizeblas aŭ ne repravalorizeblas: ';
|
25 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-es.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Spanish PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Matt Sturdy <matt.sturdy@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Error al firmar: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-et.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Estonian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Indrek Päri
|
6 |
-
* @author Elan Ruusamäe <glen@delfi.ee>
|
7 |
-
*/
|
8 |
-
|
9 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.';
|
10 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.';
|
11 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.';
|
12 |
-
$PHPMAILER_LANG['empty_message'] = 'Tühi kirja sisu';
|
13 |
-
$PHPMAILER_LANG["encoding"] = 'Tundmatu kodeering: ';
|
14 |
-
$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: ';
|
15 |
-
$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: ';
|
16 |
-
$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: ';
|
17 |
-
$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: ';
|
18 |
-
$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.';
|
19 |
-
$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: ';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.';
|
21 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.';
|
22 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: ';
|
23 |
-
$PHPMAILER_LANG["signing"] = 'Viga allkirjastamisel: ';
|
24 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() ebaõnnestus.';
|
25 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri viga: ';
|
26 |
-
$PHPMAILER_LANG['variable_set'] = 'Ei õnnestunud määrata või lähtestada muutujat: ';
|
27 |
-
$PHPMAILER_LANG['extension_missing'] = 'Nõutud laiendus on puudu: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-fa.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Persian/Farsi PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Ali Jazayeri <jaza.ali@gmail.com>
|
6 |
-
* @author Mohammad Hossein Mojtahedi <mhm5000@gmail.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
$PHPMAILER_LANG['authenticate'] = 'خطای SMTP: احراز هویت با شکست مواجه شد.';
|
10 |
-
$PHPMAILER_LANG['connect_host'] = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.';
|
11 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'خطای SMTP: دادهها نادرست هستند.';
|
12 |
-
$PHPMAILER_LANG['empty_message'] = 'بخش متن پیام خالی است.';
|
13 |
-
$PHPMAILER_LANG['encoding'] = 'کدگذاری ناشناخته: ';
|
14 |
-
$PHPMAILER_LANG['execute'] = 'امکان اجرا وجود ندارد: ';
|
15 |
-
$PHPMAILER_LANG['file_access'] = 'امکان دسترسی به فایل وجود ندارد: ';
|
16 |
-
$PHPMAILER_LANG['file_open'] = 'خطای File: امکان بازکردن فایل وجود ندارد: ';
|
17 |
-
$PHPMAILER_LANG['from_failed'] = 'آدرس فرستنده اشتباه است: ';
|
18 |
-
$PHPMAILER_LANG['instantiate'] = 'امکان معرفی تابع ایمیل وجود ندارد.';
|
19 |
-
$PHPMAILER_LANG['invalid_address'] = 'آدرس ایمیل معتبر نیست: ';
|
20 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمیشود.';
|
21 |
-
$PHPMAILER_LANG['provide_address'] = 'باید حداقل یک آدرس گیرنده وارد کنید.';
|
22 |
-
$PHPMAILER_LANG['recipients_failed'] = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: ';
|
23 |
-
$PHPMAILER_LANG['signing'] = 'خطا در امضا: ';
|
24 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'خطا در اتصال به SMTP.';
|
25 |
-
$PHPMAILER_LANG['smtp_error'] = 'خطا در SMTP Server: ';
|
26 |
-
$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیرها وجود ندارد: ';
|
27 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-fi.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Finnish PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Jyry Kuukanen
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP-virhe: käyttäjätunnistus epäonnistui.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP-virhe: yhteys palvelimeen ei onnistu.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-virhe: data on virheellinen.';
|
11 |
-
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Suoritus epäonnistui: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Seuraavaan tiedostoon ei ole oikeuksia: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Tiedostovirhe: Ei voida avata tiedostoa: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Seuraava lähettäjän osoite on virheellinen: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'mail-funktion luonti epäonnistui.';
|
18 |
-
//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähköpostiosoite.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';
|
22 |
-
$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: ';
|
23 |
-
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
24 |
-
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
25 |
-
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
26 |
-
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
27 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-fo.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Faroese PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Dávur Sørensen <http://www.profo-webdesign.dk>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.';
|
11 |
-
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Ókend encoding: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.';
|
18 |
-
//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: ';
|
22 |
-
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
23 |
-
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
24 |
-
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
25 |
-
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-fr.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* French PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* Some French punctuation requires a thin non-breaking space (U+202F) character before it,
|
6 |
-
* for example before a colon or exclamation mark.
|
7 |
-
* There is one of these characters between these quotes: " "
|
8 |
-
* @link http://unicode.org/udhr/n/notes_fra.html
|
9 |
-
*/
|
10 |
-
|
11 |
-
$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l\'authentification.';
|
12 |
-
$PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : impossible de se connecter au serveur SMTP.';
|
13 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Erreur SMTP : données incorrectes.';
|
14 |
-
$PHPMAILER_LANG['empty_message'] = 'Corps du message vide.';
|
15 |
-
$PHPMAILER_LANG['encoding'] = 'Encodage inconnu : ';
|
16 |
-
$PHPMAILER_LANG['execute'] = 'Impossible de lancer l\'exécution : ';
|
17 |
-
$PHPMAILER_LANG['file_access'] = 'Impossible d\'accéder au fichier : ';
|
18 |
-
$PHPMAILER_LANG['file_open'] = 'Ouverture du fichier impossible : ';
|
19 |
-
$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échoué : ';
|
20 |
-
$PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.';
|
21 |
-
$PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide : ';
|
22 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
|
23 |
-
$PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.';
|
24 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants sont en erreur : ';
|
25 |
-
$PHPMAILER_LANG['signing'] = 'Erreur de signature : ';
|
26 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Échec de la connexion SMTP.';
|
27 |
-
$PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : ';
|
28 |
-
$PHPMAILER_LANG['variable_set'] = 'Impossible d\'initialiser ou de réinitialiser une variable : ';
|
29 |
-
$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-gl.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Galician PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author by Donato Rouco <donatorouco@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Non puido ser autentificado.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Non puido conectar co servidor SMTP.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Datos non aceptados.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Corpo da mensaxe vacía';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Codificación descoñecida: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Non puido ser executado: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Nob puido acceder ó arquivo: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: No puido abrir o arquivo: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Non puido crear unha instancia da función Mail.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Non puido envia-lo correo: dirección de email inválida: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Debe engadir polo menos unha dirección de email coma destino.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Os seguintes destinos fallaron: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Erro ó firmar: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallou.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Non puidemos axustar ou reaxustar a variábel: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-he.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Hebrew PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Ronny Sherer <ronny@hoojima.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'שגיאת SMTP: פעולת האימות נכשלה.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'שגיאת SMTP: מידע לא התקבל.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'גוף ההודעה ריק';
|
12 |
-
$PHPMAILER_LANG['invalid_address'] = 'כתובת שגויה: ';
|
13 |
-
$PHPMAILER_LANG['encoding'] = 'קידוד לא מוכר: ';
|
14 |
-
$PHPMAILER_LANG['execute'] = 'לא הצלחתי להפעיל את: ';
|
15 |
-
$PHPMAILER_LANG['file_access'] = 'לא ניתן לגשת לקובץ: ';
|
16 |
-
$PHPMAILER_LANG['file_open'] = 'שגיאת קובץ: לא ניתן לגשת לקובץ: ';
|
17 |
-
$PHPMAILER_LANG['from_failed'] = 'כתובות הנמענים הבאות נכשלו: ';
|
18 |
-
$PHPMAILER_LANG['instantiate'] = 'לא הצלחתי להפעיל את פונקציית המייל.';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'חובה לספק לפחות כתובת אחת של מקבל המייל.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'שגיאת SMTP: הנמענים הבאים נכשלו: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'שגיאת חתימה: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'שגיאת שרת SMTP: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'לא ניתן לקבוע או לשנות את המשתנה: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-hr.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Croatian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Hrvoj3e <hrvoj3e@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela autentikacija.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Nepoznati encoding: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje s navedenih e-mail adresa nije uspjelo: ';
|
17 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: ';
|
18 |
-
$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.';
|
19 |
-
$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: ';
|
20 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.';
|
21 |
-
$PHPMAILER_LANG['provide_address'] = 'Definirajte barem jednu adresu primatelja.';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP poslužitelj nije uspjelo.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP poslužitelja: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Ne mogu postaviti varijablu niti ju vratiti nazad: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-hu.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Hungarian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author @dominicus-75
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP hiba: az azonosítás sikertelen.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP hiba: nem lehet kapcsolódni az SMTP-szerverhez.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP hiba: adatok visszautasítva.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Üres az üzenettörzs.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Ismeretlen kódolás: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Nem lehet végrehajtani: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'A következő fájl nem elérhető: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Fájl hiba: a következő fájlt nem lehet megnyitni: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'A feladóként megadott következő cím hibás: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'A PHP mail() függvényt nem sikerült végrehajtani.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Érvénytelen cím: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' a mailer-osztály nem támogatott.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Legalább egy címzettet fel kell tüntetni.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP hiba: a címzettként megadott következő címek hibásak: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Hibás aláírás: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Hiba az SMTP-kapcsolatban.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP-szerver hiba: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'A következő változók beállítása nem sikerült: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-id.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Indonesian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Cecep Prawiro <cecep.prawiro@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengautentikasi.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima peladen.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses : ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas : ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Kesalahan File: Berkas tidak bisa dibuka : ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan error : ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi email';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat email tidak valid : ';
|
19 |
-
$PHPMAILER_LANG['provide_address'] = 'Harus disediakan minimal satu alamat tujuan';
|
20 |
-
$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer tidak didukung';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menghasilkan error : ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Kesalahan dalam tanda tangan : ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Kesalahan peladen SMTP : ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Tidak berhasil mengatur atau mengatur ulang variable : ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-it.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Italian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Ilias Bartolini <brain79@inwind.it>
|
6 |
-
* @author Stefano Sabatini <sabas88@gmail.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.';
|
10 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.';
|
11 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dati non accettati dal server.';
|
12 |
-
$PHPMAILER_LANG['empty_message'] = 'Il corpo del messaggio è vuoto';
|
13 |
-
$PHPMAILER_LANG['encoding'] = 'Codifica dei caratteri sconosciuta: ';
|
14 |
-
$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: ';
|
15 |
-
$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: ';
|
16 |
-
$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: ';
|
17 |
-
$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: ';
|
18 |
-
$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail';
|
19 |
-
$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: ';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente';
|
21 |
-
$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato';
|
22 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: ';
|
23 |
-
$PHPMAILER_LANG['signing'] = 'Errore nella firma: ';
|
24 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallita.';
|
25 |
-
$PHPMAILER_LANG['smtp_error'] = 'Errore del server SMTP: ';
|
26 |
-
$PHPMAILER_LANG['variable_set'] = 'Impossibile impostare o resettare la variabile: ';
|
27 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-ja.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Japanese PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Mitsuhiro Yoshida <http://mitstek.com/>
|
6 |
-
* @author Yoshi Sakai <http://bluemooninc.jp/>
|
7 |
-
*/
|
8 |
-
|
9 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。';
|
10 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。';
|
11 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。';
|
12 |
-
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
13 |
-
$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';
|
14 |
-
$PHPMAILER_LANG['execute'] = '実行できませんでした: ';
|
15 |
-
$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';
|
16 |
-
$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';
|
17 |
-
$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: ';
|
18 |
-
$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。';
|
19 |
-
//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
|
21 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
|
22 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: ';
|
23 |
-
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
24 |
-
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
25 |
-
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
26 |
-
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
27 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-ka.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Georgian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.';
|
11 |
-
$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: ';
|
12 |
-
$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: ';
|
13 |
-
$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: ';
|
14 |
-
$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: ';
|
15 |
-
$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: ';
|
16 |
-
$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.';
|
17 |
-
$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.';
|
18 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.';
|
19 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: ';
|
20 |
-
$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია';
|
21 |
-
$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'ხელმოწერის შეცდომა: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'ბიბლიოთეკა არ არსებობს: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-ko.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Korean PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author ChalkPE <amato0617@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP 오류: 인증할 수 없습니다.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP 오류: SMTP 호스트에 접속할 수 없습니다.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 오류: 데이터가 받아들여지지 않았습니다.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = '메세지 내용이 없습니다';
|
12 |
-
$PHPMAILER_LANG['encoding'] = '알 수 없는 인코딩: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = '실행 불가: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = '파일 접근 불가: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = '파일 오류: 파일을 열 수 없습니다: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = '다음 From 주소에서 오류가 발생했습니다: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'mail 함수를 인스턴스화할 수 없습니다';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = '잘못된 주소: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' 메일러는 지원되지 않습니다.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = '적어도 한 개 이상의 수신자 메일 주소를 제공해야 합니다.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 오류: 다음 수신자에서 오류가 발생했습니다: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = '서명 오류: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 연결을 실패하였습니다.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP 서버 오류: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = '변수 설정 및 초기화 불가: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = '확장자 없음: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-lt.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Lithuanian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Dainius Kaupaitis <dk@sum.lt>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP klaida: autentifikacija nepavyko.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP klaida: duomenys nepriimti.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Laiško turinys tuščias';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Neatpažinta koduotė: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Nepavyko įvykdyti komandos: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Byla nepasiekiama: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Bylos klaida: Nepavyksta atidaryti: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Neteisingas siuntėjo adresas: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Nepavyko paleisti mail funkcijos.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Neteisingas adresas: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' pašto stotis nepalaikoma.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Nurodykite bent vieną gavėjo adresą.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP klaida: nepavyko išsiųsti šiems gavėjams: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Prisijungimo klaida: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP susijungimo klaida';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP stoties klaida: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Nepavyko priskirti reikšmės kintamajam: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-lv.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Latvian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Eduards M. <e@npd.lv>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP kļūda: Autorizācija neizdevās.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Kļūda: Nepieņem informāciju.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Ziņojuma teksts ir tukšs';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Neatpazīts kodējums: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Neizdevās izpildīt komandu: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Fails nav pieejams: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Faila kļūda: Nevar atvērt failu: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Nepareiza sūtītāja adrese: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Nevar palaist sūtīšanas funkciju.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Nepareiza adrese: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Lūdzu, norādiet vismaz vienu adresātu.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Autorizācijas kļūda: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP savienojuma kļūda';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP servera kļūda: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Nevar piešķirt mainīgā vērtību: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-ms.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Malaysian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Nawawi Jamili <nawawi@rutweb.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'Ralat SMTP: Tidak dapat pengesahan.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Ralat SMTP: Data tidak diterima oleh pelayan.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Tiada isi untuk mesej';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Pengekodan tidak diketahui: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Tidak dapat melaksanakan: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses fail: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Ralat Fail: Tidak dapat membuka fail: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Berikut merupakan ralat dari alamat e-mel: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Tidak dapat memberi contoh fungsi e-mel.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Alamat emel tidak sah: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Ralat SMTP: Penerima e-mel berikut telah gagal: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Ralat pada tanda tangan: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() telah gagal.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Ralat pada pelayan SMTP: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-nb.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Norwegian Bokmål PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
*/
|
6 |
-
|
7 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP Feil: Kunne ikke autentisere.';
|
8 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP Feil: Kunne ikke koble til SMTP tjener.';
|
9 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Feil: Datainnhold ikke akseptert.';
|
10 |
-
$PHPMAILER_LANG['empty_message'] = 'Melding kropp tomt';
|
11 |
-
$PHPMAILER_LANG['encoding'] = 'Ukjent koding: ';
|
12 |
-
$PHPMAILER_LANG['execute'] = 'Kunne ikke utføre: ';
|
13 |
-
$PHPMAILER_LANG['file_access'] = 'Får ikke tilgang til filen: ';
|
14 |
-
$PHPMAILER_LANG['file_open'] = 'Fil Feil: Kunne ikke åpne filen: ';
|
15 |
-
$PHPMAILER_LANG['from_failed'] = 'Følgende Frå adresse feilet: ';
|
16 |
-
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere post funksjon.';
|
17 |
-
$PHPMAILER_LANG['invalid_address'] = 'Ugyldig adresse: ';
|
18 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' sender er ikke støttet.';
|
19 |
-
$PHPMAILER_LANG['provide_address'] = 'Du må opppgi minst en mottakeradresse.';
|
20 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottakeradresse feilet: ';
|
21 |
-
$PHPMAILER_LANG['signing'] = 'Signering Feil: ';
|
22 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() feilet.';
|
23 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP server feil: ';
|
24 |
-
$PHPMAILER_LANG['variable_set'] = 'Kan ikke skrive eller omskrive variabel: ';
|
25 |
-
$PHPMAILER_LANG['extension_missing'] = 'Utvidelse mangler: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-nl.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Dutch PHPMailer language file: refer to class.phpmailer.php for definitive list.
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Tuxion <team@tuxion.nl>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Onbekende codering: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Signeerfout: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-pl.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Polish PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
*/
|
6 |
-
|
7 |
-
$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić uwierzytelnienia.';
|
8 |
-
$PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.';
|
9 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.';
|
10 |
-
$PHPMAILER_LANG['empty_message'] = 'Wiadomość jest pusta.';
|
11 |
-
$PHPMAILER_LANG['encoding'] = 'Nieznany sposób kodowania znaków: ';
|
12 |
-
$PHPMAILER_LANG['execute'] = 'Nie można uruchomić: ';
|
13 |
-
$PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: ';
|
14 |
-
$PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: ';
|
15 |
-
$PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest nieprawidłowy: ';
|
16 |
-
$PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';
|
17 |
-
$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, '.
|
18 |
-
'następujący adres Odbiorcy jest nieprawidłowy: ';
|
19 |
-
$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.';
|
20 |
-
$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zakończone niepowodzeniem.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-pt.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Portuguese (European) PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Jonadabe <jonadabe@hotmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Erro ao assinar: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-pt_br.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Brazilian Portuguese PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Paulo Henrique Garcia <paulo@controllerweb.com.br>
|
6 |
-
* @author Lucas Guimarães <lucas@lucasguimaraes.com>
|
7 |
-
* @author Phelipe Alves <phelipealvesdesouza@gmail.com>
|
8 |
-
* @author Fabio Beneditto <fabiobeneditto@gmail.com>
|
9 |
-
*/
|
10 |
-
|
11 |
-
$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.';
|
12 |
-
$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.';
|
13 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.';
|
14 |
-
$PHPMAILER_LANG['empty_message'] = 'Mensagem vazia';
|
15 |
-
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
|
16 |
-
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
|
17 |
-
$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: ';
|
18 |
-
$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
|
19 |
-
$PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: ';
|
20 |
-
$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
|
21 |
-
$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: ';
|
22 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
|
23 |
-
$PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.';
|
24 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: ';
|
25 |
-
$PHPMAILER_LANG['signing'] = 'Erro de Assinatura: ';
|
26 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.';
|
27 |
-
$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: ';
|
28 |
-
$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
|
29 |
-
$PHPMAILER_LANG['extension_missing'] = 'Extensão ausente: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-ro.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Romanian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Alex Florea <alecz.fia@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fișier: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Eroare fișier: Nu se poate deschide următorul fișier: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Funcția mail nu a putut fi inițializată.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugați cel puțin o adresă de email.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eșuat: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-rs.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Serbian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Александар Јевремовић <ajevremovic@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није успела.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: није могуће повезивање са SMTP сервером.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци нису прихваћени.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Непознато кодовање: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Није могуће извршити наредбу: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Није могуће приступити датотеци: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Није могуће отворити датотеку: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'SMTP грешка: слање са следећих адреса није успело: ';
|
17 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: слање на следеће адресе није успело: ';
|
18 |
-
$PHPMAILER_LANG['instantiate'] = 'Није могуће покренути mail функцију.';
|
19 |
-
$PHPMAILER_LANG['invalid_address'] = 'Порука није послата због неисправне адресе: ';
|
20 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.';
|
21 |
-
$PHPMAILER_LANG['provide_address'] = 'Потребно је задати најмање једну адресу.';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Грешка приликом пријављивања: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Повезивање са SMTP сервером није успело.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Грешка SMTP сервера: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Није могуће задати променљиву, нити је вратити уназад: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'Недостаје проширење: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-ru.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Russian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Alexey Chumakov <alex@chumakov.ru>
|
6 |
-
* @author Foster Snowhill <i18n@forstwoof.ru>
|
7 |
-
*/
|
8 |
-
|
9 |
-
$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.';
|
10 |
-
$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к серверу SMTP.';
|
11 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Неизвестный вид кодировки: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail.';
|
18 |
-
$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
|
20 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: ';
|
21 |
-
$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение';
|
22 |
-
$PHPMAILER_LANG['invalid_address'] = 'Не отослано, неправильный формат email адреса: ';
|
23 |
-
$PHPMAILER_LANG['signing'] = 'Ошибка подписи: ';
|
24 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером';
|
25 |
-
$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: ';
|
26 |
-
$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или переустановить переменную: ';
|
27 |
-
$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-sk.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Slovak PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Michal Tinka <michaltinka@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dáta neboli prijaté';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Prázdne telo správy.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Neznáme kódovanie: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Nedá sa vykonať: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre čítanie: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviť alebo resetovať premennú: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-sl.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Slovene PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Klemen Tušar <techouse@gmail.com>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Ne morem vzpostaviti povezave s SMTP gostiteljem.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Operacija ni uspela: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Prosim vnesite vsaj enega naslovnika.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-sv.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Swedish PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Johan Linnér <johan@linner.biz>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.';
|
11 |
-
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Kunde inte köra: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: ';
|
19 |
-
$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.';
|
20 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Signerings fel: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP server fel: ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: ';
|
26 |
-
$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-tr.php
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Turkish PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Elçin Özel
|
6 |
-
* @author Can Yılmaz
|
7 |
-
* @author Mehmet Benlioğlu
|
8 |
-
* @author @yasinaydin
|
9 |
-
* @author Ogün Karakuş
|
10 |
-
*/
|
11 |
-
|
12 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Oturum açılamadı.';
|
13 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP sunucusuna bağlanılamadı.';
|
14 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatası: Veri kabul edilmedi.';
|
15 |
-
$PHPMAILER_LANG['empty_message'] = 'Mesajın içeriği boş';
|
16 |
-
$PHPMAILER_LANG['encoding'] = 'Bilinmeyen karakter kodlama: ';
|
17 |
-
$PHPMAILER_LANG['execute'] = 'Çalıştırılamadı: ';
|
18 |
-
$PHPMAILER_LANG['file_access'] = 'Dosyaya erişilemedi: ';
|
19 |
-
$PHPMAILER_LANG['file_open'] = 'Dosya Hatası: Dosya açılamadı: ';
|
20 |
-
$PHPMAILER_LANG['from_failed'] = 'Belirtilen adreslere gönderme başarısız: ';
|
21 |
-
$PHPMAILER_LANG['instantiate'] = 'Örnek e-posta fonksiyonu oluşturulamadı.';
|
22 |
-
$PHPMAILER_LANG['invalid_address'] = 'Geçersiz e-posta adresi: ';
|
23 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.';
|
24 |
-
$PHPMAILER_LANG['provide_address'] = 'En az bir alıcı e-posta adresi belirtmelisiniz.';
|
25 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: ';
|
26 |
-
$PHPMAILER_LANG['signing'] = 'İmzalama hatası: ';
|
27 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() fonksiyonu başarısız.';
|
28 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP sunucu hatası: ';
|
29 |
-
$PHPMAILER_LANG['variable_set'] = 'Değişken ayarlanamadı ya da sıfırlanamadı: ';
|
30 |
-
$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-uk.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Ukrainian PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author Yuriy Rudyy <yrudyy@prs.net.ua>
|
6 |
-
* @fixed by Boris Yurchenko <boris@yurchenko.pp.ua>
|
7 |
-
*/
|
8 |
-
|
9 |
-
$PHPMAILER_LANG['authenticate'] = 'Помилка SMTP: помилка авторизації.';
|
10 |
-
$PHPMAILER_LANG['connect_host'] = 'Помилка SMTP: не вдається під\'єднатися до серверу SMTP.';
|
11 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Помилка SMTP: дані не прийняті.';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Невідомий тип кодування: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Неможливо виконати команду: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Немає доступу до файлу: ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail.';
|
18 |
-
$PHPMAILER_LANG['provide_address'] = 'Будь-ласка, введіть хоча б одну адресу e-mail отримувача.';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.';
|
20 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: відправлення наступним отримувачам не вдалося: ';
|
21 |
-
$PHPMAILER_LANG['empty_message'] = 'Пусте тіло повідомлення';
|
22 |
-
$PHPMAILER_LANG['invalid_address'] = 'Не відправлено, невірний формат адреси e-mail: ';
|
23 |
-
$PHPMAILER_LANG['signing'] = 'Помилка підпису: ';
|
24 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання із SMTP-сервером';
|
25 |
-
$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: ';
|
26 |
-
$PHPMAILER_LANG['variable_set'] = 'Неможливо встановити або перевстановити змінну: ';
|
27 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-vi.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list.
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author VINADES.,JSC <contact@vinades.vn>
|
6 |
-
*/
|
7 |
-
|
8 |
-
$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.';
|
9 |
-
$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.';
|
10 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.';
|
11 |
-
$PHPMAILER_LANG['empty_message'] = 'Không có nội dung';
|
12 |
-
$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: ';
|
13 |
-
$PHPMAILER_LANG['execute'] = 'Không thực hiện được: ';
|
14 |
-
$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin ';
|
15 |
-
$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: ';
|
16 |
-
$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: ';
|
17 |
-
$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.';
|
18 |
-
$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng: ';
|
19 |
-
$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.';
|
20 |
-
$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.';
|
21 |
-
$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: ';
|
22 |
-
$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: ';
|
23 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP';
|
24 |
-
$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp ';
|
25 |
-
$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: ';
|
26 |
-
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-zh.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Traditional Chinese PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author liqwei <liqwei@liqwei.com>
|
6 |
-
* @author Peter Dave Hello <@PeterDaveHello/>
|
7 |
-
* @author Jason Chiang <xcojad@gmail.com>
|
8 |
-
*/
|
9 |
-
|
10 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。';
|
11 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。';
|
12 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。';
|
13 |
-
$PHPMAILER_LANG['empty_message'] = '郵件內容為空';
|
14 |
-
$PHPMAILER_LANG['encoding'] = '未知編碼: ';
|
15 |
-
$PHPMAILER_LANG['execute'] = '無法執行:';
|
16 |
-
$PHPMAILER_LANG['file_access'] = '無法存取檔案:';
|
17 |
-
$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:';
|
18 |
-
$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:';
|
19 |
-
$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。';
|
20 |
-
$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: ';
|
21 |
-
$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。';
|
22 |
-
$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。';
|
23 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:以下收件人地址錯誤:';
|
24 |
-
$PHPMAILER_LANG['signing'] = '電子簽章錯誤: ';
|
25 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 連線失敗';
|
26 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺服器錯誤: ';
|
27 |
-
$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: ';
|
28 |
-
$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHPMailer/language/phpmailer.lang-zh_cn.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Simplified Chinese PHPMailer language file: refer to English translation for definitive list
|
4 |
-
* @package PHPMailer
|
5 |
-
* @author liqwei <liqwei@liqwei.com>
|
6 |
-
* @author young <masxy@foxmail.com>
|
7 |
-
* @author Teddysun <i@teddysun.com>
|
8 |
-
*/
|
9 |
-
|
10 |
-
$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。';
|
11 |
-
$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。';
|
12 |
-
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。';
|
13 |
-
$PHPMAILER_LANG['empty_message'] = '邮件正文为空。';
|
14 |
-
$PHPMAILER_LANG['encoding'] = '未知编码:';
|
15 |
-
$PHPMAILER_LANG['execute'] = '无法执行:';
|
16 |
-
$PHPMAILER_LANG['file_access'] = '无法访问文件:';
|
17 |
-
$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:';
|
18 |
-
$PHPMAILER_LANG['from_failed'] = '发送地址错误:';
|
19 |
-
$PHPMAILER_LANG['instantiate'] = '未知函数调用。';
|
20 |
-
$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的:';
|
21 |
-
$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。';
|
22 |
-
$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。';
|
23 |
-
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:';
|
24 |
-
$PHPMAILER_LANG['signing'] = '登录失败:';
|
25 |
-
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。';
|
26 |
-
$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:';
|
27 |
-
$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:';
|
28 |
-
$PHPMAILER_LANG['extension_missing'] = '丢失模块 Extension:';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.phpmaileroauth.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
class PHPMailerOAuth extends \PHPMailer {
|
3 |
|
4 |
/**
|
5 |
* The OAuth user's email address
|
@@ -110,7 +110,7 @@ class PHPMailerOAuth extends \PHPMailer {
|
|
110 |
if ('tls' === $secure or 'ssl' === $secure) {
|
111 |
//Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
|
112 |
if (!$sslext) {
|
113 |
-
throw new \
|
114 |
}
|
115 |
}
|
116 |
$host = $hostinfo[3];
|
@@ -137,7 +137,7 @@ class PHPMailerOAuth extends \PHPMailer {
|
|
137 |
}
|
138 |
if ($tls) {
|
139 |
if (!$this->smtp->startTLS()) {
|
140 |
-
throw new \
|
141 |
}
|
142 |
// We must resend HELO after tls negotiation
|
143 |
$this->smtp->hello($hello);
|
@@ -147,16 +147,14 @@ class PHPMailerOAuth extends \PHPMailer {
|
|
147 |
$this->Username,
|
148 |
$this->Password,
|
149 |
$this->AuthType,
|
150 |
-
$this->Realm,
|
151 |
-
$this->Workstation,
|
152 |
$this->oauth
|
153 |
)
|
154 |
) {
|
155 |
-
throw new \
|
156 |
}
|
157 |
}
|
158 |
return true;
|
159 |
-
} catch (\
|
160 |
$lastexception = $exc;
|
161 |
$this->edebug($exc->getMessage());
|
162 |
// We must have connected, but then failed TLS or Auth, so close connection nicely
|
1 |
<?php
|
2 |
+
class PHPMailerOAuth extends \PHPMailer\PHPMailer\PHPMailer {
|
3 |
|
4 |
/**
|
5 |
* The OAuth user's email address
|
110 |
if ('tls' === $secure or 'ssl' === $secure) {
|
111 |
//Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
|
112 |
if (!$sslext) {
|
113 |
+
throw new \PHPMailer\PHPMailer\Exception($this->lang('extension_missing').'openssl', self::STOP_CRITICAL);
|
114 |
}
|
115 |
}
|
116 |
$host = $hostinfo[3];
|
137 |
}
|
138 |
if ($tls) {
|
139 |
if (!$this->smtp->startTLS()) {
|
140 |
+
throw new \PHPMailer\PHPMailer\Exception($this->lang('connect_host'));
|
141 |
}
|
142 |
// We must resend HELO after tls negotiation
|
143 |
$this->smtp->hello($hello);
|
147 |
$this->Username,
|
148 |
$this->Password,
|
149 |
$this->AuthType,
|
|
|
|
|
150 |
$this->oauth
|
151 |
)
|
152 |
) {
|
153 |
+
throw new \PHPMailer\PHPMailer\Exception($this->lang('authenticate'));
|
154 |
}
|
155 |
}
|
156 |
return true;
|
157 |
+
} catch (\PHPMailer\PHPMailer\Exception $exc) {
|
158 |
$lastexception = $exc;
|
159 |
$this->edebug($exc->getMessage());
|
160 |
// We must have connected, but then failed TLS or Auth, so close connection nicely
|
main.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Gmail SMTP
|
4 |
-
Version: 1.
|
5 |
Plugin URI: https://wphowto.net/gmail-smtp-plugin-for-wordpress-1341
|
6 |
Author: naa986
|
7 |
Author URI: https://wphowto.net/
|
@@ -16,8 +16,8 @@ if (!defined('ABSPATH')){
|
|
16 |
|
17 |
class GMAIL_SMTP {
|
18 |
|
19 |
-
var $plugin_version = '1.
|
20 |
-
var $phpmailer_version = '
|
21 |
var $google_api_client_version = '2.2.0';
|
22 |
var $plugin_url;
|
23 |
var $plugin_path;
|
@@ -135,10 +135,10 @@ class GMAIL_SMTP {
|
|
135 |
function plugin_init(){
|
136 |
if(is_admin()){
|
137 |
if(isset($_GET['action']) && $_GET['action'] == "oauth_grant"){
|
|
|
138 |
include_once('google-api-php-client/vendor/autoload.php');
|
139 |
-
include_once('PHPMailer/PHPMailerAutoload.php');
|
140 |
include_once('class.phpmaileroauthgoogle.php');
|
141 |
-
|
142 |
if (isset($_GET['code'])) {
|
143 |
$authCode = $_GET['code'];
|
144 |
$accessToken = GmailXOAuth2::resetCredentials($authCode);
|
@@ -581,392 +581,399 @@ $GLOBALS['gmail-smtp'] = new GMAIL_SMTP();
|
|
581 |
|
582 |
if(!function_exists('wp_mail') && is_gmail_smtp_configured()){
|
583 |
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
624 |
|
625 |
-
|
626 |
-
include_once('PHPMailer/PHPMailerAutoload.php');
|
627 |
-
include_once('class.phpmaileroauthgoogle.php');
|
628 |
-
include_once('class.phpmaileroauth.php');
|
629 |
|
630 |
-
|
631 |
-
|
632 |
-
$phpmailer = new PHPMailerOAuth; /* this must be the custom class we created */
|
633 |
-
|
634 |
-
// Tell PHPMailer to use SMTP
|
635 |
-
$phpmailer->isSMTP();
|
636 |
-
|
637 |
-
// Set AuthType
|
638 |
-
$phpmailer->AuthType = 'XOAUTH2';
|
639 |
-
|
640 |
-
// Whether to use SMTP authentication
|
641 |
-
$phpmailer->SMTPAuth = true;
|
642 |
-
|
643 |
-
// Set the encryption system to use - ssl (deprecated) or tls
|
644 |
-
$phpmailer->SMTPSecure = $options['type_of_encryption'];
|
645 |
-
|
646 |
-
// Set the hostname of the mail server
|
647 |
-
$phpmailer->Host = 'smtp.gmail.com';
|
648 |
-
|
649 |
-
// Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
|
650 |
-
$phpmailer->Port = $options['smtp_port'];
|
651 |
-
|
652 |
-
$phpmailer->SMTPAutoTLS = false;
|
653 |
-
|
654 |
-
//enable debug when sending a test mail
|
655 |
-
if(isset($_POST['gmail_smtp_send_test_email'])){
|
656 |
-
$phpmailer->SMTPDebug = 4;
|
657 |
-
// Ask for HTML-friendly debug output
|
658 |
-
$phpmailer->Debugoutput = 'html';
|
659 |
-
}
|
660 |
-
|
661 |
-
//disable ssl certificate verification if checked
|
662 |
-
if(isset($options['disable_ssl_verification']) && !empty($options['disable_ssl_verification'])){
|
663 |
-
$phpmailer->SMTPOptions = array(
|
664 |
-
'ssl' => array(
|
665 |
-
'verify_peer' => false,
|
666 |
-
'verify_peer_name' => false,
|
667 |
-
'allow_self_signed' => true
|
668 |
-
)
|
669 |
-
);
|
670 |
-
}
|
671 |
-
// User Email to use for SMTP authentication - Use the same Email used in Google Developer Console
|
672 |
-
$phpmailer->oauthUserEmail = $options['oauth_user_email'];
|
673 |
-
|
674 |
-
//Obtained From Google Developer Console
|
675 |
-
$phpmailer->oauthClientId = $options['oauth_client_id'];
|
676 |
|
677 |
-
|
678 |
-
|
679 |
|
680 |
-
|
|
|
681 |
|
682 |
-
|
683 |
-
|
684 |
-
// eg: http://localhost/phpmail/get_oauth_token.php
|
685 |
-
$phpmailer->oauthRefreshToken = $gmail_token['refresh_token'];
|
686 |
|
687 |
-
|
688 |
-
|
689 |
-
$bcc = array();
|
690 |
-
$reply_to = array();
|
691 |
|
692 |
-
|
693 |
-
|
694 |
-
} else {
|
695 |
-
if ( ! is_array( $headers ) ) {
|
696 |
-
// Explode the headers out, so this function can take both
|
697 |
-
// string headers and an array of headers.
|
698 |
-
$tempheaders = explode( "\n", str_replace( "\r\n", "\n", $headers ) );
|
699 |
-
} else {
|
700 |
-
$tempheaders = $headers;
|
701 |
-
}
|
702 |
-
$headers = array();
|
703 |
-
|
704 |
-
// If it's actually got contents
|
705 |
-
if ( ! empty( $tempheaders ) ) {
|
706 |
-
// Iterate through the raw headers
|
707 |
-
foreach ( (array) $tempheaders as $header ) {
|
708 |
-
if ( strpos( $header, ':' ) === false ) {
|
709 |
-
if ( false !== stripos( $header, 'boundary=' ) ) {
|
710 |
-
$parts = preg_split( '/boundary=/i', trim( $header ) );
|
711 |
-
$boundary = trim( str_replace( array( "'", '"' ), '', $parts[1] ) );
|
712 |
-
}
|
713 |
-
continue;
|
714 |
-
}
|
715 |
-
// Explode them out
|
716 |
-
list( $name, $content ) = explode( ':', trim( $header ), 2 );
|
717 |
-
|
718 |
-
// Cleanup crew
|
719 |
-
$name = trim( $name );
|
720 |
-
$content = trim( $content );
|
721 |
-
|
722 |
-
switch ( strtolower( $name ) ) {
|
723 |
-
// Mainly for legacy -- process a From: header if it's there
|
724 |
-
case 'from':
|
725 |
-
$bracket_pos = strpos( $content, '<' );
|
726 |
-
if ( $bracket_pos !== false ) {
|
727 |
-
// Text before the bracketed email is the "From" name.
|
728 |
-
if ( $bracket_pos > 0 ) {
|
729 |
-
$from_name = substr( $content, 0, $bracket_pos - 1 );
|
730 |
-
$from_name = str_replace( '"', '', $from_name );
|
731 |
-
$from_name = trim( $from_name );
|
732 |
-
}
|
733 |
-
|
734 |
-
$from_email = substr( $content, $bracket_pos + 1 );
|
735 |
-
$from_email = str_replace( '>', '', $from_email );
|
736 |
-
$from_email = trim( $from_email );
|
737 |
-
|
738 |
-
// Avoid setting an empty $from_email.
|
739 |
-
} elseif ( '' !== trim( $content ) ) {
|
740 |
-
$from_email = trim( $content );
|
741 |
-
}
|
742 |
-
break;
|
743 |
-
case 'content-type':
|
744 |
-
if ( strpos( $content, ';' ) !== false ) {
|
745 |
-
list( $type, $charset_content ) = explode( ';', $content );
|
746 |
-
$content_type = trim( $type );
|
747 |
-
if ( false !== stripos( $charset_content, 'charset=' ) ) {
|
748 |
-
$charset = trim( str_replace( array( 'charset=', '"' ), '', $charset_content ) );
|
749 |
-
} elseif ( false !== stripos( $charset_content, 'boundary=' ) ) {
|
750 |
-
$boundary = trim( str_replace( array( 'BOUNDARY=', 'boundary=', '"' ), '', $charset_content ) );
|
751 |
-
$charset = '';
|
752 |
-
}
|
753 |
-
|
754 |
-
// Avoid setting an empty $content_type.
|
755 |
-
} elseif ( '' !== trim( $content ) ) {
|
756 |
-
$content_type = trim( $content );
|
757 |
-
}
|
758 |
-
break;
|
759 |
-
case 'cc':
|
760 |
-
$cc = array_merge( (array) $cc, explode( ',', $content ) );
|
761 |
-
break;
|
762 |
-
case 'bcc':
|
763 |
-
$bcc = array_merge( (array) $bcc, explode( ',', $content ) );
|
764 |
-
break;
|
765 |
-
case 'reply-to':
|
766 |
-
$reply_to = array_merge( (array) $reply_to, explode( ',', $content ) );
|
767 |
-
break;
|
768 |
-
default:
|
769 |
-
// Add it to our grand headers array
|
770 |
-
$headers[ trim( $name ) ] = trim( $content );
|
771 |
-
break;
|
772 |
-
}
|
773 |
-
}
|
774 |
-
}
|
775 |
-
}
|
776 |
|
777 |
-
|
778 |
-
|
779 |
-
$phpmailer->clearAttachments();
|
780 |
-
$phpmailer->clearCustomHeaders();
|
781 |
-
$phpmailer->clearReplyTos();
|
782 |
|
783 |
-
|
784 |
-
// If we don't have a name from the input headers
|
785 |
-
if ( ! isset( $from_name ) ) {
|
786 |
-
$from_name = $options['from_name'];//'WordPress';
|
787 |
-
}
|
788 |
-
|
789 |
-
/* If we don't have an email from the input headers default to wordpress@$sitename
|
790 |
-
* Some hosts will block outgoing mail from this address if it doesn't exist but
|
791 |
-
* there's no easy alternative. Defaulting to admin_email might appear to be another
|
792 |
-
* option but some hosts may refuse to relay mail from an unknown domain. See
|
793 |
-
* https://core.trac.wordpress.org/ticket/5007.
|
794 |
-
*/
|
795 |
-
|
796 |
-
if ( ! isset( $from_email ) ) {
|
797 |
-
// Get the site domain and get rid of www.
|
798 |
-
$sitename = strtolower( $_SERVER['SERVER_NAME'] );
|
799 |
-
if ( substr( $sitename, 0, 4 ) == 'www.' ) {
|
800 |
-
$sitename = substr( $sitename, 4 );
|
801 |
-
}
|
802 |
-
|
803 |
-
$from_email = $options['from_email'];//'wordpress@' . $sitename;
|
804 |
-
}
|
805 |
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
* @param string $from_email Email address to send from.
|
812 |
-
*/
|
813 |
-
$from_email = apply_filters( 'wp_mail_from', $from_email );
|
814 |
-
|
815 |
-
/**
|
816 |
-
* Filters the name to associate with the "from" email address.
|
817 |
-
*
|
818 |
-
* @since 2.3.0
|
819 |
-
*
|
820 |
-
* @param string $from_name Name associated with the "from" email address.
|
821 |
-
*/
|
822 |
-
$from_name = apply_filters( 'wp_mail_from_name', $from_name );
|
823 |
-
|
824 |
-
try {
|
825 |
-
$phpmailer->setFrom( $from_email, $from_name, false );
|
826 |
-
} catch ( phpmailerException $e ) {
|
827 |
-
$mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' );
|
828 |
-
$mail_error_data['phpmailer_exception_code'] = $e->getCode();
|
829 |
-
|
830 |
-
/** This filter is documented in wp-includes/pluggable.php */
|
831 |
-
do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) );
|
832 |
-
|
833 |
-
return false;
|
834 |
-
}
|
835 |
-
|
836 |
-
// Set mail's subject and body
|
837 |
-
$phpmailer->Subject = $subject;
|
838 |
-
$phpmailer->Body = $message;
|
839 |
-
|
840 |
-
// Set destination addresses, using appropriate methods for handling addresses
|
841 |
-
$address_headers = compact( 'to', 'cc', 'bcc', 'reply_to' );
|
842 |
-
|
843 |
-
foreach ( $address_headers as $address_header => $addresses ) {
|
844 |
-
if ( empty( $addresses ) ) {
|
845 |
-
continue;
|
846 |
}
|
847 |
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
972 |
}
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Gmail SMTP
|
4 |
+
Version: 1.2.0
|
5 |
Plugin URI: https://wphowto.net/gmail-smtp-plugin-for-wordpress-1341
|
6 |
Author: naa986
|
7 |
Author URI: https://wphowto.net/
|
16 |
|
17 |
class GMAIL_SMTP {
|
18 |
|
19 |
+
var $plugin_version = '1.2.0';
|
20 |
+
var $phpmailer_version = '6.1.6';
|
21 |
var $google_api_client_version = '2.2.0';
|
22 |
var $plugin_url;
|
23 |
var $plugin_path;
|
135 |
function plugin_init(){
|
136 |
if(is_admin()){
|
137 |
if(isset($_GET['action']) && $_GET['action'] == "oauth_grant"){
|
138 |
+
|
139 |
include_once('google-api-php-client/vendor/autoload.php');
|
|
|
140 |
include_once('class.phpmaileroauthgoogle.php');
|
141 |
+
|
142 |
if (isset($_GET['code'])) {
|
143 |
$authCode = $_GET['code'];
|
144 |
$accessToken = GmailXOAuth2::resetCredentials($authCode);
|
581 |
|
582 |
if(!function_exists('wp_mail') && is_gmail_smtp_configured()){
|
583 |
|
584 |
+
function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
|
585 |
+
// Compact the input, apply the filters, and extract them back out.
|
586 |
+
|
587 |
+
/**
|
588 |
+
* Filters the wp_mail() arguments.
|
589 |
+
*
|
590 |
+
* @since 2.2.0
|
591 |
+
*
|
592 |
+
* @param array $args A compacted array of wp_mail() arguments, including the "to" email,
|
593 |
+
* subject, message, headers, and attachments values.
|
594 |
+
*/
|
595 |
+
$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );
|
596 |
+
|
597 |
+
if ( isset( $atts['to'] ) ) {
|
598 |
+
$to = $atts['to'];
|
599 |
+
}
|
600 |
+
|
601 |
+
if ( ! is_array( $to ) ) {
|
602 |
+
$to = explode( ',', $to );
|
603 |
+
}
|
604 |
+
|
605 |
+
if ( isset( $atts['subject'] ) ) {
|
606 |
+
$subject = $atts['subject'];
|
607 |
+
}
|
608 |
+
|
609 |
+
if ( isset( $atts['message'] ) ) {
|
610 |
+
$message = $atts['message'];
|
611 |
+
}
|
612 |
+
|
613 |
+
if ( isset( $atts['headers'] ) ) {
|
614 |
+
$headers = $atts['headers'];
|
615 |
+
}
|
616 |
+
|
617 |
+
if ( isset( $atts['attachments'] ) ) {
|
618 |
+
$attachments = $atts['attachments'];
|
619 |
+
}
|
620 |
+
|
621 |
+
if ( ! is_array( $attachments ) ) {
|
622 |
+
$attachments = explode( "\n", str_replace( "\r\n", "\n", $attachments ) );
|
623 |
+
}
|
624 |
+
|
625 |
+
require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php';
|
626 |
+
require_once ABSPATH . WPINC . '/PHPMailer/SMTP.php';
|
627 |
+
require_once ABSPATH . WPINC . '/PHPMailer/Exception.php';
|
628 |
+
include_once('google-api-php-client/vendor/autoload.php');
|
629 |
+
include_once('class.phpmaileroauthgoogle.php');
|
630 |
+
include_once('class.phpmaileroauth.php');
|
631 |
|
632 |
+
$options = gmail_smtp_get_option();
|
|
|
|
|
|
|
633 |
|
634 |
+
$phpmailer = new PHPMailerOAuth; /* this must be the custom class we created */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
635 |
|
636 |
+
// Tell PHPMailer to use SMTP
|
637 |
+
$phpmailer->isSMTP();
|
638 |
|
639 |
+
// Set AuthType
|
640 |
+
$phpmailer->AuthType = 'XOAUTH2';
|
641 |
|
642 |
+
// Whether to use SMTP authentication
|
643 |
+
$phpmailer->SMTPAuth = true;
|
|
|
|
|
644 |
|
645 |
+
// Set the encryption system to use - ssl (deprecated) or tls
|
646 |
+
$phpmailer->SMTPSecure = $options['type_of_encryption'];
|
|
|
|
|
647 |
|
648 |
+
// Set the hostname of the mail server
|
649 |
+
$phpmailer->Host = 'smtp.gmail.com';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
650 |
|
651 |
+
// Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
|
652 |
+
$phpmailer->Port = $options['smtp_port'];
|
|
|
|
|
|
|
653 |
|
654 |
+
$phpmailer->SMTPAutoTLS = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
|
656 |
+
//enable debug when sending a test mail
|
657 |
+
if(isset($_POST['gmail_smtp_send_test_email'])){
|
658 |
+
$phpmailer->SMTPDebug = 4;
|
659 |
+
// Ask for HTML-friendly debug output
|
660 |
+
$phpmailer->Debugoutput = 'html';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
661 |
}
|
662 |
|
663 |
+
//disable ssl certificate verification if checked
|
664 |
+
if(isset($options['disable_ssl_verification']) && !empty($options['disable_ssl_verification'])){
|
665 |
+
$phpmailer->SMTPOptions = array(
|
666 |
+
'ssl' => array(
|
667 |
+
'verify_peer' => false,
|
668 |
+
'verify_peer_name' => false,
|
669 |
+
'allow_self_signed' => true
|
670 |
+
)
|
671 |
+
);
|
672 |
+
}
|
673 |
+
// User Email to use for SMTP authentication - Use the same Email used in Google Developer Console
|
674 |
+
$phpmailer->oauthUserEmail = $options['oauth_user_email'];
|
675 |
+
|
676 |
+
//Obtained From Google Developer Console
|
677 |
+
$phpmailer->oauthClientId = $options['oauth_client_id'];
|
678 |
+
|
679 |
+
//Obtained From Google Developer Console
|
680 |
+
$phpmailer->oauthClientSecret = $options['oauth_client_secret'];
|
681 |
+
|
682 |
+
$gmail_token = json_decode($options['oauth_access_token'], true);
|
683 |
+
|
684 |
+
//Obtained By running get_oauth_token.php after setting up APP in Google Developer Console.
|
685 |
+
//Set Redirect URI in Developer Console as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
|
686 |
+
// eg: http://localhost/phpmail/get_oauth_token.php
|
687 |
+
$phpmailer->oauthRefreshToken = $gmail_token['refresh_token'];
|
688 |
+
|
689 |
+
// Headers.
|
690 |
+
$cc = array();
|
691 |
+
$bcc = array();
|
692 |
+
$reply_to = array();
|
693 |
+
|
694 |
+
if ( empty( $headers ) ) {
|
695 |
+
$headers = array();
|
696 |
+
} else {
|
697 |
+
if ( ! is_array( $headers ) ) {
|
698 |
+
// Explode the headers out, so this function can take
|
699 |
+
// both string headers and an array of headers.
|
700 |
+
$tempheaders = explode( "\n", str_replace( "\r\n", "\n", $headers ) );
|
701 |
+
} else {
|
702 |
+
$tempheaders = $headers;
|
703 |
+
}
|
704 |
+
$headers = array();
|
705 |
+
|
706 |
+
// If it's actually got contents.
|
707 |
+
if ( ! empty( $tempheaders ) ) {
|
708 |
+
// Iterate through the raw headers.
|
709 |
+
foreach ( (array) $tempheaders as $header ) {
|
710 |
+
if ( strpos( $header, ':' ) === false ) {
|
711 |
+
if ( false !== stripos( $header, 'boundary=' ) ) {
|
712 |
+
$parts = preg_split( '/boundary=/i', trim( $header ) );
|
713 |
+
$boundary = trim( str_replace( array( "'", '"' ), '', $parts[1] ) );
|
714 |
+
}
|
715 |
+
continue;
|
716 |
+
}
|
717 |
+
// Explode them out.
|
718 |
+
list( $name, $content ) = explode( ':', trim( $header ), 2 );
|
719 |
+
|
720 |
+
// Cleanup crew.
|
721 |
+
$name = trim( $name );
|
722 |
+
$content = trim( $content );
|
723 |
+
|
724 |
+
switch ( strtolower( $name ) ) {
|
725 |
+
// Mainly for legacy -- process a "From:" header if it's there.
|
726 |
+
case 'from':
|
727 |
+
$bracket_pos = strpos( $content, '<' );
|
728 |
+
if ( false !== $bracket_pos ) {
|
729 |
+
// Text before the bracketed email is the "From" name.
|
730 |
+
if ( $bracket_pos > 0 ) {
|
731 |
+
$from_name = substr( $content, 0, $bracket_pos - 1 );
|
732 |
+
$from_name = str_replace( '"', '', $from_name );
|
733 |
+
$from_name = trim( $from_name );
|
734 |
+
}
|
735 |
+
|
736 |
+
$from_email = substr( $content, $bracket_pos + 1 );
|
737 |
+
$from_email = str_replace( '>', '', $from_email );
|
738 |
+
$from_email = trim( $from_email );
|
739 |
+
|
740 |
+
// Avoid setting an empty $from_email.
|
741 |
+
} elseif ( '' !== trim( $content ) ) {
|
742 |
+
$from_email = trim( $content );
|
743 |
+
}
|
744 |
+
break;
|
745 |
+
case 'content-type':
|
746 |
+
if ( strpos( $content, ';' ) !== false ) {
|
747 |
+
list( $type, $charset_content ) = explode( ';', $content );
|
748 |
+
$content_type = trim( $type );
|
749 |
+
if ( false !== stripos( $charset_content, 'charset=' ) ) {
|
750 |
+
$charset = trim( str_replace( array( 'charset=', '"' ), '', $charset_content ) );
|
751 |
+
} elseif ( false !== stripos( $charset_content, 'boundary=' ) ) {
|
752 |
+
$boundary = trim( str_replace( array( 'BOUNDARY=', 'boundary=', '"' ), '', $charset_content ) );
|
753 |
+
$charset = '';
|
754 |
+
}
|
755 |
+
|
756 |
+
// Avoid setting an empty $content_type.
|
757 |
+
} elseif ( '' !== trim( $content ) ) {
|
758 |
+
$content_type = trim( $content );
|
759 |
+
}
|
760 |
+
break;
|
761 |
+
case 'cc':
|
762 |
+
$cc = array_merge( (array) $cc, explode( ',', $content ) );
|
763 |
+
break;
|
764 |
+
case 'bcc':
|
765 |
+
$bcc = array_merge( (array) $bcc, explode( ',', $content ) );
|
766 |
+
break;
|
767 |
+
case 'reply-to':
|
768 |
+
$reply_to = array_merge( (array) $reply_to, explode( ',', $content ) );
|
769 |
+
break;
|
770 |
+
default:
|
771 |
+
// Add it to our grand headers array.
|
772 |
+
$headers[ trim( $name ) ] = trim( $content );
|
773 |
+
break;
|
774 |
+
}
|
775 |
+
}
|
776 |
+
}
|
777 |
+
}
|
778 |
+
|
779 |
+
// Empty out the values that may be set.
|
780 |
+
$phpmailer->clearAllRecipients();
|
781 |
+
$phpmailer->clearAttachments();
|
782 |
+
$phpmailer->clearCustomHeaders();
|
783 |
+
$phpmailer->clearReplyTos();
|
784 |
+
|
785 |
+
// Set "From" name and email.
|
786 |
+
|
787 |
+
// If we don't have a name from the input headers.
|
788 |
+
if ( ! isset( $from_name ) ) {
|
789 |
+
$from_name = $options['from_name'];//'WordPress';
|
790 |
+
}
|
791 |
+
|
792 |
+
/*
|
793 |
+
* If we don't have an email from the input headers, default to wordpress@$sitename
|
794 |
+
* Some hosts will block outgoing mail from this address if it doesn't exist,
|
795 |
+
* but there's no easy alternative. Defaulting to admin_email might appear to be
|
796 |
+
* another option, but some hosts may refuse to relay mail from an unknown domain.
|
797 |
+
* See https://core.trac.wordpress.org/ticket/5007.
|
798 |
+
*/
|
799 |
+
if ( ! isset( $from_email ) ) {
|
800 |
+
// Get the site domain and get rid of www.
|
801 |
+
$sitename = wp_parse_url( network_home_url(), PHP_URL_HOST );
|
802 |
+
if ( 'www.' === substr( $sitename, 0, 4 ) ) {
|
803 |
+
$sitename = substr( $sitename, 4 );
|
804 |
+
}
|
805 |
+
|
806 |
+
$from_email = $options['from_email'];//'wordpress@' . $sitename;
|
807 |
+
}
|
808 |
+
|
809 |
+
/**
|
810 |
+
* Filters the email address to send from.
|
811 |
+
*
|
812 |
+
* @since 2.2.0
|
813 |
+
*
|
814 |
+
* @param string $from_email Email address to send from.
|
815 |
+
*/
|
816 |
+
$from_email = apply_filters( 'wp_mail_from', $from_email );
|
817 |
+
|
818 |
+
/**
|
819 |
+
* Filters the name to associate with the "from" email address.
|
820 |
+
*
|
821 |
+
* @since 2.3.0
|
822 |
+
*
|
823 |
+
* @param string $from_name Name associated with the "from" email address.
|
824 |
+
*/
|
825 |
+
$from_name = apply_filters( 'wp_mail_from_name', $from_name );
|
826 |
+
|
827 |
+
try {
|
828 |
+
$phpmailer->setFrom( $from_email, $from_name, false );
|
829 |
+
} catch ( PHPMailer\PHPMailer\Exception $e ) {
|
830 |
+
$mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' );
|
831 |
+
$mail_error_data['phpmailer_exception_code'] = $e->getCode();
|
832 |
+
|
833 |
+
/** This filter is documented in wp-includes/pluggable.php */
|
834 |
+
do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) );
|
835 |
+
|
836 |
+
return false;
|
837 |
+
}
|
838 |
+
|
839 |
+
// Set mail's subject and body.
|
840 |
+
$phpmailer->Subject = $subject;
|
841 |
+
$phpmailer->Body = $message;
|
842 |
+
|
843 |
+
// Set destination addresses, using appropriate methods for handling addresses.
|
844 |
+
$address_headers = compact( 'to', 'cc', 'bcc', 'reply_to' );
|
845 |
+
|
846 |
+
foreach ( $address_headers as $address_header => $addresses ) {
|
847 |
+
if ( empty( $addresses ) ) {
|
848 |
+
continue;
|
849 |
+
}
|
850 |
+
|
851 |
+
foreach ( (array) $addresses as $address ) {
|
852 |
+
try {
|
853 |
+
// Break $recipient into name and address parts if in the format "Foo <bar@baz.com>".
|
854 |
+
$recipient_name = '';
|
855 |
+
|
856 |
+
if ( preg_match( '/(.*)<(.+)>/', $address, $matches ) ) {
|
857 |
+
if ( count( $matches ) == 3 ) {
|
858 |
+
$recipient_name = $matches[1];
|
859 |
+
$address = $matches[2];
|
860 |
+
}
|
861 |
+
}
|
862 |
+
|
863 |
+
switch ( $address_header ) {
|
864 |
+
case 'to':
|
865 |
+
$phpmailer->addAddress( $address, $recipient_name );
|
866 |
+
break;
|
867 |
+
case 'cc':
|
868 |
+
$phpmailer->addCc( $address, $recipient_name );
|
869 |
+
break;
|
870 |
+
case 'bcc':
|
871 |
+
$phpmailer->addBcc( $address, $recipient_name );
|
872 |
+
break;
|
873 |
+
case 'reply_to':
|
874 |
+
$phpmailer->addReplyTo( $address, $recipient_name );
|
875 |
+
break;
|
876 |
+
}
|
877 |
+
} catch ( PHPMailer\PHPMailer\Exception $e ) {
|
878 |
+
continue;
|
879 |
+
}
|
880 |
+
}
|
881 |
+
}
|
882 |
+
|
883 |
+
// Set Content-Type and charset.
|
884 |
+
|
885 |
+
// If we don't have a content-type from the input headers.
|
886 |
+
if ( ! isset( $content_type ) ) {
|
887 |
+
$content_type = 'text/plain';
|
888 |
+
}
|
889 |
+
|
890 |
+
/**
|
891 |
+
* Filters the wp_mail() content type.
|
892 |
+
*
|
893 |
+
* @since 2.3.0
|
894 |
+
*
|
895 |
+
* @param string $content_type Default wp_mail() content type.
|
896 |
+
*/
|
897 |
+
$content_type = apply_filters( 'wp_mail_content_type', $content_type );
|
898 |
+
|
899 |
+
$phpmailer->ContentType = $content_type;
|
900 |
+
|
901 |
+
// Set whether it's plaintext, depending on $content_type.
|
902 |
+
if ( 'text/html' === $content_type ) {
|
903 |
+
$phpmailer->isHTML( true );
|
904 |
+
}
|
905 |
+
|
906 |
+
// If we don't have a charset from the input headers.
|
907 |
+
if ( ! isset( $charset ) ) {
|
908 |
+
$charset = get_bloginfo( 'charset' );
|
909 |
+
}
|
910 |
+
|
911 |
+
/**
|
912 |
+
* Filters the default wp_mail() charset.
|
913 |
+
*
|
914 |
+
* @since 2.3.0
|
915 |
+
*
|
916 |
+
* @param string $charset Default email charset.
|
917 |
+
*/
|
918 |
+
$phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );
|
919 |
+
|
920 |
+
// Set custom headers.
|
921 |
+
if ( ! empty( $headers ) ) {
|
922 |
+
foreach ( (array) $headers as $name => $content ) {
|
923 |
+
// Only add custom headers not added automatically by PHPMailer.
|
924 |
+
if ( ! in_array( $name, array( 'MIME-Version', 'X-Mailer' ), true ) ) {
|
925 |
+
try {
|
926 |
+
$phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) );
|
927 |
+
} catch ( PHPMailer\PHPMailer\Exception $e ) {
|
928 |
+
continue;
|
929 |
+
}
|
930 |
+
}
|
931 |
+
}
|
932 |
+
|
933 |
+
if ( false !== stripos( $content_type, 'multipart' ) && ! empty( $boundary ) ) {
|
934 |
+
$phpmailer->addCustomHeader( sprintf( 'Content-Type: %s; boundary="%s"', $content_type, $boundary ) );
|
935 |
+
}
|
936 |
+
}
|
937 |
+
|
938 |
+
if ( ! empty( $attachments ) ) {
|
939 |
+
foreach ( $attachments as $attachment ) {
|
940 |
+
try {
|
941 |
+
$phpmailer->addAttachment( $attachment );
|
942 |
+
} catch ( PHPMailer\PHPMailer\Exception $e ) {
|
943 |
+
continue;
|
944 |
+
}
|
945 |
+
}
|
946 |
+
}
|
947 |
+
|
948 |
+
/**
|
949 |
+
* Fires after PHPMailer is initialized.
|
950 |
+
*
|
951 |
+
* @since 2.2.0
|
952 |
+
*
|
953 |
+
* @param PHPMailer $phpmailer The PHPMailer instance (passed by reference).
|
954 |
+
*/
|
955 |
+
do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
|
956 |
+
|
957 |
+
// Send!
|
958 |
+
try {
|
959 |
+
return $phpmailer->send();
|
960 |
+
} catch ( PHPMailer\PHPMailer\Exception $e ) {
|
961 |
+
|
962 |
+
$mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' );
|
963 |
+
$mail_error_data['phpmailer_exception_code'] = $e->getCode();
|
964 |
+
|
965 |
+
/**
|
966 |
+
* Fires after a PHPMailer\PHPMailer\Exception is caught.
|
967 |
+
*
|
968 |
+
* @since 4.4.0
|
969 |
+
*
|
970 |
+
* @param WP_Error $error A WP_Error object with the PHPMailer\PHPMailer\Exception message, and an array
|
971 |
+
* containing the mail recipient, subject, message, headers, and attachments.
|
972 |
+
*/
|
973 |
+
do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) );
|
974 |
+
|
975 |
+
return false;
|
976 |
+
}
|
977 |
+
}
|
978 |
+
|
979 |
}
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== WP Gmail SMTP ===
|
2 |
Contributors: naa986
|
3 |
Donate link: https://wphowto.net/
|
4 |
-
Tags: smtp, gmail, mail,
|
5 |
-
Requires at least:
|
6 |
-
Tested up to: 5.
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 1.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -102,6 +102,22 @@ Yes.
|
|
102 |
|
103 |
Yes.
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
== Screenshots ==
|
106 |
|
107 |
For screenshots please visit the [Gmail SMTP](https://wphowto.net/gmail-smtp-plugin-for-wordpress-1341) plugin page
|
@@ -111,6 +127,9 @@ none
|
|
111 |
|
112 |
== Changelog ==
|
113 |
|
|
|
|
|
|
|
114 |
= 1.1.9 =
|
115 |
* Gmail SMTP is compatible with WordPress 5.3.
|
116 |
|
1 |
=== WP Gmail SMTP ===
|
2 |
Contributors: naa986
|
3 |
Donate link: https://wphowto.net/
|
4 |
+
Tags: smtp, gmail, mail, email, oauth
|
5 |
+
Requires at least: 5.5
|
6 |
+
Tested up to: 5.6
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 1.2.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
102 |
|
103 |
Yes.
|
104 |
|
105 |
+
= Can I use this plugin for Gmail signup? =
|
106 |
+
|
107 |
+
No.
|
108 |
+
|
109 |
+
= Can I use this plugin on Gmail app? =
|
110 |
+
|
111 |
+
No.
|
112 |
+
|
113 |
+
= Can I use this plugin to access my Gmail inbox? =
|
114 |
+
|
115 |
+
No.
|
116 |
+
|
117 |
+
= Can I use this plugin to sign out of my Gmail account? =
|
118 |
+
|
119 |
+
No.
|
120 |
+
|
121 |
== Screenshots ==
|
122 |
|
123 |
For screenshots please visit the [Gmail SMTP](https://wphowto.net/gmail-smtp-plugin-for-wordpress-1341) plugin page
|
127 |
|
128 |
== Changelog ==
|
129 |
|
130 |
+
= 1.2.0 =
|
131 |
+
* WordPress 5.5 compatibility update.
|
132 |
+
|
133 |
= 1.1.9 =
|
134 |
* Gmail SMTP is compatible with WordPress 5.3.
|
135 |
|