From 954a50013539683f1d454101ae8f86b39e7230f3 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Sat, 24 May 2014 00:54:01 +0300 Subject: [PATCH] Updating PHPMailer to version 5.2.8. --- README.md | 6 +- config/email.php | 2 +- libraries/MY_Email.php | 12 +- third_party/phpmailer/PHPMailerAutoload.php | 26 +- third_party/phpmailer/README.md | 54 +- third_party/phpmailer/changelog.md | 93 ++- third_party/phpmailer/class.phpmailer.php | 676 +++++++++++------- third_party/phpmailer/class.pop3.php | 18 +- third_party/phpmailer/class.smtp.php | 284 ++++---- .../phpmailer/language/phpmailer.lang-be.php | 24 + .../phpmailer/language/phpmailer.lang-br.php | 2 +- .../phpmailer/language/phpmailer.lang-ca.php | 22 +- .../phpmailer/language/phpmailer.lang-el.php | 24 + .../phpmailer/language/phpmailer.lang-fa.php | 17 +- .../phpmailer/language/phpmailer.lang-fr.php | 8 +- .../phpmailer/language/phpmailer.lang-gl.php | 26 + .../phpmailer/language/phpmailer.lang-hr.php | 25 + .../phpmailer/language/phpmailer.lang-ka.php | 24 + .../phpmailer/language/phpmailer.lang-lv.php | 24 + .../phpmailer/language/phpmailer.lang-nl.php | 34 +- .../phpmailer/language/phpmailer.lang-no.php | 2 +- .../phpmailer/language/phpmailer.lang-pl.php | 7 +- .../phpmailer/language/phpmailer.lang-pt.php | 26 + .../phpmailer/language/phpmailer.lang-ro.php | 12 +- .../phpmailer/language/phpmailer.lang-sr.php | 25 + .../phpmailer/language/phpmailer.lang-tr.php | 33 +- .../phpmailer/language/phpmailer.lang-vi.php | 25 + .../phpmailer/language/phpmailer.lang-zh.php | 27 +- .../language/phpmailer.lang-zh_cn.php | 13 +- 29 files changed, 983 insertions(+), 588 deletions(-) create mode 100644 third_party/phpmailer/language/phpmailer.lang-be.php create mode 100644 third_party/phpmailer/language/phpmailer.lang-el.php create mode 100644 third_party/phpmailer/language/phpmailer.lang-gl.php create mode 100644 third_party/phpmailer/language/phpmailer.lang-hr.php create mode 100644 third_party/phpmailer/language/phpmailer.lang-ka.php create mode 100644 third_party/phpmailer/language/phpmailer.lang-lv.php create mode 100644 third_party/phpmailer/language/phpmailer.lang-pt.php create mode 100644 third_party/phpmailer/language/phpmailer.lang-sr.php create mode 100644 third_party/phpmailer/language/phpmailer.lang-vi.php diff --git a/README.md b/README.md index b28e670..6eccd6e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ A CodeIgniter compatible email-library powered by PHPMailer =========================================================== -Version: 1.1.2 +Version: 1.1.3 Author: Ivan Tcholakov , 2012-2014. License: The MIT License (MIT), http://opensource.org/licenses/MIT -Tested on CodeIgniter 3.0-dev (February 12th, 2014) and with PHPMailer Version 5.2.7 (September 12th, 2013). +Tested on CodeIgniter 3.0-dev (May 24th, 2014) and with PHPMailer Version 5.2.8 (May 14th, 2014). Installation ------------ @@ -35,7 +35,7 @@ $config['smtp_pass'] = 'yourpassword'; $config['smtp_port'] = 465; $config['smtp_timeout'] = 5; // (in seconds) $config['smtp_crypto'] = 'ssl'; // '' or 'tls' or 'ssl' -$config['smtp_debug'] = 0; // PHPMailer's SMTP debug info level: 0 = off, 1 = commands, 2 = commands and data +$config['smtp_debug'] = 0; // PHPMailer's SMTP debug info level: 0 = off, 1 = commands, 2 = commands and data, 3 = as 2 plus connection status, 4 = low level data output. $config['wordwrap'] = true; $config['wrapchars'] = 76; $config['mailtype'] = 'html'; // 'text' or 'html' diff --git a/config/email.php b/config/email.php index 74a18e9..dc62935 100644 --- a/config/email.php +++ b/config/email.php @@ -9,7 +9,7 @@ $config['smtp_port'] = 25; $config['smtp_timeout'] = 5; // (in seconds) $config['smtp_crypto'] = ''; // '' or 'tls' or 'ssl' -$config['smtp_debug'] = 0; // PHPMailer's SMTP debug info level: 0 = off, 1 = commands, 2 = commands and data +$config['smtp_debug'] = 0; // PHPMailer's SMTP debug info level: 0 = off, 1 = commands, 2 = commands and data, 3 = as 2 plus connection status, 4 = low level data output. $config['wordwrap'] = true; $config['wrapchars'] = 76; $config['mailtype'] = 'html'; // 'text' or 'html' diff --git a/libraries/MY_Email.php b/libraries/MY_Email.php index 9e81b18..70c0dba 100644 --- a/libraries/MY_Email.php +++ b/libraries/MY_Email.php @@ -2,13 +2,13 @@ /** * CodeIgniter compatible email-library powered by PHPMailer. - * Version: 1.1.2 + * Version: 1.1.3 * @author Ivan Tcholakov , 2012-2014. * @license The MIT License (MIT), http://opensource.org/licenses/MIT * @link https://github.com/ivantcholakov/codeigniter-phpmailer * - * Tested on production sites with CodeIgniter 3.0-dev (February 12th, 2014) and - * PHPMailer Version 5.2.7 (September 12th, 2013). + * Tested on production sites with CodeIgniter 3.0-dev (May 24th, 2014) and + * PHPMailer Version 5.2.8 (May 14th, 2014). */ class MY_Email extends CI_Email { @@ -96,7 +96,7 @@ public function __construct($config = array()) { } } - $this->_safe_mode = ( ! is_php('5.4') && (bool) @ini_get('safe_mode')); + $this->_safe_mode = ( ! is_php('5.4') && ini_get('safe_mode')); log_message('debug', 'MY_Email Class Initialized (Engine: '.$this->mailer_engine.')'); } @@ -612,12 +612,12 @@ public function send($auto_clear = true) { // Custom methods ---------------------------------------------------------- // PHPMailer's SMTP debug info level - // 0 = off, 1 = commands, 2 = commands and data + // 0 = off, 1 = commands, 2 = commands and data, 3 = as 2 plus connection status, 4 = low level data output. public function set_smtp_debug($level) { $level = (int) $level; - if ($level < 0 || $level > 2) { + if ($level < 0) { $level = 0; } diff --git a/third_party/phpmailer/PHPMailerAutoload.php b/third_party/phpmailer/PHPMailerAutoload.php index 46db5bd..eaa2e30 100644 --- a/third_party/phpmailer/PHPMailerAutoload.php +++ b/third_party/phpmailer/PHPMailerAutoload.php @@ -1,14 +1,14 @@ + * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project + * @author Marcus Bointon (Synchro/coolbru) * @author Jim Jagielski (jimjag) * @author Andy Prevost (codeworxtech) * @author Brent R. Matzelle (original founder) - * @copyright 2013 Marcus Bointon + * @copyright 2012 - 2014 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License @@ -30,4 +30,20 @@ function PHPMailerAutoload($classname) } } -spl_autoload_register('PHPMailerAutoload'); +if (version_compare(PHP_VERSION, '5.1.2', '>=')) { + //SPL autoloading was introduced in PHP 5.1.2 + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + spl_autoload_register('PHPMailerAutoload', true, true); + } else { + spl_autoload_register('PHPMailerAutoload'); + } +} else { + /** + * Fall back to traditional autoload for old PHP versions + * @param string $classname The name of the class to load + */ + function __autoload($classname) + { + PHPMailerAutoload($classname); + } +} diff --git a/third_party/phpmailer/README.md b/third_party/phpmailer/README.md index de76a76..282447c 100644 --- a/third_party/phpmailer/README.md +++ b/third_party/phpmailer/README.md @@ -1,17 +1,22 @@ +![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png) + # PHPMailer - A full-featured email creation and transfer class for PHP -Build status: [![Build Status](https://travis-ci.org/Synchro/PHPMailer.png)](https://travis-ci.org/Synchro/PHPMailer) +Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer) +[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/quality-score.png?s=3758e21d279becdf847a557a56a3ed16dfec9d5d)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/) +[![Code Coverage](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/coverage.png?s=3fe6ca5fe8cd2cdf96285756e42932f7ca256962)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/) ## Class Features - Probably the world's most popular code for sending email from PHP! - Used by many open-source projects: Drupal, SugarCRM, Yii, Joomla! and many more - Integrated SMTP support - send without a local mail server -- send emails with multiple TOs, CCs, BCCs and REPLY-TOs +- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs - Multipart/alternative emails for mail clients that do not read HTML email -- Support for 8bit, base64, binary, and quoted-printable encoding -- SMTP authentication with LOGIN, PLAIN, NTLM and CRAM-MD5 mechanisms +- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings +- SMTP authentication with LOGIN, PLAIN, NTLM and CRAM-MD5 mechanisms over SSL and TLS transports - Native language support +- DKIM and S/MIME signing support - Compatible with PHP 5.0 and later - Much more! @@ -29,29 +34,35 @@ The PHP mail() function usually sends via a local mail server, typically fronted This software is licenced under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html). Please read LICENSE for information on the software availability and distribution. -## Installation +## Installation & loading PHPMailer is available via [Composer/Packagist](https://packagist.org/packages/phpmailer/phpmailer). Alternatively, just copy the contents of the PHPMailer folder into somewhere that's in your PHP `include_path` setting. If you don't speak git or just want a tarball, click the 'zip' button at the top of the page in GitHub. +PHPMailer provides an SPL-compatible autoloader, and that is the preferred way of loading the library - just `require '/path/to/PHPMailerAutoload.php';` and everything should work. The autoloader does not throw errors if it can't find classes so it prepends itself to the SPL list, allowing your own (or your framework's) autoloader to catch errors. SPL autoloading was introduced in PHP 5.1.0, so if you are using a version older than that you will need to require/include each class manually. +PHPMailer does *not* declare a namespace because namespaces were only introduced in PHP 5.3. + +### Minimal installation + +While installing the entire package manually or with composer is simple, convenient and reliable, you may want to include only vital files in your project. At the very least you will need [class.phpmailer.php](class.phpmailer.php). If you're using SMTP, you'll need [class.smtp.php](class.smtp.php), and if you're using POP-before SMTP, you'll need [class.pop3.php](class.pop3.php). For all of these, we recommend you use [the autoloader](PHPMailerAutoload.php) too. You can skip the [language](language/) folder if you're not showing errors to users and can make do with English-only errors. You may need the additional classes in the [extras](extras/) folder if you are using those features, including NTLM authentication, advanced HTML-to-text conversion and ics generation. ## A Simple Example ```php isSMTP(); // Set mailer to use SMTP -$mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup server +$mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication -$mail->Username = 'jswan'; // SMTP username +$mail->Username = 'user@example.com'; // SMTP username $mail->Password = 'secret'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted $mail->From = 'from@example.com'; $mail->FromName = 'Mailer'; -$mail->addAddress('josh@example.net', 'Josh Adams'); // Add a recipient +$mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient $mail->addAddress('ellen@example.com'); // Name is optional $mail->addReplyTo('info@example.com', 'Information'); $mail->addCC('cc@example.com'); @@ -67,35 +78,38 @@ $mail->Body = 'This is the HTML message body in bold!'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; if(!$mail->send()) { - echo 'Message could not be sent.'; - echo 'Mailer Error: ' . $mail->ErrorInfo; - exit; + echo 'Message could not be sent.'; + echo 'Mailer Error: ' . $mail->ErrorInfo; +} else { + echo 'Message has been sent'; } - -echo 'Message has been sent'; ``` -You'll find plenty more to play with in the `examples` folder. +You'll find plenty more to play with in the [examples](examples/) folder. That's it. You should now be ready to use PHPMailer! ## Localization -PHPMailer defaults to English, but in the `languages` folder you'll find numerous translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: +PHPMailer defaults to English, but in the [language](language/) folder you'll find numerous (39 at the time of writing) translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: ```php // To load the French version $mail->setLanguage('fr', '/optional/path/to/language/directory/'); ``` +We welcome corrections and new languages - if you're looking for corrections to do, run the [phpmailerLangTest.php](test/phpmailerLangTest.php) script in the tests folder and it will show any missing translations. + ## Documentation -You'll find some basic user-level docs in the docs folder, and you can generate complete API-level documentation using the `generatedocs.sh` shell script in the docs folder, though you'll need to install [PHPDocumentor](http://www.phpdoc.org) first. +Generated documentation is [available online](http://phpmailer.github.io/PHPMailer/). + +You'll find some basic user-level docs in the [docs](docs/) folder, and you can generate complete API-level documentation using the [generatedocs.sh](docs/generatedocs.sh) shell script in the docs folder, though you'll need to install [PHPDocumentor](http://www.phpdoc.org) first. You may find [the unit tests](test/phpmailerTest.php) a good source of how to do various operations such as encryption. ## Tests -You'll find a PHPUnit test script in the `test` folder. +There is a PHPUnit test script in the [test](test/) folder. -Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.png)](https://travis-ci.org/PHPMailer/PHPMailer) +Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer) If this isn't passing, is there something you can do to help? @@ -128,7 +142,7 @@ See [changelog](changelog.md). - Test suite. - Continuous integration with Travis-CI. - Composer support. -- Rolling releases. +- Public development. - Additional languages and language strings. - CRAM-MD5 authentication support. - Preserves full repo history of authors, commits and branches from the original SourceForge project. diff --git a/third_party/phpmailer/changelog.md b/third_party/phpmailer/changelog.md index 4caa777..25a841e 100644 --- a/third_party/phpmailer/changelog.md +++ b/third_party/phpmailer/changelog.md @@ -1,5 +1,47 @@ # ChangeLog +* Update html2text from https://github.com/mtibben/html2text + +## Version 5.2.8 (May 14th 2014) +* Increase timeout to match RFC2821 section 4.5.3.2 and thus not fail greetdelays, fixes #104 +* Add timestamps to default debug output +* Add connection events and new level 3 to debug output options +* Chinese language update (Thanks to @binaryoung) +* Allow custom Mailer types (Thanks to @michield) +* Cope with spaces around SMTP host specs +* Fix processing of multiple hosts in connect string +* Added Galician translation (Thanks to @donatorouco) +* Autoloader now prepends +* Docs updates +* Add Latvian translation (Thanks to @eddsstudio) +* Add Belarusian translation (Thanks to @amaksymiuk) +* Make autoloader work better on older PHP versions +* Avoid double-encoding if mbstring is overloading mail() +* Add Portuguese translation (Thanks to @Jonadabe) +* Make quoted-printable encoder respect line ending setting +* Improve Chinese translation (Thanks to @PeterDaveHello) +* Add Georgian translation (Thanks to @akalongman) +* Add Greek translation (Thanks to @lenasterg) +* Fix serverHostname on PHP < 5.3 +* Improve performance of SMTP class +* Implement automatic 7bit downgrade +* Add Vietnamese translation (Thanks to @vinades) +* Improve example images, switch to PNG +* Add Croatian translation (Thanks to @hrvoj3e) +* Remove setting the Return-Path and deprecate the Return-path property - it's just wrong! +* Fix language file loading if CWD has changed (@stephandesouza) +* Add HTML5 email validation pattern +* Improve Turkish translations (Thanks to @yasinaydin) +* Improve Romanian translations (Thanks to @aflorea) +* Check php.ini for path to sendmail/qmail before using default +* Improve Farsi translation (Thanks to @MHM5000) +* Don't use quoted-printable encoding for multipart types +* Add Serbian translation (Thanks to ajevremovic at gmail.com) +* Remove useless PHP5 check +* Use SVG for build status badges +* Store MessageDate on creation +* Better default behaviour for validateAddress + ## Version 5.2.7 (September 12th 2013) * Add Ukranian translation from @Krezalis * Support for do_verp @@ -122,7 +164,7 @@ #52, #31, #41, #5. #70, #69 ## Version 5.2.1 (January 16, 2012) -* Closed several bugs#5 +* Closed several bugs #5 * Performance improvements * MsgHTML() now returns the message as required. * New method: GetSentMIMEMessage() (returns full copy of sent message) @@ -251,11 +293,11 @@ NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. IF YOU to, an error was thrown for the date() functions used (line 1565 and 1569). This is NOT a PHPMailer error, it is the result of an incorrectly configured PHP5 installation. The fix is to modify your 'php.ini' file and include the - date.timezone = America/New York + date.timezone = Etc/UTC (or your own zone) directive, to your own server timezone - If you do get this error, and are unable to access your php.ini file: In your PHP script, add - `date_default_timezone_set('America/Toronto');` + `date_default_timezone_set('Etc/UTC');` - do not try to use `$myVar = date_default_timezone_get();` as a test, it will throw an error. @@ -295,31 +337,6 @@ Please note, this is BETA software * included example showing how to use PHPMailer with GMAIL * fixed the missing Cc in SendMail() and Mail() -****************** -A note on sending bulk emails: - -If the email you are sending is not personalized, consider using the -"undisclosed-recipient:;" strategy. That is, put all of your recipients -in the Bcc field and set the To field to "undisclosed-recipients:;". -It's a lot faster (only one send) and saves quite a bit on resources. -Contrary to some opinions, this will not get you listed in spam engines - -it's a legitimate way for you to send emails. - -A partial example for use with PHPMailer: - -``` -$mail->AddAddress("undisclosed-recipients:;"); -$mail->AddBCC("email1@anydomain.com,email2@anyotherdomain.com,email3@anyalternatedomain.com"); -``` - -Many email service providers restrict the number of emails that can be sent -in any given time period. Often that is between 50 - 60 emails maximum -per hour or per send session. - -If that's the case, then break up your Bcc lists into chunks that are one -less than your limit, and put a pause in your script. -******************* - ## Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release * dramatically simplified using inline graphics ... it's fully automated and requires no user input * added automatic document type detection for attachments and pictures @@ -332,26 +349,8 @@ less than your limit, and put a pause in your script. * added Estonian language file by Indrek Päri * added header injection patch * added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc. - example of use: - -``` -$mail->set('X-Priority', '3'); -$mail->set('X-MSMail-Priority', 'Normal'); -``` - * fixed warning message in SMTP get_lines method -* added TLS/SSL SMTP support. Example of use: - -``` -$mail = new PHPMailer(); -$mail->Mailer = "smtp"; -$mail->Host = "smtp.example.com"; -$mail->SMTPSecure = "tls"; // option -//$mail->SMTPSecure = "ssl"; // option -... -$mail->Send(); -``` - +* added TLS/SSL SMTP support. * PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7) * Works with PHP installed as a module or as CGI-PHP NOTE: will NOT work with PHP5 in E_STRICT error mode diff --git a/third_party/phpmailer/class.phpmailer.php b/third_party/phpmailer/class.phpmailer.php index fe37a93..65d4c9d 100644 --- a/third_party/phpmailer/class.phpmailer.php +++ b/third_party/phpmailer/class.phpmailer.php @@ -1,15 +1,14 @@ + * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project + * @author Marcus Bointon (Synchro/coolbru) * @author Jim Jagielski (jimjag) * @author Andy Prevost (codeworxtech) * @author Brent R. Matzelle (original founder) - * @copyright 2013 Marcus Bointon + * @copyright 2012 - 2014 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License @@ -18,21 +17,13 @@ * FITNESS FOR A PARTICULAR PURPOSE. */ -if (version_compare(PHP_VERSION, '5.0.0', '<')) { - exit("Sorry, PHPMailer will only run on PHP version 5 or greater!\n"); -} - /** * PHPMailer - PHP email creation and transport class. - * PHP Version 5.0.0 * @package PHPMailer - * @author Marcus Bointon (coolbru) + * @author Marcus Bointon (Synchro/coolbru) * @author Jim Jagielski (jimjag) * @author Andy Prevost (codeworxtech) * @author Brent R. Matzelle (original founder) - * @copyright 2013 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost */ class PHPMailer { @@ -40,7 +31,7 @@ class PHPMailer * The PHPMailer Version number. * @type string */ - public $Version = '5.2.7'; + public $Version = '5.2.8'; /** * Email priority. @@ -97,6 +88,9 @@ class PHPMailer * The Return-Path of the message. * If empty, it will be set to either From or Sender. * @type string + * @deprecated Email senders should never set a return-path header; + * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything. + * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference */ public $ReturnPath = ''; @@ -299,19 +293,27 @@ class PHPMailer /** * SMTP class debug output mode. - * Options: 0 = off, 1 = commands, 2 = commands and data + * Options: + * 0: no output + * 1: commands + * 2: data and commands + * 3: as 2 plus connection status + * 4: low level data output * @type int * @see SMTP::$do_debug */ public $SMTPDebug = 0; /** - * The function/method to use for debugging output. - * Options: "echo" or "error_log" + * How to handle debug output. + * Options: + * 'echo': Output plain-text as-is, appropriate for CLI + * 'html': Output escaped, line breaks converted to
, appropriate for browser output + * 'error_log': Output to error log as configured in php.ini * @type string * @see SMTP::$Debugoutput */ - public $Debugoutput = "echo"; + public $Debugoutput = 'echo'; /** * Whether to keep SMTP connection open after each message. @@ -339,6 +341,7 @@ class PHPMailer * Whether to generate VERP addresses on send. * Only applicable when sending via SMTP. * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path + * @link http://www.postfix.org/VERP_README.html Postfix VERP info * @type bool */ public $do_verp = false; @@ -396,11 +399,7 @@ class PHPMailer * The function that handles the result of the send email action. * It is called out by send() for each email sent. * - * Value can be: - * - 'function_name' for function names - * - 'Class::Method' for static method calls - * - array($object, 'Method') for calling methods on $object - * See http://php.net/is_callable manual page for more details. + * Value can be any php callable: http://www.php.net/is_callable * * Parameters: * bool $result result of the send action @@ -410,7 +409,6 @@ class PHPMailer * string $subject the subject * string $body the email body * string $from email address of sender - * * @type string */ public $action_function = ''; @@ -571,8 +569,11 @@ public function __construct($exceptions = false) { $this->exceptions = ($exceptions == true); //Make sure our autoloader is loaded - if (!in_array('PHPMailerAutoload', spl_autoload_functions())) { - require 'PHPMailerAutoload.php'; + if (version_compare(PHP_VERSION, '5.1.2', '>=')) { + $autoload = spl_autoload_functions(); + if ($autoload === false or !in_array('PHPMailerAutoload', $autoload)) { + require 'PHPMailerAutoload.php'; + } } } @@ -601,12 +602,18 @@ public function __destruct() */ private function mailPassthru($to, $subject, $body, $header, $params) { + //Check overloading of mail function to avoid double-encoding + if (ini_get('mbstring.func_overload') & 1) { + $subject = $this->secureHeader($subject); + } else { + $subject = $this->encodeHeader($this->secureHeader($subject)); + } if (ini_get('safe_mode') || !($this->UseSendmailOptions)) { - $rt = @mail($to, $this->encodeHeader($this->secureHeader($subject)), $body, $header); + $result = @mail($to, $subject, $body, $header); } else { - $rt = @mail($to, $this->encodeHeader($this->secureHeader($subject)), $body, $header, $params); + $result = @mail($to, $subject, $body, $header, $params); } - return $rt; + return $result; } /** @@ -631,8 +638,7 @@ protected function edebug($str) break; case 'echo': default: - //Just echoes exactly what was received - echo $str; + echo $str."\n"; } } @@ -674,8 +680,12 @@ public function isMail() */ public function isSendmail() { - if (!stristr(ini_get('sendmail_path'), 'sendmail')) { - $this->Sendmail = '/var/qmail/bin/sendmail'; + $ini_sendmail_path = ini_get('sendmail_path'); + + if (!stristr($ini_sendmail_path, 'sendmail')) { + $this->Sendmail = '/usr/sbin/sendmail'; + } else { + $this->Sendmail = $ini_sendmail_path; } $this->Mailer = 'sendmail'; } @@ -686,10 +696,14 @@ public function isSendmail() */ public function isQmail() { - if (stristr(ini_get('sendmail_path'), 'qmail')) { - $this->Sendmail = '/var/qmail/bin/sendmail'; + $ini_sendmail_path = ini_get('sendmail_path'); + + if (!stristr($ini_sendmail_path, 'qmail')) { + $this->Sendmail = '/var/qmail/bin/qmail-inject'; + } else { + $this->Sendmail = $ini_sendmail_path; } - $this->Mailer = 'sendmail'; + $this->Mailer = 'qmail'; } /** @@ -752,20 +766,20 @@ protected function addAnAddress($kind, $address, $name = '') { if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) { $this->setError($this->lang('Invalid recipient array') . ': ' . $kind); + $this->edebug($this->lang('Invalid recipient array') . ': ' . $kind); if ($this->exceptions) { throw new phpmailerException('Invalid recipient array: ' . $kind); } - $this->edebug($this->lang('Invalid recipient array') . ': ' . $kind); return false; } $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim if (!$this->validateAddress($address)) { $this->setError($this->lang('invalid_address') . ': ' . $address); + $this->edebug($this->lang('invalid_address') . ': ' . $address); if ($this->exceptions) { throw new phpmailerException($this->lang('invalid_address') . ': ' . $address); } - $this->edebug($this->lang('invalid_address') . ': ' . $address); return false; } if ($kind != 'Reply-To') { @@ -797,10 +811,10 @@ public function setFrom($address, $name = '', $auto = true) $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim if (!$this->validateAddress($address)) { $this->setError($this->lang('invalid_address') . ': ' . $address); + $this->edebug($this->lang('invalid_address') . ': ' . $address); if ($this->exceptions) { throw new phpmailerException($this->lang('invalid_address') . ': ' . $address); } - $this->edebug($this->lang('invalid_address') . ': ' . $address); return false; } $this->From = $address; @@ -829,22 +843,20 @@ public function getLastMessageID() * Check that a string looks like an email address. * @param string $address The email address to check * @param string $patternselect A selector for the validation pattern to use : - * 'auto' - pick best one automatically; - * 'pcre8' - use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14; - * 'pcre' - use old PCRE implementation; - * 'php' - use PHP built-in FILTER_VALIDATE_EMAIL; faster, less thorough; - * 'noregex' - super fast, really dumb. + * * `auto` Pick strictest one automatically; + * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14; + * * `pcre` Use old PCRE implementation; + * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; same as pcre8 but does not allow 'dotless' domains; + * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. + * * `noregex` Don't use a regex: super fast, really dumb. * @return bool * @static * @access public */ public static function validateAddress($address, $patternselect = 'auto') { - if ($patternselect == 'auto') { - if (defined( - 'PCRE_VERSION' - ) - ) { //Check this instead of extension_loaded so it works when that function is disabled + if (!$patternselect or $patternselect == 'auto') { + if (defined('PCRE_VERSION')) { //Check this constant so it works when extension_loaded() is disabled if (version_compare(PCRE_VERSION, '8.0') >= 0) { $patternselect = 'pcre8'; } else { @@ -862,9 +874,7 @@ public static function validateAddress($address, $patternselect = 'auto') switch ($patternselect) { case 'pcre8': /** - * Conforms to RFC5322: Uses *correct* regex on which FILTER_VALIDATE_EMAIL is - * based; So why not use FILTER_VALIDATE_EMAIL? Because it was broken to - * not allow a@b type valid addresses :( + * Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains. * @link http://squiloople.com/2009/12/20/email-address-validation/ * @copyright 2009-2010 Michael Rushton * Feel free to use and redistribute this code. But please keep this copyright notice. @@ -898,6 +908,14 @@ public static function validateAddress($address, $patternselect = 'auto') $address ); break; + case 'html5': + /** + * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. + * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) + */ + return (bool)preg_match('/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . + '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', $address); + break; case 'php': default: return (bool)filter_var($address, FILTER_VALIDATE_EMAIL); @@ -915,9 +933,8 @@ public static function validateAddress($address, $patternselect = 'auto') /** * Create a message and send it. * Uses the sending method specified by $Mailer. - * Returns false on error - Use the ErrorInfo variable to view description of the error. * @throws phpmailerException - * @return bool + * @return bool false on error - See the ErrorInfo property for details of the error. */ public function send() { @@ -926,11 +943,11 @@ public function send() return false; } return $this->postSend(); - } catch (phpmailerException $e) { + } catch (phpmailerException $exc) { $this->mailHeader = ''; - $this->setError($e->getMessage()); + $this->setError($exc->getMessage()); if ($this->exceptions) { - throw $e; + throw $exc; } return false; } @@ -944,7 +961,7 @@ public function send() public function preSend() { try { - $this->mailHeader = ""; + $this->mailHeader = ''; if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL); } @@ -968,9 +985,9 @@ public function preSend() // an extra header list which createHeader() doesn't fold in if ($this->Mailer == 'mail') { if (count($this->to) > 0) { - $this->mailHeader .= $this->addrAppend("To", $this->to); + $this->mailHeader .= $this->addrAppend('To', $this->to); } else { - $this->mailHeader .= $this->headerLine("To", "undisclosed-recipients:;"); + $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;'); } $this->mailHeader .= $this->headerLine( 'Subject', @@ -994,10 +1011,10 @@ public function preSend() } return true; - } catch (phpmailerException $e) { - $this->setError($e->getMessage()); + } catch (phpmailerException $exc) { + $this->setError($exc->getMessage()); if ($this->exceptions) { - throw $e; + throw $exc; } return false; } @@ -1015,20 +1032,26 @@ public function postSend() // Choose the mailer and send through it switch ($this->Mailer) { case 'sendmail': + case 'qmail': return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); case 'smtp': return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); case 'mail': return $this->mailSend($this->MIMEHeader, $this->MIMEBody); default: + $sendMethod = $this->Mailer.'Send'; + if (method_exists($this, $sendMethod)) { + return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); + } + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); } - } catch (phpmailerException $e) { - $this->setError($e->getMessage()); + } catch (phpmailerException $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); if ($this->exceptions) { - throw $e; + throw $exc; } - $this->edebug($e->getMessage() . "\n"); } return false; } @@ -1045,16 +1068,24 @@ public function postSend() protected function sendmailSend($header, $body) { if ($this->Sender != '') { - $sendmail = sprintf("%s -oi -f%s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); + if ($this->Mailer == 'qmail') { + $sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); + } else { + $sendmail = sprintf('%s -oi -f%s -t', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); + } } else { - $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); + if ($this->Mailer == 'qmail') { + $sendmail = sprintf('%s', escapeshellcmd($this->Sendmail)); + } else { + $sendmail = sprintf('%s -oi -t', escapeshellcmd($this->Sendmail)); + } } if ($this->SingleTo === true) { foreach ($this->SingleToArray as $val) { if (!@$mail = popen($sendmail, 'w')) { throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } - fputs($mail, "To: " . $val . "\n"); + fputs($mail, 'To: ' . $val . "\n"); fputs($mail, $header); fputs($mail, $body); $result = pclose($mail); @@ -1094,38 +1125,38 @@ protected function sendmailSend($header, $body) protected function mailSend($header, $body) { $toArr = array(); - foreach ($this->to as $t) { - $toArr[] = $this->addrFormat($t); + foreach ($this->to as $toaddr) { + $toArr[] = $this->addrFormat($toaddr); } $to = implode(', ', $toArr); if (empty($this->Sender)) { - $params = " "; + $params = ' '; } else { - $params = sprintf("-f%s", $this->Sender); + $params = sprintf('-f%s', $this->Sender); } if ($this->Sender != '' and !ini_get('safe_mode')) { $old_from = ini_get('sendmail_from'); ini_set('sendmail_from', $this->Sender); } - $rt = false; + $result = false; if ($this->SingleTo === true && count($toArr) > 1) { foreach ($toArr as $val) { - $rt = $this->mailPassthru($val, $this->Subject, $body, $header, $params); + $result = $this->mailPassthru($val, $this->Subject, $body, $header, $params); // implement call back function if it exists - $isSent = ($rt == 1) ? 1 : 0; + $isSent = ($result == 1) ? 1 : 0; $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body, $this->From); } } else { - $rt = $this->mailPassthru($to, $this->Subject, $body, $header, $params); + $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); // implement call back function if it exists - $isSent = ($rt == 1) ? 1 : 0; + $isSent = ($result == 1) ? 1 : 0; $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body, $this->From); } if (isset($old_from)) { ini_set('sendmail_from', $old_from); } - if (!$rt) { + if (!$result) { throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL); } return true; @@ -1169,7 +1200,7 @@ protected function smtpSend($header, $body) throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL); } - // Attempt to send attach all recipients + // Attempt to send to all recipients foreach ($this->to as $to) { if (!$this->smtp->recipient($to[0])) { $bad_rcpt[] = $to[0]; @@ -1198,10 +1229,8 @@ protected function smtpSend($header, $body) $this->doCallback($isSent, '', '', $bcc[0], $this->Subject, $body, $this->From); } - if (count($bad_rcpt) > 0) { //Create error message for any bad addresses - throw new phpmailerException($this->lang('recipients_failed') . implode(', ', $bad_rcpt)); - } - if (!$this->smtp->data($header . $body)) { + //Only send the DATA command if we have viable recipients + if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) { throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL); } if ($this->SMTPKeepAlive == true) { @@ -1210,6 +1239,12 @@ protected function smtpSend($header, $body) $this->smtp->quit(); $this->smtp->close(); } + if (count($bad_rcpt) > 0) { //Create error message for any bad addresses + throw new phpmailerException( + $this->lang('recipients_failed') . implode(', ', $bad_rcpt), + self::STOP_CONTINUE + ); + } return true; } @@ -1237,25 +1272,36 @@ public function smtpConnect($options = array()) $this->smtp->setDebugLevel($this->SMTPDebug); $this->smtp->setDebugOutput($this->Debugoutput); $this->smtp->setVerp($this->do_verp); - $tls = ($this->SMTPSecure == 'tls'); - $ssl = ($this->SMTPSecure == 'ssl'); $hosts = explode(';', $this->Host); $lastexception = null; foreach ($hosts as $hostentry) { $hostinfo = array(); - $host = $hostentry; + if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) { + //Not a valid host entry + continue; + } + //$hostinfo[2]: optional ssl or tls prefix + //$hostinfo[3]: the hostname + //$hostinfo[4]: optional port number + //The host string prefix can temporarily override the current setting for SMTPSecure + //If it's not specified, the default value is used + $prefix = ''; + $tls = ($this->SMTPSecure == 'tls'); + if ($hostinfo[2] == 'ssl' or ($hostinfo[2] == '' and $this->SMTPSecure == 'ssl')) { + $prefix = 'ssl://'; + $tls = false; //Can't have SSL and TLS at once + } elseif ($hostinfo[2] == 'tls') { + $tls = true; + //tls doesn't use a prefix + } + $host = $hostinfo[3]; $port = $this->Port; - if (preg_match( - '/^(.+):([0-9]+)$/', - $hostentry, - $hostinfo - ) - ) { //If $hostentry contains 'address:port', override default - $host = $hostinfo[1]; - $port = $hostinfo[2]; + $tport = (integer)$hostinfo[4]; + if ($tport > 0 and $tport < 65536) { + $port = $tport; } - if ($this->smtp->connect(($ssl ? 'ssl://' : '') . $host, $port, $this->Timeout, $options)) { + if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { try { if ($this->Helo) { $hello = $this->Helo; @@ -1284,8 +1330,8 @@ public function smtpConnect($options = array()) } } return true; - } catch (phpmailerException $e) { - $lastexception = $e; + } catch (phpmailerException $exc) { + $lastexception = $exc; //We must have connected, but then failed TLS or Auth, so close connection nicely $this->smtp->quit(); } @@ -1323,9 +1369,9 @@ public function smtpClose() * @return bool * @access public */ - public function setLanguage($langcode = 'en', $lang_path = 'language/') + public function setLanguage($langcode = 'en', $lang_path = '') { - //Define full set of translatable strings + //Define full set of translatable strings in English $PHPMAILER_LANG = array( 'authenticate' => 'SMTP Error: Could not authenticate.', 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', @@ -1346,14 +1392,24 @@ public function setLanguage($langcode = 'en', $lang_path = 'language/') 'smtp_error' => 'SMTP server error: ', 'variable_set' => 'Cannot set or reset variable: ' ); - //Overwrite language-specific strings. - //This way we'll never have missing translations - no more "language string failed to load"! - $l = true; + if (empty($lang_path)) { + //Calculate an absolute path so it can work if CWD is not here + $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR; + } + $foundlang = true; + $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; if ($langcode != 'en') { //There is no English translation file - $l = @include $lang_path . 'phpmailer.lang-' . $langcode . '.php'; + //Make sure language file path is readable + if (!is_readable($lang_file)) { + $foundlang = false; + } else { + //Overwrite language-specific strings. + //This way we'll never have missing translations. + $foundlang = include $lang_file; + } } $this->language = $PHPMAILER_LANG; - return ($l == true); //Returns false if language not found + return ($foundlang == true); //Returns false if language not found } /** @@ -1378,8 +1434,8 @@ public function getTranslations() public function addrAppend($type, $addr) { $addresses = array(); - foreach ($addr as $a) { - $addresses[] = $this->addrFormat($a); + foreach ($addr as $address) { + $addresses[] = $this->addrFormat($address); } return $type . ': ' . implode(', ', $addresses) . $this->LE; } @@ -1396,9 +1452,9 @@ public function addrFormat($addr) if (empty($addr[1])) { // No name provided return $this->secureHeader($addr[0]); } else { - return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . " <" . $this->secureHeader( + return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader( $addr[0] - ) . ">"; + ) . '>'; } } @@ -1415,10 +1471,10 @@ public function addrFormat($addr) */ public function wrapText($message, $length, $qp_mode = false) { - $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE; + $soft_break = ($qp_mode) ? sprintf(' =%s', $this->LE) : $this->LE; // If utf-8 encoding is used, we will need to make sure we don't // split multibyte characters when we wrap - $is_utf8 = (strtolower($this->CharSet) == "utf-8"); + $is_utf8 = (strtolower($this->CharSet) == 'utf-8'); $lelen = strlen($this->LE); $crlflen = strlen(self::CRLF); @@ -1441,15 +1497,15 @@ public function wrapText($message, $length, $qp_mode = false) $len = $space_left; if ($is_utf8) { $len = $this->utf8CharBoundary($word, $len); - } elseif (substr($word, $len - 1, 1) == "=") { + } elseif (substr($word, $len - 1, 1) == '=') { $len--; - } elseif (substr($word, $len - 2, 1) == "=") { + } elseif (substr($word, $len - 2, 1) == '=') { $len -= 2; } $part = substr($word, 0, $len); $word = substr($word, $len); $buf .= ' ' . $part; - $message .= $buf . sprintf("=%s", self::CRLF); + $message .= $buf . sprintf('=%s', self::CRLF); } else { $message .= $buf . $soft_break; } @@ -1462,16 +1518,16 @@ public function wrapText($message, $length, $qp_mode = false) $len = $length; if ($is_utf8) { $len = $this->utf8CharBoundary($word, $len); - } elseif (substr($word, $len - 1, 1) == "=") { + } elseif (substr($word, $len - 1, 1) == '=') { $len--; - } elseif (substr($word, $len - 2, 1) == "=") { + } elseif (substr($word, $len - 2, 1) == '=') { $len -= 2; } $part = substr($word, 0, $len); $word = substr($word, $len); if (strlen($word) > 0) { - $message .= $part . sprintf("=%s", self::CRLF); + $message .= $part . sprintf('=%s', self::CRLF); } else { $buf = $part; } @@ -1507,7 +1563,7 @@ public function utf8CharBoundary($encodedText, $maxLength) $lookBack = 3; while (!$foundSplitPos) { $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); - $encodedCharPos = strpos($lastChunk, "="); + $encodedCharPos = strpos($lastChunk, '='); if ($encodedCharPos !== false) { // Found start of encoded character byte within $lookBack block. // Check the encoded byte value (the 2 chars after the '=') @@ -1534,7 +1590,6 @@ public function utf8CharBoundary($encodedText, $maxLength) return $maxLength; } - /** * Set the body wrapping. * @access public @@ -1575,31 +1630,25 @@ public function createHeader() $this->boundary[3] = 'b3_' . $uniq_id; if ($this->MessageDate == '') { - $result .= $this->headerLine('Date', self::rfcDate()); - } else { - $result .= $this->headerLine('Date', $this->MessageDate); + $this->MessageDate = self::rfcDate(); } + $result .= $this->headerLine('Date', $this->MessageDate); - if ($this->ReturnPath) { - $result .= $this->headerLine('Return-Path', '<' . trim($this->ReturnPath) . '>'); - } elseif ($this->Sender == '') { - $result .= $this->headerLine('Return-Path', '<' . trim($this->From) . '>'); - } else { - $result .= $this->headerLine('Return-Path', '<' . trim($this->Sender) . '>'); - } // To be created automatically by mail() - if ($this->Mailer != 'mail') { - if ($this->SingleTo === true) { - foreach ($this->to as $t) { - $this->SingleToArray[] = $this->addrFormat($t); + if ($this->SingleTo === true) { + if ($this->Mailer != 'mail') { + foreach ($this->to as $toaddr) { + $this->SingleToArray[] = $this->addrFormat($toaddr); } - } else { - if (count($this->to) > 0) { + } + } else { + if (count($this->to) > 0) { + if ($this->Mailer != 'mail') { $result .= $this->addrAppend('To', $this->to); - } elseif (count($this->cc) == 0) { - $result .= $this->headerLine('To', 'undisclosed-recipients:;'); } + } elseif (count($this->cc) == 0) { + $result .= $this->headerLine('To', 'undisclosed-recipients:;'); } } @@ -1611,7 +1660,11 @@ public function createHeader() } // sendmail and mail() extract Bcc from the header before sending - if ((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) { + if (( + $this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail' + ) + and count($this->bcc) > 0 + ) { $result .= $this->addrAppend('Bcc', $this->bcc); } @@ -1627,7 +1680,7 @@ public function createHeader() if ($this->MessageID != '') { $this->lastMessageID = $this->MessageID; } else { - $this->lastMessageID = sprintf("<%s@%s>", $uniq_id, $this->ServerHostname()); + $this->lastMessageID = sprintf('<%s@%s>', $uniq_id, $this->ServerHostname()); } $result .= $this->HeaderLine('Message-ID', $this->lastMessageID); $result .= $this->headerLine('X-Priority', $this->Priority); @@ -1670,6 +1723,7 @@ public function createHeader() public function getMailMIME() { $result = ''; + $ismultipart = true; switch ($this->message_type) { case 'inline': $result .= $this->headerLine('Content-Type', 'multipart/related;'); @@ -1690,11 +1744,20 @@ public function getMailMIME() default: // Catches case 'plain': and case '': $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); + $ismultipart = false; break; } //RFC1341 part 5 says 7bit is assumed if not specified if ($this->Encoding != '7bit') { - $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); + //RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE + if ($ismultipart) { + if ($this->Encoding == '8bit') { + $result .= $this->headerLine('Content-Transfer-Encoding', '8bit'); + } + //The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible + } else { + $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); + } } if ($this->Mailer != 'mail') { @@ -1707,8 +1770,8 @@ public function getMailMIME() /** * Returns the whole MIME message. * Includes complete headers and body. - * Only valid post PreSend(). - * @see PHPMailer::PreSend() + * Only valid post preSend(). + * @see PHPMailer::preSend() * @access public * @return string */ @@ -1735,16 +1798,28 @@ public function createBody() $this->setWordWrap(); + $bodyEncoding = $this->Encoding; + $bodyCharSet = $this->CharSet; + if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) { + $bodyEncoding = '7bit'; + $bodyCharSet = 'us-ascii'; + } + $altBodyEncoding = $this->Encoding; + $altBodyCharSet = $this->CharSet; + if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) { + $altBodyEncoding = '7bit'; + $altBodyCharSet = 'us-ascii'; + } switch ($this->message_type) { case 'inline': - $body .= $this->getBoundary($this->boundary[1], '', '', ''); - $body .= $this->encodeString($this->Body, $this->Encoding); + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[1]); break; case 'attach': - $body .= $this->getBoundary($this->boundary[1], '', '', ''); - $body .= $this->encodeString($this->Body, $this->Encoding); + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('attachment', $this->boundary[1]); break; @@ -1753,19 +1828,19 @@ public function createBody() $body .= $this->headerLine('Content-Type', 'multipart/related;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], '', '', ''); - $body .= $this->encodeString($this->Body, $this->Encoding); + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[2]); $body .= $this->LE; $body .= $this->attachAll('attachment', $this->boundary[1]); break; case 'alt': - $body .= $this->getBoundary($this->boundary[1], '', 'text/plain', ''); - $body .= $this->encodeString($this->AltBody, $this->Encoding); + $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; - $body .= $this->getBoundary($this->boundary[1], '', 'text/html', ''); - $body .= $this->encodeString($this->Body, $this->Encoding); + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; if (!empty($this->Ical)) { $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', ''); @@ -1775,15 +1850,15 @@ public function createBody() $body .= $this->endBoundary($this->boundary[1]); break; case 'alt_inline': - $body .= $this->getBoundary($this->boundary[1], '', 'text/plain', ''); - $body .= $this->encodeString($this->AltBody, $this->Encoding); + $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->textLine('--' . $this->boundary[1]); $body .= $this->headerLine('Content-Type', 'multipart/related;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], '', 'text/html', ''); - $body .= $this->encodeString($this->Body, $this->Encoding); + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[2]); $body .= $this->LE; @@ -1794,11 +1869,11 @@ public function createBody() $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], '', 'text/plain', ''); - $body .= $this->encodeString($this->AltBody, $this->Encoding); + $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; - $body .= $this->getBoundary($this->boundary[2], '', 'text/html', ''); - $body .= $this->encodeString($this->Body, $this->Encoding); + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->endBoundary($this->boundary[2]); $body .= $this->LE; @@ -1809,15 +1884,15 @@ public function createBody() $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], '', 'text/plain', ''); - $body .= $this->encodeString($this->AltBody, $this->Encoding); + $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->textLine('--' . $this->boundary[2]); $body .= $this->headerLine('Content-Type', 'multipart/related;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[3], '', 'text/html', ''); - $body .= $this->encodeString($this->Body, $this->Encoding); + $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[3]); $body .= $this->LE; @@ -1827,7 +1902,7 @@ public function createBody() break; default: // catch case 'plain' and case '' - $body .= $this->encodeString($this->Body, $this->Encoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); break; } @@ -1838,6 +1913,7 @@ public function createBody() if (!defined('PKCS7_TEXT')) { throw new phpmailerException($this->lang('signing') . ' OpenSSL extension missing.'); } + //TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1 $file = tempnam(sys_get_temp_dir(), 'mail'); file_put_contents($file, $body); //TODO check this worked $signed = tempnam(sys_get_temp_dir(), 'signed'); @@ -1857,10 +1933,10 @@ public function createBody() @unlink($signed); throw new phpmailerException($this->lang('signing') . openssl_error_string()); } - } catch (phpmailerException $e) { + } catch (phpmailerException $exc) { $body = ''; if ($this->exceptions) { - throw $e; + throw $exc; } } } @@ -1889,9 +1965,12 @@ protected function getBoundary($boundary, $charSet, $contentType, $encoding) $encoding = $this->Encoding; } $result .= $this->textLine('--' . $boundary); - $result .= sprintf("Content-Type: %s; charset=%s", $contentType, $charSet); + $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); $result .= $this->LE; - $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); + //RFC1341 part 5 says 7bit is assumed if not specified + if ($encoding != '7bit') { + $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); + } $result .= $this->LE; return $result; @@ -1919,17 +1998,17 @@ protected function setMessageType() { $this->message_type = array(); if ($this->alternativeExists()) { - $this->message_type[] = "alt"; + $this->message_type[] = 'alt'; } if ($this->inlineImageExists()) { - $this->message_type[] = "inline"; + $this->message_type[] = 'inline'; } if ($this->attachmentExists()) { - $this->message_type[] = "attach"; + $this->message_type[] = 'attach'; } - $this->message_type = implode("_", $this->message_type); - if ($this->message_type == "") { - $this->message_type = "plain"; + $this->message_type = implode('_', $this->message_type); + if ($this->message_type == '') { + $this->message_type = 'plain'; } } @@ -1995,12 +2074,12 @@ public function addAttachment($path, $name = '', $encoding = 'base64', $type = ' 7 => 0 ); - } catch (phpmailerException $e) { - $this->setError($e->getMessage()); + } catch (phpmailerException $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); if ($this->exceptions) { - throw $e; + throw $exc; } - $this->edebug($e->getMessage() . "\n"); return false; } return true; @@ -2059,17 +2138,20 @@ protected function attachAll($disposition_type, $boundary) } $cidUniq[$cid] = true; - $mime[] = sprintf("--%s%s", $boundary, $this->LE); + $mime[] = sprintf('--%s%s', $boundary, $this->LE); $mime[] = sprintf( - "Content-Type: %s; name=\"%s\"%s", + 'Content-Type: %s; name="%s"%s', $type, $this->encodeHeader($this->secureHeader($name)), $this->LE ); - $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); + //RFC1341 part 5 says 7bit is assumed if not specified + if ($encoding != '7bit') { + $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE); + } if ($disposition == 'inline') { - $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); + $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE); } // If a filename contains any of these chars, it should be quoted, @@ -2079,14 +2161,14 @@ protected function attachAll($disposition_type, $boundary) if (!(empty($disposition))) { if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $name)) { $mime[] = sprintf( - "Content-Disposition: %s; filename=\"%s\"%s", + 'Content-Disposition: %s; filename="%s"%s', $disposition, $this->encodeHeader($this->secureHeader($name)), $this->LE . $this->LE ); } else { $mime[] = sprintf( - "Content-Disposition: %s; filename=%s%s", + 'Content-Disposition: %s; filename=%s%s', $disposition, $this->encodeHeader($this->secureHeader($name)), $this->LE . $this->LE @@ -2113,9 +2195,9 @@ protected function attachAll($disposition_type, $boundary) } } - $mime[] = sprintf("--%s--%s", $boundary, $this->LE); + $mime[] = sprintf('--%s--%s', $boundary, $this->LE); - return implode("", $mime); + return implode('', $mime); } /** @@ -2152,8 +2234,8 @@ protected function encodeFile($path, $encoding = 'base64') } } return $file_buffer; - } catch (Exception $e) { - $this->setError($e->getMessage()); + } catch (Exception $exc) { + $this->setError($exc->getMessage()); return ''; } } @@ -2204,11 +2286,11 @@ public function encodeString($str, $encoding = 'base64') */ public function encodeHeader($str, $position = 'text') { - $x = 0; + $matchcount = 0; switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { - // Can't use addslashes as we don't know what value has magic_quotes_sybase + // Can't use addslashes as we don't know the value of magic_quotes_sybase $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { return ($encoded); @@ -2216,25 +2298,25 @@ public function encodeHeader($str, $position = 'text') return ("\"$encoded\""); } } - $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); + $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); break; /** @noinspection PhpMissingBreakStatementInspection */ case 'comment': - $x = preg_match_all('/[()"]/', $str, $matches); + $matchcount = preg_match_all('/[()"]/', $str, $matches); // Intentional fall-through case 'text': default: - $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); + $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); break; } - if ($x == 0) { //There are no chars that need encoding + if ($matchcount == 0) { //There are no chars that need encoding return ($str); } $maxlen = 75 - 7 - strlen($this->CharSet); // Try to select the encoding which should produce the shortest output - if ($x > strlen($str) / 3) { + if ($matchcount > strlen($str) / 3) { //More than a third of the content will need encoding, so B encoding will be most efficient $encoding = 'B'; if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) { @@ -2253,7 +2335,7 @@ public function encodeHeader($str, $position = 'text') $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded)); } - $encoded = preg_replace('/^(.*)$/m', " =?" . $this->CharSet . "?$encoding?\\1?=", $encoded); + $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); $encoded = trim(str_replace("\n", $this->LE, $encoded)); return $encoded; @@ -2274,22 +2356,33 @@ public function hasMultiBytes($str) } } + /** + * Does a string contain any 8-bit chars (in any charset)? + * @param string $text + * @return bool + */ + public function has8bitChars($text) + { + return (bool)preg_match('/[\x80-\xFF]/', $text); + } + /** * Encode and wrap long multibyte strings for mail headers * without breaking lines within a character. - * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php + * Adapted from a function by paravoid + * @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 * @access public * @param string $str multi-byte text to wrap encode - * @param string $lf string to use as linefeed/end-of-line + * @param string $linebreak string to use as linefeed/end-of-line * @return string */ - public function base64EncodeWrapMB($str, $lf = null) + public function base64EncodeWrapMB($str, $linebreak = null) { - $start = "=?" . $this->CharSet . "?B?"; - $end = "?="; - $encoded = ""; - if ($lf === null) { - $lf = $this->LE; + $start = '=?' . $this->CharSet . '?B?'; + $end = '?='; + $encoded = ''; + if ($linebreak === null) { + $linebreak = $this->LE; } $mb_length = mb_strlen($str, $this->CharSet); @@ -2308,11 +2401,11 @@ public function base64EncodeWrapMB($str, $lf = null) $chunk = base64_encode($chunk); $lookBack++; } while (strlen($chunk) > $length); - $encoded .= $chunk . $lf; + $encoded .= $chunk . $linebreak; } // Chomp the last linefeed - $encoded = substr($encoded, 0, -strlen($lf)); + $encoded = substr($encoded, 0, -strlen($linebreak)); return $encoded; } @@ -2323,12 +2416,12 @@ public function base64EncodeWrapMB($str, $lf = null) * @param string $string The text to encode * @param integer $line_max Number of chars allowed on a line before wrapping * @return string - * @link PHP version adapted from http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 + * @link http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 Adapted from this comment */ public function encodeQP($string, $line_max = 76) { if (function_exists('quoted_printable_encode')) { //Use native function if it's available (>= PHP5.3) - return quoted_printable_encode($string); + return $this->fixEOL(quoted_printable_encode($string)); } //Fall back to a pure PHP implementation $string = str_replace( @@ -2337,7 +2430,7 @@ public function encodeQP($string, $line_max = 76) rawurlencode($string) ); $string = preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string); - return $string; + return $this->fixEOL($string); } /** @@ -2393,9 +2486,9 @@ public function encodeQ($str, $position = 'text') if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { //If the string contains an '=', make sure it's the first thing we replace //so as to avoid double-encoding - $s = array_search('=', $matches[0]); - if ($s !== false) { - unset($matches[0][$s]); + $eqkey = array_search('=', $matches[0]); + if ($eqkey !== false) { + unset($matches[0][$eqkey]); array_unshift($matches[0], '='); } foreach (array_unique($matches[0]) as $char) { @@ -2683,14 +2776,16 @@ public static function rfcDate() */ protected function serverHostname() { + $result = 'localhost.localdomain'; if (!empty($this->Hostname)) { $result = $this->Hostname; - } elseif (isset($_SERVER['SERVER_NAME'])) { + } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) { $result = $_SERVER['SERVER_NAME']; - } else { - $result = 'localhost.localdomain'; + } elseif (function_exists('gethostname') && gethostname() !== false) { + $result = gethostname(); + } elseif (php_uname('n') !== false) { + $result = php_uname('n'); } - return $result; } @@ -2773,9 +2868,9 @@ public function addCustomHeader($name, $value = null) */ public function msgHTML($message, $basedir = '', $advanced = false) { - preg_match_all("/(src|background)=[\"'](.*)[\"']/Ui", $message, $images); + preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images); if (isset($images[2])) { - foreach ($images[2] as $i => $url) { + foreach ($images[2] as $imgindex => $url) { // do not change urls for absolute images (thanks to corvuscorax) if (!preg_match('#^[A-z]+://#', $url)) { $filename = basename($url); @@ -2799,8 +2894,8 @@ public function msgHTML($message, $basedir = '', $advanced = false) ) ) { $message = preg_replace( - "/" . $images[1][$i] . "=[\"']" . preg_quote($url, '/') . "[\"']/Ui", - $images[1][$i] . "=\"cid:" . $cid . "\"", + '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', + $images[1][$imgindex] . '="cid:' . $cid . '"', $message ); } @@ -2808,12 +2903,13 @@ public function msgHTML($message, $basedir = '', $advanced = false) } } $this->isHTML(true); - if (empty($this->AltBody)) { - $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n"; - } //Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better $this->Body = $this->normalizeBreaks($message); $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced)); + if (empty($this->AltBody)) { + $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . + self::CRLF . self::CRLF; + } return $this->Body; } @@ -2827,8 +2923,8 @@ public function html2text($html, $advanced = false) { if ($advanced) { require_once 'extras/class.html2text.php'; - $h = new html2text($html); - return $h->get_text(); + $htmlconverter = new html2text($html); + return $htmlconverter->get_text(); } return html_entity_decode( trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), @@ -2923,6 +3019,8 @@ public static function _mime_types($ext = '') 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', + 'vcf' => 'text/vcard', + 'vcard' => 'text/vcard', 'xml' => 'text/xml', 'xsl' => 'text/xml', 'mpeg' => 'video/mpeg', @@ -2969,19 +3067,19 @@ public static function filenameToType($filename) public static function mb_pathinfo($path, $options = null) { $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''); - $m = array(); - preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $m); - if (array_key_exists(1, $m)) { - $ret['dirname'] = $m[1]; + $pathinfo = array(); + preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo); + if (array_key_exists(1, $pathinfo)) { + $ret['dirname'] = $pathinfo[1]; } - if (array_key_exists(2, $m)) { - $ret['basename'] = $m[2]; + if (array_key_exists(2, $pathinfo)) { + $ret['basename'] = $pathinfo[2]; } - if (array_key_exists(5, $m)) { - $ret['extension'] = $m[5]; + if (array_key_exists(5, $pathinfo)) { + $ret['extension'] = $pathinfo[5]; } - if (array_key_exists(3, $m)) { - $ret['filename'] = $m[3]; + if (array_key_exists(3, $pathinfo)) { + $ret['filename'] = $pathinfo[3]; } switch ($options) { case PATHINFO_DIRNAME: @@ -3027,9 +3125,9 @@ public function set($name, $value = '') } else { throw new phpmailerException($this->lang('variable_set') . $name, self::STOP_CRITICAL); } - } catch (Exception $e) { - $this->setError($e->getMessage()); - if ($e->getCode() == self::STOP_CRITICAL) { + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + if ($exc->getCode() == self::STOP_CRITICAL) { return false; } } @@ -3064,7 +3162,7 @@ public static function normalizeBreaks($text, $breaktype = "\r\n") /** - * Set the private key file and password for S/MIME signing. + * Set the public and private key files and password for S/MIME signing. * @access public * @param string $cert_filename * @param string $key_filename @@ -3091,7 +3189,7 @@ public function DKIM_QP($txt) if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { $line .= $txt[$i]; } else { - $line .= "=" . sprintf("%02X", $ord); + $line .= '=' . sprintf('%02X', $ord); } } return $line; @@ -3100,15 +3198,15 @@ public function DKIM_QP($txt) /** * Generate a DKIM signature. * @access public - * @param string $s Header + * @param string $signheader Header * @throws phpmailerException * @return string */ - public function DKIM_Sign($s) + public function DKIM_Sign($signheader) { if (!defined('PKCS7_TEXT')) { if ($this->exceptions) { - throw new phpmailerException($this->lang("signing") . ' OpenSSL extension missing.'); + throw new phpmailerException($this->lang('signing') . ' OpenSSL extension missing.'); } return ''; } @@ -3118,7 +3216,7 @@ public function DKIM_Sign($s) } else { $privKey = $privKeyStr; } - if (openssl_sign($s, $signature, $privKey)) { + if (openssl_sign($signheader, $signature, $privKey)) { return base64_encode($signature); } return ''; @@ -3127,21 +3225,21 @@ public function DKIM_Sign($s) /** * Generate a DKIM canonicalization header. * @access public - * @param string $s Header + * @param string $signheader Header * @return string */ - public function DKIM_HeaderC($s) + public function DKIM_HeaderC($signheader) { - $s = preg_replace("/\r\n\s+/", " ", $s); - $lines = explode("\r\n", $s); + $signheader = preg_replace('/\r\n\s+/', ' ', $signheader); + $lines = explode("\r\n", $signheader); foreach ($lines as $key => $line) { - list($heading, $value) = explode(":", $line, 2); + list($heading, $value) = explode(':', $line, 2); $heading = strtolower($heading); - $value = preg_replace("/\s+/", " ", $value); // Compress useless spaces - $lines[$key] = $heading . ":" . trim($value); // Don't forget to remove WSP around the value + $value = preg_replace('/\s+/', ' ', $value); // Compress useless spaces + $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value } - $s = implode("\r\n", $lines); - return $s; + $signheader = implode("\r\n", $lines); + return $signheader; } /** @@ -3208,17 +3306,17 @@ public function DKIM_Add($headers_line, $subject, $body) ); // Copied header fields (dkim-quoted-printable) $body = $this->DKIM_BodyC($body); $DKIMlen = strlen($body); // Length of body - $DKIMb64 = base64_encode(pack("H*", sha1($body))); // Base64 of packed binary SHA-1 hash of body - $ident = ($this->DKIM_identity == '') ? '' : " i=" . $this->DKIM_identity . ";"; - $dkimhdrs = "DKIM-Signature: v=1; a=" . - $DKIMsignatureType . "; q=" . - $DKIMquery . "; l=" . - $DKIMlen . "; s=" . + $DKIMb64 = base64_encode(pack('H*', sha1($body))); // Base64 of packed binary SHA-1 hash of body + $ident = ($this->DKIM_identity == '') ? '' : ' i=' . $this->DKIM_identity . ';'; + $dkimhdrs = 'DKIM-Signature: v=1; a=' . + $DKIMsignatureType . '; q=' . + $DKIMquery . '; l=' . + $DKIMlen . '; s=' . $this->DKIM_selector . ";\r\n" . - "\tt=" . $DKIMtime . "; c=" . $DKIMcanonicalization . ";\r\n" . + "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" . "\th=From:To:Subject;\r\n" . - "\td=" . $this->DKIM_domain . ";" . $ident . "\r\n" . + "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" . "\tz=$from\r\n" . "\t|$to\r\n" . "\t|$subject;\r\n" . @@ -3231,6 +3329,56 @@ public function DKIM_Add($headers_line, $subject, $body) return $dkimhdrs . $signed . "\r\n"; } + /** + * Allows for public read access to 'to' property. + * @access public + * @return array + */ + public function getToAddresses() + { + return $this->to; + } + + /** + * Allows for public read access to 'cc' property. + * @access public + * @return array + */ + public function getCcAddresses() + { + return $this->cc; + } + + /** + * Allows for public read access to 'bcc' property. + * @access public + * @return array + */ + public function getBccAddresses() + { + return $this->bcc; + } + + /** + * Allows for public read access to 'ReplyTo' property. + * @access public + * @return array + */ + public function getReplyToAddresses() + { + return $this->ReplyTo; + } + + /** + * Allows for public read access to 'all_recipients' property. + * @access public + * @return array + */ + public function getAllRecipientAddresses() + { + return $this->all_recipients; + } + /** * Perform a callback. * @param bool $isSent diff --git a/third_party/phpmailer/class.pop3.php b/third_party/phpmailer/class.pop3.php index 042b93a..71dffac 100644 --- a/third_party/phpmailer/class.pop3.php +++ b/third_party/phpmailer/class.pop3.php @@ -1,15 +1,14 @@ + * @author Marcus Bointon (Synchro/coolbru) * @author Jim Jagielski (jimjag) * @author Andy Prevost (codeworxtech) * @author Brent R. Matzelle (original founder) - * @copyright 2013 Marcus Bointon + * @copyright 2012 - 2014 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License @@ -24,11 +23,10 @@ * Does not support APOP. * @package PHPMailer * @author Richard Davey (original author) - * @author Marcus Bointon (coolbru) + * @author Marcus Bointon (Synchro/coolbru) * @author Jim Jagielski (jimjag) * @author Andy Prevost (codeworxtech) */ - class POP3 { /** @@ -36,7 +34,7 @@ class POP3 * @type string * @access public */ - public $Version = '5.2.7'; + public $Version = '5.2.8'; /** * Default POP3 port number. @@ -337,11 +335,11 @@ public function disconnect() */ private function getResponse($size = 128) { - $r = fgets($this->pop_conn, $size); + $response = fgets($this->pop_conn, $size); if ($this->do_debug >= 1) { - echo "Server -> Client: $r"; + echo "Server -> Client: $response"; } - return $r; + return $response; } /** diff --git a/third_party/phpmailer/class.smtp.php b/third_party/phpmailer/class.smtp.php index e6b4522..ec75ca5 100644 --- a/third_party/phpmailer/class.smtp.php +++ b/third_party/phpmailer/class.smtp.php @@ -1,102 +1,117 @@ + * PHP Version 5 + * @package PHPMailer + * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project + * @author Marcus Bointon (Synchro/coolbru) * @author Jim Jagielski (jimjag) * @author Andy Prevost (codeworxtech) - * @copyright 2013 Marcus Bointon - * @copyright 2004 - 2008 Andy Prevost + * @author Brent R. Matzelle (original founder) + * @copyright 2014 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski - * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. */ /** * PHPMailer RFC821 SMTP email transport class. - * - * Implements RFC 821 SMTP commands - * and provides some utility methods for sending mail to an SMTP server. - * - * PHP Version 5.0.0 - * - * @category PHP - * @package PHPMailer - * @link https://github.com/PHPMailer/PHPMailer/blob/master/class.smtp.php - * @author Chris Ryan - * @author Marcus Bointon - * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) + * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server. + * @package PHPMailer + * @author Chris Ryan + * @author Marcus Bointon */ - class SMTP { /** - * The PHPMailer SMTP Version number. + * The PHPMailer SMTP version number. + * @type string */ - const VERSION = '5.2.7'; + const VERSION = '5.2.8'; /** * SMTP line break constant. + * @type string */ const CRLF = "\r\n"; /** * The SMTP port to use if one is not specified. + * @type int */ const DEFAULT_SMTP_PORT = 25; + /** + * The maximum line length allowed by RFC 2822 section 2.1.1 + * @type int + */ + const MAX_LINE_LENGTH = 998; + /** * The PHPMailer SMTP Version number. * @type string - * @deprecated This should be a constant + * @deprecated Use the constant instead * @see SMTP::VERSION */ - public $Version = '5.2.7'; + public $Version = '5.2.8'; /** * SMTP server port number. * @type int - * @deprecated This is only ever ued as default value, so should be a constant + * @deprecated This is only ever used as a default value, so use the constant instead * @see SMTP::DEFAULT_SMTP_PORT */ public $SMTP_PORT = 25; /** - * SMTP reply line ending + * SMTP reply line ending. * @type string - * @deprecated Use the class constant instead + * @deprecated Use the constant instead * @see SMTP::CRLF */ public $CRLF = "\r\n"; /** * Debug output level. - * Options: 0 for no output, 1 for commands, 2 for data and commands + * Options: + * * `0` No output + * * `1` Commands + * * `2` Data and commands + * * `3` As 2 plus connection status + * * `4` Low-level data output * @type int */ public $do_debug = 0; /** - * The function/method to use for debugging output. - * Options: 'echo', 'html' or 'error_log' + * How to handle debug output. + * Options: + * * `echo` Output plain-text as-is, appropriate for CLI + * * `html` Output escaped, line breaks converted to
, appropriate for browser output + * * `error_log` Output to error log as configured in php.ini * @type string */ public $Debugoutput = 'echo'; /** * Whether to use VERP. + * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path + * @link http://www.postfix.org/VERP_README.html Info on VERP * @type bool */ public $do_verp = false; /** - * The SMTP timeout value for reads, in seconds. + * The timeout value for connection, in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 + * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. + * @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2 * @type int */ - public $Timeout = 15; + public $Timeout = 300; /** * The SMTP timelimit value for reads, in seconds. @@ -137,7 +152,6 @@ public function __construct() $this->smtp_conn = 0; $this->error = null; $this->helo_rply = null; - $this->do_debug = 0; } @@ -164,15 +178,14 @@ protected function edebug($str) break; case 'echo': default: - //Just echoes whatever was received - echo $str; + echo gmdate('Y-m-d H:i:s')."\t".trim($str)."\n"; } } /** * Connect to an SMTP server. - * @param string $host SMTP server IP or host name - * @param int $port The port number to connect to + * @param string $host SMTP server IP or host name + * @param int $port The port number to connect to * @param int $timeout How long to wait for the connection to open * @param array $options An array of options for stream_context_create() * @access public @@ -182,19 +195,19 @@ public function connect($host, $port = null, $timeout = 30, $options = array()) { // Clear errors to avoid confusion $this->error = null; - // Make sure we are __not__ connected if ($this->connected()) { // Already connected, generate error $this->error = array('error' => 'Already connected to a server'); return false; } - if (empty($port)) { $port = self::DEFAULT_SMTP_PORT; } - // Connect to the SMTP server + if ($this->do_debug >= 3) { + $this->edebug('Connection: opening'); + } $errno = 0; $errstr = ''; $socket_context = stream_context_create($options); @@ -207,7 +220,6 @@ public function connect($host, $port = null, $timeout = 30, $options = array()) STREAM_CLIENT_CONNECT, $socket_context ); - // Verify we connected properly if (empty($this->smtp_conn)) { $this->error = array( @@ -217,13 +229,15 @@ public function connect($host, $port = null, $timeout = 30, $options = array()) ); if ($this->do_debug >= 1) { $this->edebug( - 'SMTP -> ERROR: ' . $this->error['error'] + 'SMTP ERROR: ' . $this->error['error'] . ": $errstr ($errno)" ); } return false; } - + if ($this->do_debug >= 3) { + $this->edebug('Connection: opened'); + } // SMTP server can take longer to respond, give longer timeout for first read // Windows does not have support for this timeout function if (substr(PHP_OS, 0, 3) != 'WIN') { @@ -233,14 +247,11 @@ public function connect($host, $port = null, $timeout = 30, $options = array()) } stream_set_timeout($this->smtp_conn, $timeout, 0); } - // Get any announcement $announce = $this->get_lines(); - if ($this->do_debug >= 2) { - $this->edebug('SMTP -> FROM SERVER:' . $announce); + $this->edebug('SERVER -> CLIENT: ' . $announce); } - return true; } @@ -251,7 +262,7 @@ public function connect($host, $port = null, $timeout = 30, $options = array()) */ public function startTLS() { - if (!$this->sendCommand("STARTTLS", "STARTTLS", 220)) { + if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) { return false; } // Begin encrypted connection @@ -259,8 +270,7 @@ public function startTLS() $this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT - ) - ) { + )) { return false; } return true; @@ -288,7 +298,6 @@ public function authenticate( if (empty($authtype)) { $authtype = 'LOGIN'; } - switch ($authtype) { case 'PLAIN': // Start authentication @@ -351,7 +360,6 @@ public function authenticate( ) { return false; } - //Though 0 based, there is a white space after the 3 digit number //msg2 $challenge = substr($this->last_reply, 3); @@ -411,13 +419,13 @@ protected function hmac($data, $key) // Eliminates the need to install mhash to compute a HMAC // Hacked by Lance Rushing - $b = 64; // byte length for md5 - if (strlen($key) > $b) { + $bytelen = 64; // byte length for md5 + if (strlen($key) > $bytelen) { $key = pack('H*', md5($key)); } - $key = str_pad($key, $b, chr(0x00)); - $ipad = str_pad('', $b, chr(0x36)); - $opad = str_pad('', $b, chr(0x5c)); + $key = str_pad($key, $bytelen, chr(0x00)); + $ipad = str_pad('', $bytelen, chr(0x36)); + $opad = str_pad('', $bytelen, chr(0x5c)); $k_ipad = $key ^ $ipad; $k_opad = $key ^ $opad; @@ -437,7 +445,7 @@ public function connected() // the socket is valid but we are not connected if ($this->do_debug >= 1) { $this->edebug( - 'SMTP -> NOTICE: EOF caught while checking if connected' + 'SMTP NOTICE: EOF caught while checking if connected' ); } $this->close(); @@ -462,6 +470,9 @@ public function close() if (!empty($this->smtp_conn)) { // close the connection and cleanup fclose($this->smtp_conn); + if ($this->do_debug >= 3) { + $this->edebug('Connection: closed'); + } $this->smtp_conn = 0; } } @@ -483,62 +494,52 @@ public function data($msg_data) if (!$this->sendCommand('DATA', 'DATA', 354)) { return false; } - /* The server is ready to accept data! - * according to rfc821 we should not send more than 1000 - * including the CRLF - * characters on a single line so we will break the data up - * into lines by \r and/or \n then if needed we will break - * each of those into smaller lines to fit within the limit. - * in addition we will be looking for lines that start with - * a period '.' and append and additional period '.' to that - * line. NOTE: this does not count towards limit. + * According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF) + * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into + * smaller lines to fit within the limit. + * We will also look for lines that start with a '.' and prepend an additional '.'. + * NOTE: this does not count towards line-length limit. */ - // Normalize the line breaks before exploding - $msg_data = str_replace("\r\n", "\n", $msg_data); - $msg_data = str_replace("\r", "\n", $msg_data); - $lines = explode("\n", $msg_data); - - /* We need to find a good way to determine if headers are - * in the msg_data or if it is a straight msg body - * currently I am assuming rfc822 definitions of msg headers - * and if the first field of the first line (':' separated) - * does not contain a space then it _should_ be a header - * and we can process all lines before a blank "" line as - * headers. + // Normalize line breaks before exploding + $lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data)); + + /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field + * of the first line (':' separated) does not contain a space then it _should_ be a header and we will + * process all lines before a blank line as headers. */ $field = substr($lines[0], 0, strpos($lines[0], ':')); $in_headers = false; - if (!empty($field) && !strstr($field, ' ')) { + if (!empty($field) && strpos($field, ' ') === false) { $in_headers = true; } - //RFC 2822 section 2.1.1 limit - $max_line_length = 998; - foreach ($lines as $line) { - $lines_out = null; - if ($line == '' && $in_headers) { + $lines_out = array(); + if ($in_headers and $line == '') { $in_headers = false; } // ok we need to break this line up into several smaller lines - while (strlen($line) > $max_line_length) { - $pos = strrpos(substr($line, 0, $max_line_length), ' '); - - // Patch to fix DOS attack - if (!$pos) { - $pos = $max_line_length - 1; + //This is a small micro-optimisation: isset($str[$len]) is equivalent to (strlen($str) > $len) + while (isset($line[self::MAX_LINE_LENGTH])) { + //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on + //so as to avoid breaking in the middle of a word + $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); + if (!$pos) { //Deliberately matches both false and 0 + //No nice break found, add a hard break + $pos = self::MAX_LINE_LENGTH - 1; $lines_out[] = substr($line, 0, $pos); $line = substr($line, $pos); } else { + //Break at the found point $lines_out[] = substr($line, 0, $pos); + //Move along by the amount we dealt with $line = substr($line, $pos + 1); } - /* If processing headers add a LWSP-char to the front of new line - * rfc822 on long msg headers + * RFC822 section 3.1.1 */ if ($in_headers) { $line = "\t" . $line; @@ -546,12 +547,11 @@ public function data($msg_data) } $lines_out[] = $line; - // send the lines to the server - while (list(, $line_out) = @each($lines_out)) { - if (strlen($line_out) > 0) { - if (substr($line_out, 0, 1) == '.') { - $line_out = '.' . $line_out; - } + // Send the lines to the server + foreach ($lines_out as $line_out) { + //RFC2821 section 4.5.2 + if (!empty($line_out) and $line_out[0] == '.') { + $line_out = '.' . $line_out; } $this->client_send($line_out . self::CRLF); } @@ -565,7 +565,7 @@ public function data($msg_data) * Send an SMTP HELO or EHLO command. * Used to identify the sending server to the receiving server. * This makes sure that client and server are in a known state. - * Implements from RFC 821: HELO + * Implements RFC 821: HELO * and RFC 2821 EHLO. * @param string $host The host name or IP to connect to * @access public @@ -574,13 +574,7 @@ public function data($msg_data) public function hello($host = '') { // Try extended hello first (RFC 2821) - if (!$this->sendHello('EHLO', $host)) { - if (!$this->sendHello('HELO', $host)) { - return false; - } - } - - return true; + return (bool)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host)); } /** @@ -588,7 +582,7 @@ public function hello($host = '') * Low-level implementation used by hello() * @see hello() * @param string $hello The HELO string - * @param string $host The hostname to say we are + * @param string $host The hostname to say we are * @access protected * @return bool */ @@ -631,28 +625,28 @@ public function mail($from) public function quit($close_on_error = true) { $noerror = $this->sendCommand('QUIT', 'QUIT', 221); - $e = $this->error; //Save any error + $err = $this->error; //Save any error if ($noerror or $close_on_error) { $this->close(); - $this->error = $e; //Restore any error from the quit command + $this->error = $err; //Restore any error from the quit command } return $noerror; } /** * Send an SMTP RCPT command. - * Sets the TO argument to $to. + * Sets the TO argument to $toaddr. * Returns true if the recipient was accepted false if it was rejected. * Implements from rfc 821: RCPT TO: - * @param string $to The address the message is being sent to + * @param string $toaddr The address the message is being sent to * @access public * @return bool */ - public function recipient($to) + public function recipient($toaddr) { return $this->sendCommand( - 'RCPT TO ', - 'RCPT TO:<' . $to . '>', + 'RCPT TO', + 'RCPT TO:<' . $toaddr . '>', array(250, 251) ); } @@ -681,7 +675,7 @@ protected function sendCommand($command, $commandstring, $expect) { if (!$this->connected()) { $this->error = array( - "error" => "Called $command without being connected" + 'error' => "Called $command without being connected" ); return false; } @@ -691,19 +685,19 @@ protected function sendCommand($command, $commandstring, $expect) $code = substr($reply, 0, 3); if ($this->do_debug >= 2) { - $this->edebug('SMTP -> FROM SERVER:' . $reply); + $this->edebug('SERVER -> CLIENT: ' . $reply); } if (!in_array($code, (array)$expect)) { $this->last_reply = null; $this->error = array( - "error" => "$command command failed", - "smtp_code" => $code, - "detail" => substr($reply, 4) + 'error' => "$command command failed", + 'smtp_code' => $code, + 'detail' => substr($reply, 4) ); if ($this->do_debug >= 1) { $this->edebug( - 'SMTP -> ERROR: ' . $this->error['error'] . ': ' . $reply + 'SMTP ERROR: ' . $this->error['error'] . ': ' . $reply ); } return false; @@ -729,7 +723,7 @@ protected function sendCommand($command, $commandstring, $expect) */ public function sendAndMail($from) { - return $this->sendCommand("SAML", "SAML FROM:$from", 250); + return $this->sendCommand('SAML', "SAML FROM:$from", 250); } /** @@ -740,7 +734,7 @@ public function sendAndMail($from) */ public function verify($name) { - return $this->sendCommand("VRFY", "VRFY $name", array(250, 251)); + return $this->sendCommand('VRFY', "VRFY $name", array(250, 251)); } /** @@ -751,14 +745,14 @@ public function verify($name) */ public function noop() { - return $this->sendCommand("NOOP", "NOOP", 250); + return $this->sendCommand('NOOP', 'NOOP', 250); } /** * Send an SMTP TURN command. * This is an optional command for SMTP that this class does not support. - * This method is here to make the RFC821 Definition - * complete for this class and __may__ be implemented in future + * This method is here to make the RFC821 Definition complete for this class + * and _may_ be implemented in future * Implements from rfc 821: TURN * @access public * @return bool @@ -769,7 +763,7 @@ public function turn() 'error' => 'The SMTP TURN command is not implemented' ); if ($this->do_debug >= 1) { - $this->edebug('SMTP -> NOTICE: ' . $this->error['error']); + $this->edebug('SMTP NOTICE: ' . $this->error['error']); } return false; } @@ -778,12 +772,12 @@ public function turn() * Send raw data to the server. * @param string $data The data to send * @access public - * @return int|bool The number of bytes sent to the server or FALSE on error + * @return int|bool The number of bytes sent to the server or false on error */ public function client_send($data) { if ($this->do_debug >= 1) { - $this->edebug("CLIENT -> SMTP: $data"); + $this->edebug("CLIENT -> SERVER: $data"); } return fwrite($this->smtp_conn, $data); } @@ -819,12 +813,12 @@ public function getLastReply() */ protected function get_lines() { - $data = ''; - $endtime = 0; - // If the connection is bad, give up now + // If the connection is bad, give up straight away if (!is_resource($this->smtp_conn)) { - return $data; + return ''; } + $data = ''; + $endtime = 0; stream_set_timeout($this->smtp_conn, $this->Timeout); if ($this->Timelimit > 0) { $endtime = time() + $this->Timelimit; @@ -839,8 +833,8 @@ protected function get_lines() if ($this->do_debug >= 4) { $this->edebug("SMTP -> get_lines(): \$data is \"$data\""); } - // if 4th character is a space, we are done reading, break the loop - if (substr($str, 3, 1) == ' ') { + // If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen + if ((isset($str[3]) and $str[3] == ' ')) { break; } // Timed-out? Log and break @@ -854,16 +848,14 @@ protected function get_lines() break; } // Now check if reads took too long - if ($endtime) { - if (time() > $endtime) { - if ($this->do_debug >= 4) { - $this->edebug( - 'SMTP -> get_lines(): timelimit reached (' - . $this->Timelimit . ' sec)' - ); - } - break; + if ($endtime and time() > $endtime) { + if ($this->do_debug >= 4) { + $this->edebug( + 'SMTP -> get_lines(): timelimit reached ('. + $this->Timelimit . ' sec)' + ); } + break; } } return $data; diff --git a/third_party/phpmailer/language/phpmailer.lang-be.php b/third_party/phpmailer/language/phpmailer.lang-be.php new file mode 100644 index 0000000..16fb4ff --- /dev/null +++ b/third_party/phpmailer/language/phpmailer.lang-be.php @@ -0,0 +1,24 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'Памылка SMTP: памылка ідэнтыфікацыі.'; +$PHPMAILER_LANG['connect_host'] = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Памылка SMTP: звесткі непрынятыя.'; +$PHPMAILER_LANG['empty_message'] = 'Пустое паведамленне.'; +$PHPMAILER_LANG['encoding'] = 'Невядомая кадыроўка тэксту: '; +$PHPMAILER_LANG['execute'] = 'Нельга выканаць каманду: '; +$PHPMAILER_LANG['file_access'] = 'Няма доступу да файла: '; +$PHPMAILER_LANG['file_open'] = 'Нельга адкрыць файл: '; +$PHPMAILER_LANG['from_failed'] = 'Няправільны адрас адпраўніка: '; +$PHPMAILER_LANG['instantiate'] = 'Нельга прымяніць функцыю mail().'; +$PHPMAILER_LANG['invalid_address'] = 'Нельга даслаць паведамленне, няправільны email атрымальніка: '; +$PHPMAILER_LANG['provide_address'] = 'Запоўніце, калі ласка, правільны email атрымальніка.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.'; +$PHPMAILER_LANG['recipients_failed'] = 'Памылка SMTP: няправільныя атрымальнікі: '; +$PHPMAILER_LANG['signing'] = 'Памылка подпісу паведамлення: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Памылка сувязі з SMTP-серверам.'; +$PHPMAILER_LANG['smtp_error'] = 'Памылка SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-br.php b/third_party/phpmailer/language/phpmailer.lang-br.php index 87ecbdf..3cff3d5 100644 --- a/third_party/phpmailer/language/phpmailer.lang-br.php +++ b/third_party/phpmailer/language/phpmailer.lang-br.php @@ -1,7 +1,7 @@ +* Edit: Mohammad Hossein Mojtahedi */ -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: احراز هویت با شکست مواجه شد.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: اتصال به سرور SMTP برقرار نشد.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: داده ها نادرست هستند.'; +$PHPMAILER_LANG['authenticate'] = 'خطای SMTP: احراز هویت با شکست مواجه شد.'; +$PHPMAILER_LANG['connect_host'] = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.'; +$PHPMAILER_LANG['data_not_accepted'] = 'خطای SMTP: داده‌ها نا‌درست هستند.'; $PHPMAILER_LANG['empty_message'] = 'بخش متن پیام خالی است.'; -$PHPMAILER_LANG['encoding'] = 'رمزگذاری ناشناخته: '; +$PHPMAILER_LANG['encoding'] = 'کد‌گذاری نا‌شناخته: '; $PHPMAILER_LANG['execute'] = 'امکان اجرا وجود ندارد: '; $PHPMAILER_LANG['file_access'] = 'امکان دسترسی به فایل وجود ندارد: '; -$PHPMAILER_LANG['file_open'] = 'File Error: امکان بازکردن فایل وجود ندارد: '; +$PHPMAILER_LANG['file_open'] = 'خطای File: امکان بازکردن فایل وجود ندارد: '; $PHPMAILER_LANG['from_failed'] = 'آدرس فرستنده اشتباه است: '; $PHPMAILER_LANG['instantiate'] = 'امکان معرفی تابع ایمیل وجود ندارد.'; $PHPMAILER_LANG['invalid_address'] = 'آدرس ایمیل معتبر نیست: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی شود.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی‌شود.'; $PHPMAILER_LANG['provide_address'] = 'باید حداقل یک آدرس گیرنده وارد کنید.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: ارسال به آدرس گیرنده با خطا مواجه شد: '; +$PHPMAILER_LANG['recipients_failed'] = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: '; $PHPMAILER_LANG['signing'] = 'خطا در امضا: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'خطا در اتصال به SMTP.'; $PHPMAILER_LANG['smtp_error'] = 'خطا در SMTP Server: '; -$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیرها وجود ندارد: '; +$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیر‌ها وجود ندارد: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-fr.php b/third_party/phpmailer/language/phpmailer.lang-fr.php index 2d23cf5..9c8ebd1 100644 --- a/third_party/phpmailer/language/phpmailer.lang-fr.php +++ b/third_party/phpmailer/language/phpmailer.lang-fr.php @@ -12,12 +12,12 @@ $PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l\'authentification.'; $PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : impossible de se connecter au serveur SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Erreur SMTP : données incorrectes.'; -$PHPMAILER_LANG['empty_message'] = 'Corps de message vide.'; +$PHPMAILER_LANG['empty_message'] = 'Corps du message vide.'; $PHPMAILER_LANG['encoding'] = 'Encodage inconnu : '; $PHPMAILER_LANG['execute'] = 'Impossible de lancer l\'exécution : '; $PHPMAILER_LANG['file_access'] = 'Impossible d\'accéder au fichier : '; -$PHPMAILER_LANG['file_open'] = 'Erreur de fichier : ouverture impossible : '; -$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échouée : '; +$PHPMAILER_LANG['file_open'] = 'Ouverture du fichier impossible : '; +$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échoué : '; $PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.'; $PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide : '; $PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.'; @@ -26,4 +26,4 @@ $PHPMAILER_LANG['signing'] = 'Erreur de signature : '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Échec de la connexion SMTP.'; $PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : '; -$PHPMAILER_LANG['variable_set'] = 'Ne peut initialiser ou réinitialiser une variable : '; +$PHPMAILER_LANG['variable_set'] = 'Impossible d\'initialiser ou de réinitialiser une variable : '; diff --git a/third_party/phpmailer/language/phpmailer.lang-gl.php b/third_party/phpmailer/language/phpmailer.lang-gl.php new file mode 100644 index 0000000..da7c213 --- /dev/null +++ b/third_party/phpmailer/language/phpmailer.lang-gl.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela autentikacija.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznati encoding: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje s navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; +$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definirajte barem jednu adresu primatelja.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP poslužitelj nije uspjelo.'; +$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP poslužitelja: '; +$PHPMAILER_LANG['variable_set'] = 'Ne mogu postaviti varijablu niti ju vratiti nazad: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-ka.php b/third_party/phpmailer/language/phpmailer.lang-ka.php new file mode 100644 index 0000000..301b26e --- /dev/null +++ b/third_party/phpmailer/language/phpmailer.lang-ka.php @@ -0,0 +1,24 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.'; +$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: '; +$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: '; +$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: '; +$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: '; +$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: '; +$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.'; +$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: '; +$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია'; +$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: '; +$PHPMAILER_LANG['signing'] = 'ხელმოწერის შეცდომა: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: '; +$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-lv.php b/third_party/phpmailer/language/phpmailer.lang-lv.php new file mode 100644 index 0000000..2cc87e2 --- /dev/null +++ b/third_party/phpmailer/language/phpmailer.lang-lv.php @@ -0,0 +1,24 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP kļūda: Autorizācija neizdevās.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Kļūda: Nepieņem informāciju.'; +$PHPMAILER_LANG['empty_message'] = 'Ziņojuma teksts ir tukšs'; +$PHPMAILER_LANG['encoding'] = 'Neatpazīts kodējums: '; +$PHPMAILER_LANG['execute'] = 'Neizdevās izpildīt komandu: '; +$PHPMAILER_LANG['file_access'] = 'Fails nav pieejams: '; +$PHPMAILER_LANG['file_open'] = 'Faila kļūda: Nevar atvērt failu: '; +$PHPMAILER_LANG['from_failed'] = 'Nepareiza sūtītāja adrese: '; +$PHPMAILER_LANG['instantiate'] = 'Nevar palaist sūtīšanas funkciju.'; +$PHPMAILER_LANG['invalid_address'] = 'Nepareiza adrese'; +$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.'; +$PHPMAILER_LANG['provide_address'] = 'Lūdzu, norādiet vismaz vienu adresātu.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: '; +$PHPMAILER_LANG['signing'] = 'Autorizācijas kļūda: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP savienojuma kļūda'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP servera kļūda: '; +$PHPMAILER_LANG['variable_set'] = 'Nevar piešķirt mainīgā vērtību: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-nl.php b/third_party/phpmailer/language/phpmailer.lang-nl.php index c86d769..5a88b5f 100644 --- a/third_party/phpmailer/language/phpmailer.lang-nl.php +++ b/third_party/phpmailer/language/phpmailer.lang-nl.php @@ -4,21 +4,21 @@ * Dutch Version by Tuxion */ -$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.';//SMTP Error: Could not authenticate. -$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.';//SMTP Error: Could not connect to SMTP host. -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.';//SMTP Error: Data not accepted. -$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg';//Message body empty -$PHPMAILER_LANG['encoding'] = 'Onbekende codering: ';//Unknown encoding: -$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: ';//Could not execute: -$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: ';//Could not access file: -$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: ';//File Error: Could not open file: -$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: ';//The following From address failed: -$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.';//Could not instantiate mail function. -$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres';//Invalid address -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';// mailer is not supported. -$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.';//You must provide at least one recipient email address. -$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: ';//SMTP Error: The following recipients failed: -$PHPMAILER_LANG['signing'] = 'Signeerfout: ';//Signing Error: +$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; +$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; +$PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; +$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; +$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; +$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; +$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; +$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; +$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; +$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; +$PHPMAILER_LANG['signing'] = 'Signeerfout: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: ';//SMTP server error: -$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variablen niet instellen of resetten: ';//Cannot set or reset variable: +$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; +$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variablen niet instellen of resetten: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-no.php b/third_party/phpmailer/language/phpmailer.lang-no.php index e697520..db1e327 100644 --- a/third_party/phpmailer/language/phpmailer.lang-no.php +++ b/third_party/phpmailer/language/phpmailer.lang-no.php @@ -21,4 +21,4 @@ $PHPMAILER_LANG['signing'] = 'Signeringsfeil: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() feilet.'; $PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfeil: '; -$PHPMAILER_LANG['variable_set'] = 'Kan ikke sette eller resette variabelen: '; \ No newline at end of file +$PHPMAILER_LANG['variable_set'] = 'Kan ikke sette eller resette variabelen: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-pl.php b/third_party/phpmailer/language/phpmailer.lang-pl.php index 5a4ad38..294cac0 100644 --- a/third_party/phpmailer/language/phpmailer.lang-pl.php +++ b/third_party/phpmailer/language/phpmailer.lang-pl.php @@ -4,7 +4,7 @@ * Polish Version */ -$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić autentykacji.'; +$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić uwierzytelnienia.'; $PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.'; $PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.'; $PHPMAILER_LANG['empty_message'] = 'Wiadomość jest pusta.'; @@ -14,11 +14,12 @@ $PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: '; $PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest nieprawidłowy: '; $PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.'; -$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, następujący adres Odbiorcy jest nieprawidłowy: '; +$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, '. + 'następujący adres Odbiorcy jest nieprawidłowy: '; $PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.'; $PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.'; $PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: '; $PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zakończone niepowodzeniem.'; $PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Nie można zmienić zmiennej: '; +$PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-pt.php b/third_party/phpmailer/language/phpmailer.lang-pt.php new file mode 100644 index 0000000..341a27c --- /dev/null +++ b/third_party/phpmailer/language/phpmailer.lang-pt.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није успела.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: није могуће повезивање са SMTP сервером.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци нису прихваћени.'; +$PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.'; +$PHPMAILER_LANG['encoding'] = 'Непознато кодовање: '; +$PHPMAILER_LANG['execute'] = 'Није могуће извршити наредбу: '; +$PHPMAILER_LANG['file_access'] = 'Није могуће приступити датотеци: '; +$PHPMAILER_LANG['file_open'] = 'Није могуће отворити датотеку: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP грешка: слање са следећих адреса није успело: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: слање на следеће адресе није успело: '; +$PHPMAILER_LANG['instantiate'] = 'Није могуће покренути mail функцију.'; +$PHPMAILER_LANG['invalid_address'] = 'Порука није послата због неисправне адресе.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.'; +$PHPMAILER_LANG['provide_address'] = 'Потребно је задати најмање једну адресу.'; +$PHPMAILER_LANG['signing'] = 'Грешка приликом пријављивања: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Повезивање са SMTP сервером није успело.'; +$PHPMAILER_LANG['smtp_error'] = 'Грешка SMTP сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Није могуће задати променљиву, нити је вратити уназад: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-tr.php b/third_party/phpmailer/language/phpmailer.lang-tr.php index abba081..4b524c0 100644 --- a/third_party/phpmailer/language/phpmailer.lang-tr.php +++ b/third_party/phpmailer/language/phpmailer.lang-tr.php @@ -3,24 +3,25 @@ * PHPMailer language file: refer to English translation for definitive list * Turkish version * Türkçe Versiyonu -* ÝZYAZILIM - Elçin Özel - Can Yýlmaz - Mehmet Benlioðlu +* Elçin Özel - Can Yılmaz - Mehmet Benlioğlu +* Updated by: github.com/yasinaydin */ -$PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Doğrulanamıyor.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP hosta bağlanılamıyor.'; +$PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Oturum açılamadı.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP sunucusuna bağlanılamadı.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatası: Veri kabul edilmedi.'; -$PHPMAILER_LANG['empty_message'] = 'Mesaj içeriği boş'; -$PHPMAILER_LANG['encoding'] = 'Bilinmeyen şifreleme: '; -$PHPMAILER_LANG['execute'] = 'Çalıtırılamıyor: '; -$PHPMAILER_LANG['file_access'] = 'Dosyaya erişilemiyor: '; -$PHPMAILER_LANG['file_open'] = 'Dosya Hatası: Dosya açılamıyor: '; -$PHPMAILER_LANG['from_failed'] = 'Başarısız olan gönderici adresi: '; -$PHPMAILER_LANG['instantiate'] = 'Örnek mail fonksiyonu oluşturulamadı.'; -$PHPMAILER_LANG['invalid_address'] = 'Gönderilmedi, email adresi geçersiz: '; -$PHPMAILER_LANG['provide_address'] = 'En az bir tane mail adresi belirtmek zorundasınız alıcının email adresi.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailler desteklenmemektedir.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: alıcılara ulaımadı: '; +$PHPMAILER_LANG['empty_message'] = 'Mesajın içeriği boş'; +$PHPMAILER_LANG['encoding'] = 'Bilinmeyen karakter kodlama: '; +$PHPMAILER_LANG['execute'] = 'Çalıştırılamadı: '; +$PHPMAILER_LANG['file_access'] = 'Dosyaya erişilemedi: '; +$PHPMAILER_LANG['file_open'] = 'Dosya Hatası: Dosya açılamadı: '; +$PHPMAILER_LANG['from_failed'] = 'Belirtilen adreslere gönderme başarısız: '; +$PHPMAILER_LANG['instantiate'] = 'Örnek e-posta fonksiyonu oluşturulamadı.'; +$PHPMAILER_LANG['invalid_address'] = 'Geçersiz e-posta adresi: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.'; +$PHPMAILER_LANG['provide_address'] = 'En az bir alıcı e-posta adresi belirtmelisiniz.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: '; $PHPMAILER_LANG['signing'] = 'İmzalama hatası: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP bağlantı() başarısız.'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() fonksiyonu başarısız.'; $PHPMAILER_LANG['smtp_error'] = 'SMTP sunucu hatası: '; -$PHPMAILER_LANG['variable_set'] = 'Ayarlanamıyor yada sıfırlanamıyor: '; +$PHPMAILER_LANG['variable_set'] = 'Değişken ayarlanamadı ya da sıfırlanamadı: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-vi.php b/third_party/phpmailer/language/phpmailer.lang-vi.php new file mode 100644 index 0000000..a2da236 --- /dev/null +++ b/third_party/phpmailer/language/phpmailer.lang-vi.php @@ -0,0 +1,25 @@ + + * @license GNU/GPL version 2 or GNU/LGPL version 2.1 or any later version + */ +$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.'; +$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.'; +$PHPMAILER_LANG['empty_message'] = 'Không có nội dung'; +$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: '; +$PHPMAILER_LANG['execute'] = 'Không thực hiện được: '; +$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin '; +$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: '; +$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: '; +$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.'; +$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng'; +$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.'; +$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.'; +$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: '; +$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP'; +$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp '; +$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-zh.php b/third_party/phpmailer/language/phpmailer.lang-zh.php index b0e8f4e..bfeb3db 100644 --- a/third_party/phpmailer/language/phpmailer.lang-zh.php +++ b/third_party/phpmailer/language/phpmailer.lang-zh.php @@ -3,23 +3,24 @@ * PHPMailer language file: refer to English translation for definitive list * Traditional Chinese Version * @author liqwei +* @author Peter Dave Hello */ -$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登錄失敗。'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連接到 SMTP 主機。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:數據不被接受。'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。'; +$PHPMAILER_LANG['empty_message'] = '郵件內容為空'; $PHPMAILER_LANG['encoding'] = '未知編碼: '; -$PHPMAILER_LANG['file_access'] = '無法訪問文件:'; -$PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:'; +$PHPMAILER_LANG['file_access'] = '無法存取檔案:'; +$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:'; $PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; $PHPMAILER_LANG['execute'] = '無法執行:'; -$PHPMAILER_LANG['instantiate'] = '未知函數調用。'; -//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。'; +$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: '; $PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; -$PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。'; +$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:'; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +$PHPMAILER_LANG['signing'] = '登入失敗: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP連線失敗'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP伺服器錯誤: '; +$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: '; diff --git a/third_party/phpmailer/language/phpmailer.lang-zh_cn.php b/third_party/phpmailer/language/phpmailer.lang-zh_cn.php index 78eb9ac..626b602 100644 --- a/third_party/phpmailer/language/phpmailer.lang-zh_cn.php +++ b/third_party/phpmailer/language/phpmailer.lang-zh_cn.php @@ -3,23 +3,24 @@ * PHPMailer language file: refer to English translation for definitive list * Simplified Chinese Version * @author liqwei +* @author young blog:binaryoung.com */ $PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; $PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; -//$P$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; $PHPMAILER_LANG['encoding'] = '未知编码: '; $PHPMAILER_LANG['execute'] = '无法执行:'; $PHPMAILER_LANG['file_access'] = '无法访问文件:'; $PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; $PHPMAILER_LANG['from_failed'] = '发送地址错误:'; $PHPMAILER_LANG['instantiate'] = '未知函数调用。'; -//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的。'; $PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; $PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +$PHPMAILER_LANG['signing'] = '登录失败:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错: '; +$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:';