diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-05-30 18:11:42 -0400 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-05-30 18:12:15 -0400 |
commit | acf5cd0a4b55c1b6817a9956a57103b40483d82f (patch) | |
tree | 81f5061f0c59441ce03a14740ab33a3452f473d5 | |
parent | 63c66f35074108add42924495393374d5cd07580 (diff) | |
download | ampache-acf5cd0a4b55c1b6817a9956a57103b40483d82f.tar.gz ampache-acf5cd0a4b55c1b6817a9956a57103b40483d82f.tar.bz2 ampache-acf5cd0a4b55c1b6817a9956a57103b40483d82f.zip |
Bump PHPMailer to 5.2.6
Development has moved to GitHub: https://github.com/PHPMailer/PHPMailer
41 files changed, 2636 insertions, 1217 deletions
@@ -68,7 +68,7 @@ Ampache includes some external modules that carry their own licensing. * [PHP-gettext](https://launchpad.net/php-gettext): GPL v2 * php_musicbrainz: LGPL v2.1 * PHP MPD interface: GPL v2 -* [PHPMailer](http://phpmailer.codeworxtech.com/): LGPL v2.1 +* [PHPMailer](https://github.com/PHPMailer/PHPMailer): LGPL v2.1 * [Prototype](http://www.prototypejs.org/): MIT * [Snoopy](http://snoopy.sourceforge.net/): LGPL v2.1 * validateEmail.php: "free for any use" diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 1dd9ba6b..a6631a13 100755 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,7 @@ CHANGELOG 3.6-FUTURE ---------- +- Updated PHPMailer to 5.2.6 3.6-alpha6 *2013-05-30* ----------------------- diff --git a/modules/phpmailer/README b/modules/phpmailer/README deleted file mode 100644 index 8d48dc05..00000000 --- a/modules/phpmailer/README +++ /dev/null @@ -1,218 +0,0 @@ -/******************************************************************* -* The http://phpmailer.codeworxtech.com/ website now carries a few * -* advertisements through the Google Adsense network. Please visit * -* the advertiser sites and help us offset some of our costs. * -* Thanks .... * -********************************************************************/ - -PHPMailer -Full Featured Email Transfer Class for PHP -========================================== - -Version 5.0.0 (April 02, 2009) - -With the release of this version, we are initiating a new version numbering -system to differentiate from the PHP4 version of PHPMailer. - -Most notable in this release is fully object oriented code. - -We now have available the PHPDocumentor (phpdocs) documentation. This is -separate from the regular download to keep file sizes down. Please see the -download area of http://phpmailer.codeworxtech.com. - -We also have created a new test script (see /test_script) that you can use -right out of the box. Copy the /test_script folder directly to your server (in -the same structure ... with class.phpmailer.php and class.smtp.php in the -folder above it. Then launch the test script with: -http://www.yourdomain.com/phpmailer/test_script/index.php -from this one script, you can test your server settings for mail(), sendmail (or -qmail), and SMTP. This will email you a sample email (using contents.html for -the email body) and two attachments. One of the attachments is used as an inline -image to demonstrate how PHPMailer will automatically detect if attachments are -the same source as inline graphics and only include one version. Once you click -the Submit button, the results will be displayed including any SMTP debug -information and send status. We will also display a version of the script that -you can cut and paste to include in your projects. Enjoy! - -Version 2.3 (November 08, 2008) - -We have removed the /phpdoc from the downloads. All documentation is now on -the http://phpmailer.codeworxtech.com website. - -The phpunit.php has been updated to support PHP5. - -For all other changes and notes, please see the changelog. - -Donations are accepted at PayPal with our id "paypal@worxteam.com". - -Version 2.2 (July 15 2008) - -- see the changelog. - -Version 2.1 (June 04 2008) - -With this release, we are announcing that the development of PHPMailer for PHP5 -will be our focus from this date on. We have implemented all the enhancements -and fixes from the latest release of PHPMailer for PHP4. - -Far more important, though, is that this release of PHPMailer (v2.1) is -fully tested with E_STRICT error checking enabled. - -** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. - IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE - APPRECIATED. - -We have now added S/MIME functionality (ability to digitally sign emails). -BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. -The "Signed Emails" functionality adds the Sign method to pass the private key -filename and the password to read it, and then email will be sent with -content-type multipart/signed and with the digital signature attached. - -A quick note on E_STRICT: - -- In about half the test environments the development version was subjected - to, an error was thrown for the date() functions (used at 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 - directive, (for your own server timezone) -- If you do get this error, and are unable to access your php.ini file, there is - a workaround. In your PHP script, add - date_default_timezone_set('America/Toronto'); - - * do NOT try to use - $myVar = date_default_timezone_get(); - as a test, it will throw an error. - -We have also included more example files to show the use of "sendmail", "mail()", -"smtp", and "gmail". - -We are also looking for more programmers to join the volunteer development team. -If you have an interest in this, please let us know. - -Enjoy! - - -Version 2.1.0beta1 & beta2 - -please note, this is BETA software -** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS -INTENDED STRICTLY FOR TESTING - -** NOTE: - -As of November 2007, PHPMailer has a new project team headed by industry -veteran Andy Prevost (codeworxtech). The first release in more than two -years will focus on fixes, adding ease-of-use enhancements, provide -basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility -features. A new release is planned before year-end 2007 that will provide -full compatiblity with PHP4 and PHP5, as well as more bug fixes. - -We are looking for project developers to assist in restoring PHPMailer to -its leadership position. Our goals are to simplify use of PHPMailer, provide -good documentation and examples, and retain backward compatibility to level -1.7.3 standards. - -If you are interested in helping out, visit http://sourceforge.net/projects/phpmailer -and indicate your interest. - -** - -http://phpmailer.sourceforge.net/ - -This software is licenced under the LGPL. Please read LICENSE for information on the -software availability and distribution. - -Class Features: -- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs -- Redundant SMTP servers -- Multipart/alternative emails for mail clients that do not read HTML email -- Support for 8bit, base64, binary, and quoted-printable encoding -- Uses the same methods as the very popular AspEmail active server (COM) component -- SMTP authentication -- Native language support -- Word wrap, and more! - -Why you might need it: - -Many PHP developers utilize email in their code. The only PHP function -that supports this is the mail() function. However, it does not expose -any of the popular features that many email clients use nowadays like -HTML-based emails and attachments. There are two proprietary -development tools out there that have all the functionality built into -easy to use classes: AspEmail(tm) and AspMail. Both of these -programs are COM components only available on Windows. They are also a -little pricey for smaller projects. - -Since I do Linux development I�ve missed these tools for my PHP coding. -So I built a version myself that implements the same methods (object -calls) that the Windows-based components do. It is open source and the -LGPL license allows you to place the class in your proprietary PHP -projects. - - -Installation: - -Copy class.phpmailer.php into your php.ini include_path. If you are -using the SMTP mailer then place class.smtp.php in your path as well. -In the language directory you will find several files like -phpmailer.lang-en.php. If you look right before the .php extension -that there are two letters. These represent the language type of the -translation file. For instance "en" is the English file and "br" is -the Portuguese file. Chose the file that best fits with your language -and place it in the PHP include path. If your language is English -then you have nothing more to do. If it is a different language then -you must point PHPMailer to the correct translation. To do this, call -the PHPMailer SetLanguage method like so: - -// To load the Portuguese version -$mail->SetLanguage("br", "/optional/path/to/language/directory/"); - -That's it. You should now be ready to use PHPMailer! - - -A Simple Example: - -<?php -require("class.phpmailer.php"); - -$mail = new PHPMailer(); - -$mail->IsSMTP(); // set mailer to use SMTP -$mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server -$mail->SMTPAuth = true; // turn on SMTP authentication -$mail->Username = "jswan"; // SMTP username -$mail->Password = "secret"; // SMTP password - -$mail->From = "from@example.com"; -$mail->FromName = "Mailer"; -$mail->AddAddress("josh@example.net", "Josh Adams"); -$mail->AddAddress("ellen@example.com"); // name is optional -$mail->AddReplyTo("info@example.com", "Information"); - -$mail->WordWrap = 50; // set word wrap to 50 characters -$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments -$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name -$mail->IsHTML(true); // set email format to HTML - -$mail->Subject = "Here is the subject"; -$mail->Body = "This is the HTML message body <b>in bold!</b>"; -$mail->AltBody = "This is the body in plain text for non-HTML mail clients"; - -if(!$mail->Send()) -{ - echo "Message could not be sent. <p>"; - echo "Mailer Error: " . $mail->ErrorInfo; - exit; -} - -echo "Message has been sent"; -?> - -CHANGELOG - -See ChangeLog.txt - -Download: http://sourceforge.net/project/showfiles.php?group_id=26031 - -Andy Prevost diff --git a/modules/phpmailer/README.md b/modules/phpmailer/README.md new file mode 100644 index 00000000..671141da --- /dev/null +++ b/modules/phpmailer/README.md @@ -0,0 +1,134 @@ +# PHPMailer - A full-featured email creation and transfer class for PHP + +Build status: [](https://travis-ci.org/Synchro/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 +- 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 +- Native language support +- Compatible with PHP 5.0 and later +- Much more! + +## Why you might need it + +Many PHP developers utilize email in their code. The only PHP function that supports this is the mail() function. However, it does not provide any assistance for making use of popular features such as HTML-based emails and attachments. + +Formatting email correctly is surprisingly difficult. There are myriad overlapping RFCs, requiring tight adherence to horribly complicated formatting and encoding rules - the vast majority of code that you'll find online that uses the mail() function directly is just plain wrong! +*Please* don't be tempted to do it yourself - if you don't use PHPMailer, there are many other excellent libraries that you should look at before rolling your own - try SwiftMailer, Zend_Mail, eZcomponents etc. + +The PHP mail() function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD and OS X platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP implementation allows email sending on Windows platforms without a local mail server. + +## License + +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 + +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. + + +## A Simple Example + +```php +<?php +require 'class.phpmailer.php'; + +$mail = new PHPMailer; + +$mail->IsSMTP(); // Set mailer to use SMTP +$mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup server +$mail->SMTPAuth = true; // Enable SMTP authentication +$mail->Username = 'jswan'; // 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('ellen@example.com'); // Name is optional +$mail->AddReplyTo('info@example.com', 'Information'); +$mail->AddCC('cc@example.com'); +$mail->AddBCC('bcc@example.com'); + +$mail->WordWrap = 50; // Set word wrap to 50 characters +$mail->AddAttachment('/var/tmp/file.tar.gz'); // Add attachments +$mail->AddAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name +$mail->IsHTML(true); // Set email format to HTML + +$mail->Subject = 'Here is the subject'; +$mail->Body = 'This is the HTML message body <b>in bold!</b>'; +$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 has been sent'; +``` + +You'll find plenty more to play with in the `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: + +```php +// To load the French version +$mail->SetLanguage('fr', '/optional/path/to/language/directory/'); +``` + +## 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. + +## Tests + +You'll find a PHPUnit test script in the `test` folder. + +Build status: [](https://travis-ci.org/PHPMailer/PHPMailer) + +If this isn't passing, is there something you can do to help? + +## Contributing + +Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). + +We're particularly interested in fixing edge-cases, expanding test coverage and updating translations. + +With the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone: + +git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git + +Please *don't* use the SourceForge or Google Code projects any more. + +## Changelog + +See changelog.md + +## History +- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/). +- Marcus Bointon (coolbru on SF) and Andy Prevost (codeworxtech) took over the project in 2004. +- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski. +- Marcus created his fork on [GitHub](https://github.com/Synchro/PHPMailer). +- Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer. +- PHPMailer moves to the [PHPMailer organisation](https://github.com/PHPMailer) on GitHub. + +### What's changed since moving from SourceForge? +- Official successor to the SourceForge and Google Code projects. +- Test suite. +- Continuous integration with Travis-CI. +- Composer support. +- Rolling releases. +- 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/modules/phpmailer/aboutus.html b/modules/phpmailer/aboutus.html deleted file mode 100644 index 6737bda4..00000000 --- a/modules/phpmailer/aboutus.html +++ /dev/null @@ -1,169 +0,0 @@ -<html> -<head> -<style> -body, p, li, td { - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; -} -ul { - margin:0 0px 0 15px; - padding:0; -} -div.width { - width: 760px; - text-align: left; -} -</style> -<script> -<!-- -var popsite="http://phpmailer.codeworxtech.com" -var withfeatures="width=960,height=760,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0" -var once_per_session=0 -function get_cookie(Name) { - var search = Name + "=" - var returnvalue = ""; - if (document.cookie.length > 0) { - offset = document.cookie.indexOf(search) - if (offset != -1) { // if cookie exists - offset += search.length - // set index of beginning of value - end = document.cookie.indexOf(";", offset); - // set index of end of cookie value - if (end == -1) - end = document.cookie.length; - returnvalue=unescape(document.cookie.substring(offset, end)) - } - } - return returnvalue; -} -function loadornot(){ - if (get_cookie('popsite')=='') { - loadpopsite() - document.cookie="popsite=yes" - } -} -function loadpopsite(){ - win2=window.open(popsite,"",withfeatures) - win2.blur() - window.focus() -} -if (once_per_session==0) { - loadpopsite() -} else { - loadornot() -} ---> -</script> -</head> -<body> -<center> -<div class="width"> -<hr> -The http://phpmailer.codeworxtech.com/ website now carries a few -advertisements through the Google Adsense network to help offset -some of our costs.<br /> -Thanks ....<br /> -<hr> -<p>PHPMailer is the world's leading email transport class and downloaded an -average of more than 32,000 each month. In March 2009, PHPMailer was downloaded -more than 31,000 times -- that's an average of 1,000 downloads daily. Our thanks -to our new users and loyal users. We understand you have many choices available -to select from and we thank you for select our fast and stable tool for your -website and projects.</p> -<p>Credits:<br> -PHPMailer's original founder is Brent Matzelle. The current team is:<br> -Project Administrator: Andy Prevost (codeworxtech), -<a href="mailto:codeworxtech@users.sourceforge.net"> -codeworxtech@users.sourceforge.net</a><br> -Author: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net<br> -Author: Marcus Bointon (coolbru) <a href="mailto:coolbru@users.sourceforge.net"> -coolbru@users.sourceforge.net</a></p> -<p>PHPMailer is used in many projects ranging from Open Source to commercial -packages. Our LGPL licensing terms are very flexible and allow for including -PHPMailer to enhance projects of all types. If you discover PHPMailer being used -in a project, please let us know about it.</p> -<p><strong>WHY USE OUR TOOLS & WHAT'S IN IT FOR YOU?</strong></p> -<p>A valid question. We're developers too. We've been writing software, primarily for the internet, for more than 15 years. Along the way, there are two major things that had tremendous impact of our company: PHP and Open Source. PHP is without doubt the most popular platform for the internet. There has been more progress in this area of technology because of Open Source software than in any other IT segment. We have used many open source tools, some as learning tools, some as components in projects we were working on. To us, it's not about popularity ... we're committed to robust, stable, and efficient tools you can use to get your projects in your user's hands quickly. So the shorter answer: what's in it for you? rapid development and rapid deployment without fuss and with straight forward open source licensing.</p> -<p>Now, here's our team:</p> -<table width="100%" cellpadding="5" style="border-collapse: collapse" border="1"> - <tr> - <th><b>About Andy Prevost, AKA "codeworxtech".</b></th> - <th><b>About Marcus Bointon, AKA "coolbru".</b></th> - </tr> - <tr> - <td width="50%" valign="top"> - <p><a href="http://www.codeworxtech.com">www.codeworxtech.com</a> for more information.<br> - Web design, web applications, forms: <a href="http://www.worxstudio.com">WorxStudio.com</a><br /> - </p> - <p>Our company, <strong>Worx International Inc.</strong>, is the publisher of several Open Source applications and developer tools as well as several commercial PHP applications. The Open Source applications are ttCMS and DCP Portal. The Open Source developer tools include QuickComponents (QuickSkin and QuickCache) and now PHPMailer. - We have staff and offices in the United States, Caribbean, the Middle - East, and our primary development center in Canada. Our company is represented by - agents and resellers globally.</p> - <p><strong>Worx International Inc.</strong> is at the forefront of developing PHP applications. Our staff are all Zend Certified university educated and experts at object oriented programming. While <strong>Worx International Inc.</strong> can handle any project from trouble shooting programs written by others all the way to finished mission-critical applications, we specialize in taking projects from inception all the way through to implementation - on budget, and on time. If you need help with your projects, we're the team to get it done right at a reasonable price.</p> - <p>Over the years, there have been a number of tools that have been constant favorites in all of our projects. We have become the project administrators for most of these tools.</p> - <p>Our developer tools are all Open Source. Here's a brief description:</p> - <ul> - <li><span style="background-color: #FFFF00"><strong>PHPMailer</strong></span>. Originally authored by Brent Matzelle, PHPMailer is the leading "email transfer class" for PHP. PHPMailer is downloaded more than - 26000 times each and every month by developers looking for a fast, stable, simple email solution. We used it ourselves for years as our favorite tool. It's always been small (the entire footprint is - less than 100 Kb), stable, and as complete a solution as you can find. - Other tools are nowhere near as simple. Our thanks to Brent Matzelle for this superb tool - our commitment is to keep it lean, keep it focused, and compliant with standards. Visit the PHPMailer website at - <a href="http://phpmailer.codeworxtech.com/">http://phpmailer.codeworxtech.com/</a>. <br /> - Please note: <strong>all of our focus is now on the PHPMailer for PHP5.</strong><br /> - <span style="background-color: #FFFF00">PS. While you are at it, please visit our sponsor's sites, click on their ads. - It helps offset some of our costs.</span><br /> - Want to help? We're looking for progressive developers to join our team of volunteer professionals working on PHPMailer. Our entire focus is on PHPMailer - for PHP5. If you are interested, let us know.<br /> - <br /> - </li> - <li><strong><span style="background-color: #FFFF00">QuickCache</span></strong>. Originally authored by Jean Pierre Deckers as jpCache, QuickCache is an HTTP OpCode caching strategy that works on your entire site with only one line of code at the top of your script. The cached pages can be stored as files or as database objects. The benefits are absolutely astounding: bandwidth savings of up to 80% and screen display times increased by 8 - 10x. Visit the QuickCache website at - <a href="http://quickcache.codeworxtech.com/">http://quickcache.codeworxtech.com/</a>.<br /> - <br /> - </li> - <li><strong><span style="background-color: #FFFF00">QuickSkin</span></strong>. Originally authored by Philipp v. Criegern and named "SmartTemplate". The project was taken over by Manuel 'EndelWar' Dalla Lana and now by "codeworxtech". QuickSkin is one of the truly outstanding templating engines available, but has always been confused with Smarty Templating Engine. QuickSkin is even more relevant today than when it was launched. It's a small footprint with big impact on your projects. It features a built in caching technology, token based substitution, and works on the concept of one single HTML file as the template. The HTML template file can contain variable information making it one small powerful tool for your developer tool kit. Visit the QuickSkin website at - <a href="http://quickskin.codeworxtech.com/">http://quickskin.codeworxtech.com/</a>.<br /> - <br /> - </li> - </ul> - <p>We're committed to PHP and to the Open Source community.</p> - <p>Opportunities with <strong>Worx International Inc.</strong>:</p> - <ul> - <li><span style="background-color: #FFFF00">Resellers/Agents</span>: We're always interested in talking with companies that - want to represent - <strong>Worx International Inc.</strong> in their markets. We also have private label programs for our commercial products (in certain circumstances).</li> - <li>Programmers/Developers: We are usually fully staffed, however, if you would like to be considered for a career with - <strong>Worx International Inc.</strong>, we would be pleased to hear from you.<br /> - A few things to note:<br /> - <ul> - <li>experience level does not matter: from fresh out of college to multi-year experience - it's your - creative mind and a positive attitude we want</li> - <li>if you contact us looking for employment, include a cover letter, indicate what type of work/career you are looking for and expected compensation</li> - <li>if you are representing someone else looking for work, do not contact us. We have an exclusive relationship with a recruiting partner already and not interested in altering the arrangement. We will not hire your candidate under any circumstances unless they wish to approach us individually.</li> - <li>any contact that ignores any of these points will be discarded</li> - </ul></li> - <li>Affiliates/Partnerships: We are interested in partnering with other firms who are leaders in their field. We clearly understand that successful companies are built on successful relationships in all industries world-wide. We currently have innovative relationships throughout the world that are mutually beneficial. Drop us a line and let's talk.</li> - </ul> - Regards,<br /> - Andy Prevost (aka, codeworxtech)<br /> - <a href="mailto:codeworxtech@users.sourceforge.net">codeworxtech@users.sourceforge.net</a><br /> - <br /> - We now also offer website design. hosting, and remote forms processing. Visit <a href="http://www.worxstudio.com/" target="_blank">WorxStudio.com</a> for more information.<br /> - </td> - <td width="50%" valign="top"> - <p>Marcus is the technical director of <a href="http://www.synchromedia.co.uk/">Synchromedia Limited</a>, a UK-based company providing online business services. Synchromedia's main services are:</p> - <h2>Smartmessages.net</h2> - <p><a href="https://www.smartmessages.net/"><img src="http://www.synchromedia.co.uk/uploads/images/smlogo.gif" width="292" height="48" alt="Smartmessages.net logo" /><br />Smartmessages.net</a> is Synchromedia's large-scale mailing list management system, providing email delivery services for a wide range of businesses, from sole traders to corporates. - We pride ourselves on personal service, and realise that every one of your subscribers is a precious asset to be handled with care. - We provide fast, reliable, high-volume delivery (some of our customers have lists of more than 1,000,000 subscribers) with fine-grained tracking while ensuring you stay fully compliant with UK, EC and US data protection laws. Smartmessages of course uses PHPMailer at its heart!</p> - <h2>info@hand</h2> - <p><a href="http://www.synchromedia.co.uk/what-we-do/info-at-hand-crm/"><img src="http://www.synchromedia.co.uk/uploads/images/infoathand-large.png" width="250" height="40" alt="info@hand logo" /></a><br />Synchromedia is the official UK distributor of <a href="http://www.thelongreach.com/">info@hand</a>, a class-leading open-source web-based CRM system. We provide licenses, hosting, planning, support and training for this very fully-featured system at very competitive prices. info@hand also uses PHPMailer!</p> - <h2>How can we help you?</h2> - <p>In addition to our headline services, we also provide consulting, development, hosting and sysadmin services, so if you just need a simple web hosting package, we can do that too. Not surprisingly, we know rather a lot about email, so you can talk to us about that too.</p> - <p>Please <a href="http://www.synchromedia.co.uk/about-us/contact-us/">contact us</a> if you'd like to know more.</p> - <p>Marcus is a regular attendee at <a href="http://www.phplondon.org/">PHP London</a>, and occasionally speaks on email at technical conferences.</p> - </td> - </tr> -</table> -</div> -</center> -</body> -</html> diff --git a/modules/phpmailer/changelog.txt b/modules/phpmailer/changelog.md index 76c75cf2..dbbcc7ac 100644 --- a/modules/phpmailer/changelog.txt +++ b/modules/phpmailer/changelog.md @@ -1,21 +1,105 @@ -ChangeLog - -NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5/PHP6. - IT WILL NOT WORK WITH PHP4. - -Version 5.2 (July 19, 2011) +# ChangeLog + +## Version 5.2.6 (April 11th 2013) +* Reflect move to PHPMailer GitHub organisation at https://github.com/PHPMailer/PHPMailer +* Fix unbumped version numbers +* Update packagist.org with new location +* Clean up Changelog + +## Version 5.2.5 (April 6th 2013) +* First official release after move from Google Code +* Fixes for qmail when sending via mail() +* Merge in changes from Google code 5.2.4 release +* Minor coding standards cleanup in SMTP class +* Improved unit tests, now tests S/MIME signing +* Travis-CI support on GitHub, runs tests with fake SMTP server + +## Version 5.2.4 (February 19, 2013) +* Fix tag and version bug. +* un-deprecate isSMTP(), isMail(), IsSendmail() and + isQmail(). +* Numerous translation updates + +## Version 5.2.3 (February 8, 2013) +* Fix issue with older PCREs and ValidateAddress() (Bugz: 124) +* Add CRAM-MD5 authentication, thanks to Elijah madden, https://github.com/okonomiyaki3000 +* Replacement of obsolete Quoted-Printable encoder with a much better implementation +* Composer package definition +* New language added: Hebrew + +## Version 5.2.2 (December 3, 2012) +* Some fixes and syncs from https://github.com/Synchro/PHPMailer +* Add Slovak translation, thanks to Michal Tinka + +## Version 5.2.2-rc2 (November 6, 2012) +* Fix SMTP server rotation (Bugz: 118) +* Allow override of autogen'ed 'Date' header (for Drupal's + og_mailinglist module) +* No whitespace after '-f' option (Bugz: 116) +* Work around potential warning (Bugz: 114) + +## Version 5.2.2-rc1 (September 28, 2012) +* Header encoding works with long lines (Bugz: 93) +* Turkish language update (Bugz: 94) +* undefined $pattern in EncodeQ bug squashed (Bugz: 98) +* use of mail() in safe_mode now works (Bugz: 96) +* ValidateAddress() now 'public static' so people can override the + default and use their own validation scheme. +* ValidateAddress() no longer uses broken FILTER_VALIDATE_EMAIL +* Added in AUTH PLAIN SMTP authentication + +## Version 5.2.2-beta2 (August 17, 2012) +* Fixed Postfix VERP support (Bugz: 92) +* Allow action_function callbacks to pass/use + the From address (passed as final param) +* Prevent inf look for get_lines() (Bugz: 77) +* New public var ($UseSendmailOptions). Only pass sendmail() + options iff we really are using sendmail or something sendmail + compatible. (Bugz: 75) +* default setting for LE returned to "\n" due to popular demand. + +## Version 5.2.2-beta1 (July 13, 2012) +* Expose PreSend() and PostSend() as public methods to allow + for more control if serializing message sending. +* GetSentMIMEMessage() only constructs the message copy when + needed. Save memory. +* Only pass params to mail() if the underlying MTA is + "sendmail" (as defined as "having the string sendmail + in its pathname") [#69] +* Attachments now work with Amazon SES and others [Bugz#70] +* Debug output now sent to stdout (via echo) or error_log [Bugz#5] +* New var: Debugoutput (for above) [Bugz#5] +* SMTP reads now Timeout aware (new var: Timeout=15) [Bugz#71] +* SMTP reads now can have a Timelimit associated with them + (new var: Timelimit=30)[Bugz#71] +* Fix quoting issue associated with charsets +* default setting for LE is now RFC compliant: "\r\n" +* Return-Path can now be user defined (new var: ReturnPath) + (the default is "" which implies no change from previous + behavior, which was to use either From or Sender) [Bugz#46] +* X-Mailer header can now be disabled (by setting to a + whitespace string, eg " ") [Bugz#66] +* Bugz closed: #68, #60, #42, #43, #59, #55, #66, #48, #49, + #52, #31, #41, #5. #70, #69 + +## Version 5.2.1 (January 16, 2012) +* Closed several bugs#5 +* Performance improvements +* MsgHTML() now returns the message as required. +* New method: GetSentMIMEMessage() (returns full copy of sent message) + +## Version 5.2 (July 19, 2011) * protected MIME body and header * better DKIM DNS Resource Record support * better aly handling * htmlfilter class added to extras * moved to Apache Extras -Version 5.1 (October 20, 2009) +## Version 5.1 (October 20, 2009) * fixed filename issue with AddStringAttachment (thanks to Tony) * fixed "SingleTo" property, now works with Senmail, Qmail, and SMTP in addition to PHP mail() -* added DKIM digital signing functionality - New properties: +* added DKIM digital signing functionality, new properties: - DKIM_domain (sets the domain name) - DKIM_private (holds DKIM private key) - DKIM_passphrase (holds your DKIM passphrase) @@ -24,7 +108,7 @@ Version 5.1 (October 20, 2009) * added callback function support - callback function parameters include: result, to, cc, bcc, subject and body - * see the test/test_callback.php file for usage. + - see the test/test_callback.php file for usage. * added "auto" identity functionality - can automatically add: - Return-path (if Sender not set) @@ -32,63 +116,62 @@ Version 5.1 (October 20, 2009) - can be disabled: - $mail->SetFrom('yourname@yourdomain.com','First Last',false); - or by adding the $mail->Sender and/or $mail->ReplyTo properties - Note: "auto" identity added to help with emails ending up in spam - or junk boxes because of missing headers -Version 5.0.2 (May 24, 2009) +Note: "auto" identity added to help with emails ending up in spam or junk boxes because of missing headers + +## Version 5.0.2 (May 24, 2009) * Fix for missing attachments when inline graphics are present * Fix for missing Cc in header when using SMTP (mail was sent, - but not displayed in header -- Cc receiver only saw email To: + but not displayed in header -- Cc receiver only saw email To: line and no Cc line, but did get the email (To receiver saw same) -Version 5.0.1 (April 05, 2009) +## Version 5.0.1 (April 05, 2009) * Temporary fix for missing attachments -Version 5.0.0 (April 02, 2009) +## Version 5.0.0 (April 02, 2009) +With the release of this version, we are initiating a new version numbering +system to differentiate from the PHP4 version of PHPMailer. +Most notable in this release is fully object oriented code. -* With the release of this version, we are initiating a new version numbering - system to differentiate from the PHP4 version of PHPMailer. -* Most notable in this release is fully object oriented code. -class.smtp.php: +### class.smtp.php: * Refactored class.smtp.php to support new exception handling - code size reduced from 29.2 Kb to 25.6 Kb +* code size reduced from 29.2 Kb to 25.6 Kb * Removed unnecessary functions from class.smtp.php: - public function Expand($name) { - public function Help($keyword="") { - public function Noop() { - public function Send($from) { - public function SendOrMail($from) { - public function Verify($name) { -class.phpmailer.php: + - public function Expand($name) { + - public function Help($keyword="") { + - public function Noop() { + - public function Send($from) { + - public function SendOrMail($from) { + - public function Verify($name) { + +### class.phpmailer.php: * Refactored class.phpmailer.php with new exception handling * Changed processing functionality of Sendmail and Qmail so they cannot be inadvertently used * removed getFile() function, just became a simple wrapper for file_get_contents() * added check for PHP version (will gracefully exit if not at least PHP 5.0) -class.phpmailer.php enhancements * enhanced code to check if an attachment source is the same as an embedded or inline graphic source to eliminate duplicate attachments -New /test_script -* We have written a test script you can use to test the script as part of your - installation. Once you press submit, the test script will send a multi-mime - email with either the message you type in or an HTML email with an inline - graphic. Two attachments are included in the email (one of the attachments - is also the inline graphic so you can see that only one copy of the graphic - is sent in the email). The test script will also display the functional - script that you can copy/paste to your editor to duplicate the functionality. -New examples -* All new examples in both basic and advanced modes. Advanced examples show - Exception handling. -PHPDocumentator (phpdocs) documentation for PHPMailer version 5.0.0 -* all new documentation - -Please note: the website has been updated to reflect the changes in PHPMailer -version 5.0.0. http://phpmailer.codeworxtech.com/ - -Version 2.3 (November 06, 2008) +### New /test_script +We have written a test script you can use to test the script as part of your +installation. Once you press submit, the test script will send a multi-mime +email with either the message you type in or an HTML email with an inline +graphic. Two attachments are included in the email (one of the attachments +is also the inline graphic so you can see that only one copy of the graphic +is sent in the email). The test script will also display the functional +script that you can copy/paste to your editor to duplicate the functionality. + +### New examples +All new examples in both basic and advanced modes. Advanced examples show + Exception handling. + +### PHPDocumentator (phpdocs) documentation for PHPMailer version 5.0.0 +All new documentation + +## Version 2.3 (November 06, 2008) * added Arabic language (many thanks to Bahjat Al Mostafa) * removed English language from language files and made it a default within class.phpmailer.php - if no language is found, it will default to use @@ -106,22 +189,17 @@ Version 2.3 (November 06, 2008) * We have removed the /phpdoc from the downloads. All documentation is now on the http://phpmailer.codeworxtech.com website. -Version 2.2.1 () July 19 2008 - +## Version 2.2.1 () July 19 2008 * fixed line 1092 in class.smtp.php (my apologies, error on my part) -Version 2.2 () July 15 2008 - +## Version 2.2 () July 15 2008 * Fixed redirect issue (display of UTF-8 in thank you redirect) * fixed error in getResponse function declaration (class.pop3.php) * PHPMailer now PHP6 compliant * fixed line 1092 in class.smtp.php (endless loop from missing = sign) -Version 2.1 (Wed, June 04 2008) - -** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. - IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE - APPRECIATED. +## Version 2.1 (Wed, June 04 2008) +NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE APPRECIATED. * added S/MIME functionality (ability to digitally sign emails) BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. @@ -138,15 +216,15 @@ Version 2.1 (Wed, June 04 2008) 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'); - - do not try to use - $myVar = date_default_timezone_get(); + `date_default_timezone_set('America/Toronto');` + - do not try to use + `$myVar = date_default_timezone_get();` as a test, it will throw an error. * added ability to define path (mainly for embedded images) - function MsgHTML($message,$basedir='') ... where: - $basedir is the fully qualified path -* fixed MsgHTML() function: - - Embedded Images where images are specified by <protocol>:// will not be altered or embedded + function `MsgHTML($message,$basedir='')` ... where: + `$basedir` is the fully qualified path +* fixed `MsgHTML()` function: + - Embedded Images where images are specified by `<protocol>://` will not be altered or embedded * fixed the return value of SMTP exit code ( pclose ) * addressed issue of multibyte characters in subject line and truncating * added ability to have user specified Message ID @@ -156,21 +234,20 @@ Version 2.1 (Wed, June 04 2008) * added check for added attachments * enhanced conversion of HTML to text in MsgHTML (thanks to "brunny") -Version 2.1.0beta2 (Sun, Dec 02 2007) +## Version 2.1.0beta2 (Sun, Dec 02 2007) * implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon) * finished all testing, all known bugs corrected, enhancements tested -- note: will NOT work with PHP4. -please note, this is BETA software -** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS -INTENDED STRICTLY FOR TESTING +Note: will NOT work with PHP4. -Version 2.1.0beta1 -please note, this is BETA software +Please note, this is BETA software **DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS; INTENDED STRICTLY FOR TESTING** + +## Version 2.1.0beta1 +Please note, this is BETA software ** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS -INTENDED STRICTLY FOR TESTING + INTENDED STRICTLY FOR TESTING -Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release +## Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release * implements new property to control VERP in class.smtp.php example (requires instantiating class.smtp.php): $mail->do_verp = true; @@ -191,8 +268,10 @@ 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 @@ -202,7 +281,7 @@ 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 +## 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 * added MsgHTML() function to replace Body tag for HTML emails @@ -215,36 +294,43 @@ Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release * 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'); + +``` +$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. Example of use: + +``` +$mail = new PHPMailer(); +$mail->Mailer = "smtp"; +$mail->Host = "smtp.example.com"; +$mail->SMTPSecure = "tls"; // option +//$mail->SMTPSecure = "ssl"; // option +... +$mail->Send(); +``` + * 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 +NOTE: will NOT work with PHP5 in E_STRICT error mode -Version 1.73 (Sun, Jun 10 2005) +## Version 1.73 (Sun, Jun 10 2005) * Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf * Now has a total of 20 translations * Fixed alt attachments bug: http://tinyurl.com/98u9k -Version 1.72 (Wed, May 25 2004) +## Version 1.72 (Wed, May 25 2004) * Added Dutch, Swedish, Czech, Norwegian, and Turkish translations. * Received: Removed this method because spam filter programs like -SpamAssassin reject this header. + SpamAssassin reject this header. * Fixed error count bug. * SetLanguage default is now "language/". * Fixed magic_quotes_runtime bug. -Version 1.71 (Tue, Jul 28 2003) +## Version 1.71 (Tue, Jul 28 2003) * Made several speed enhancements * Added German and Italian translation files * Fixed HELO/AUTH bugs on keep-alive connects @@ -253,7 +339,7 @@ Version 1.71 (Tue, Jul 28 2003) * Updated some unclear documentation * Added additional tests and improved others -Version 1.70 (Mon, Jun 20 2003) +## Version 1.70 (Mon, Jun 20 2003) * Added SMTP keep-alive support * Added IsError method for error detection * Added error message translation support (SetLanguage) @@ -273,20 +359,20 @@ Version 1.70 (Mon, Jun 20 2003) * Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC) * Multiple bug fixes -Version 1.65 (Fri, Aug 09 2002) +## Version 1.65 (Fri, Aug 09 2002) * Fixed non-visible attachment bug (#585097) for Outlook * SMTP connections are now closed after each transaction * Fixed SMTP::Expand return value * Converted SMTP class documentation to phpDocumentor format -Version 1.62 (Wed, Jun 26 2002) +## Version 1.62 (Wed, Jun 26 2002) * Fixed multi-attach bug * Set proper word wrapping * Reduced memory use with attachments * Added more debugging * Changed documentation to phpDocumentor format -Version 1.60 (Sat, Mar 30 2002) +## Version 1.60 (Sat, Mar 30 2002) * Sendmail pipe and address patch (Christian Holtje) * Added embedded image and read confirmation support (A. Ognio) * Added unit tests @@ -297,21 +383,21 @@ Version 1.60 (Sat, Mar 30 2002) * Eliminated SMTP class warnings * Added SendToQueue method for future queuing support -Version 1.54 (Wed, Dec 19 2001) +## Version 1.54 (Wed, Dec 19 2001) * Add some queuing support code * Fixed a pesky multi/alt bug * Messages are no longer forced to have "To" addresses -Version 1.50 (Thu, Nov 08 2001) +## Version 1.50 (Thu, Nov 08 2001) * Fix extra lines when not using SMTP mailer * Set WordWrap variable to int with a zero default -Version 1.47 (Tue, Oct 16 2001) +## Version 1.47 (Tue, Oct 16 2001) * Fixed Received header code format * Fixed AltBody order error * Fixed alternate port warning -Version 1.45 (Tue, Sep 25 2001) +## Version 1.45 (Tue, Sep 25 2001) * Added enhanced SMTP debug support * Added support for multiple ports on SMTP * Added Received header for tracing @@ -320,84 +406,84 @@ Version 1.45 (Tue, Sep 25 2001) * Fixed wordwrap() trim bug * Couple other small bug fixes -Version 1.41 (Wed, Aug 22 2001) +## Version 1.41 (Wed, Aug 22 2001) * Fixed AltBody bug w/o attachments * Fixed rfc_date() for certain mail servers -Version 1.40 (Sun, Aug 12 2001) +## Version 1.40 (Sun, Aug 12 2001) * Added multipart/alternative support (AltBody) * Documentation update * Fixed bug in Mercury MTA -Version 1.29 (Fri, Aug 03 2001) +## Version 1.29 (Fri, Aug 03 2001) * Added AddStringAttachment() method * Added SMTP authentication support -Version 1.28 (Mon, Jul 30 2001) +## Version 1.28 (Mon, Jul 30 2001) * Fixed a typo in SMTP class * Fixed header issue with Imail (win32) SMTP server * Made fopen() calls for attachments use "rb" to fix win32 error -Version 1.25 (Mon, Jul 02 2001) +## Version 1.25 (Mon, Jul 02 2001) * Added RFC 822 date fix (Patrice) * Added improved error handling by adding a $ErrorInfo variable * Removed MailerDebug variable (obsolete with new error handler) -Version 1.20 (Mon, Jun 25 2001) +## Version 1.20 (Mon, Jun 25 2001) * Added quoted-printable encoding (Patrice) * Set Version as public and removed PrintVersion() * Changed phpdoc to only display public variables and methods -Version 1.19 (Thu, Jun 21 2001) +## Version 1.19 (Thu, Jun 21 2001) * Fixed MS Mail header bug * Added fix for Bcc problem with mail(). *Does not work on Win32* (See PHP bug report: http://www.php.net/bugs.php?id=11616) * mail() no longer passes a fifth parameter when not needed -Version 1.15 (Fri, Jun 15 2001) -[Note: these changes contributed by Patrice Fournier] +## Version 1.15 (Fri, Jun 15 2001) +Note: these changes contributed by Patrice Fournier * Changed all remaining \n to \r\n * Bcc: header no longer writen to message except -when sent directly to sendmail + when sent directly to sendmail * Added a small message to non-MIME compliant mail reader * Added Sender variable to change the Sender email -used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode + used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode * Changed boundary setting to a place it will be set only once * Removed transfer encoding for whole message when using multipart * Message body now uses Encoding in multipart messages * Can set encoding and type to attachments 7bit, 8bit -and binary attachment are sent as is, base64 are encoded + and binary attachment are sent as is, base64 are encoded * Can set Encoding to base64 to send 8 bits body -through 7 bits servers + through 7 bits servers -Version 1.10 (Tue, Jun 12 2001) +## Version 1.10 (Tue, Jun 12 2001) * Fixed win32 mail header bug (printed out headers in message body) -Version 1.09 (Fri, Jun 08 2001) +## Version 1.09 (Fri, Jun 08 2001) * Changed date header to work with Netscape mail programs * Altered phpdoc documentation -Version 1.08 (Tue, Jun 05 2001) +## Version 1.08 (Tue, Jun 05 2001) * Added enhanced error-checking * Added phpdoc documentation to source -Version 1.06 (Fri, Jun 01 2001) +## Version 1.06 (Fri, Jun 01 2001) * Added optional name for file attachments -Version 1.05 (Tue, May 29 2001) +## Version 1.05 (Tue, May 29 2001) * Code cleanup * Eliminated sendmail header warning message * Fixed possible SMTP error -Version 1.03 (Thu, May 24 2001) +## Version 1.03 (Thu, May 24 2001) * Fixed problem where qmail sends out duplicate messages -Version 1.02 (Wed, May 23 2001) +## Version 1.02 (Wed, May 23 2001) * Added multiple recipient and attachment Clear* methods * Added Sendmail public variable * Fixed problem with loading SMTP library multiple times -Version 0.98 (Tue, May 22 2001) +## Version 0.98 (Tue, May 22 2001) * Fixed problem with redundant mail hosts sending out multiple messages * Added additional error handler code * Added AddCustomHeader() function @@ -405,11 +491,11 @@ Version 0.98 (Tue, May 22 2001) * Fixed small bug with Mailer variable * Added PrintVersion() function -Version 0.92 (Tue, May 15 2001) +## Version 0.92 (Tue, May 15 2001) * Changed file names to class.phpmailer.php and class.smtp.php to match current PHP class trend. * Fixed problem where body not being printed when a message is attached * Several small bug fixes -Version 0.90 (Tue, April 17 2001) -* Intial public release +## Version 0.90 (Tue, April 17 2001) +* Initial public release diff --git a/modules/phpmailer/class.phpmailer.php b/modules/phpmailer/class.phpmailer.php index 4589cd79..667f1878 100644 --- a/modules/phpmailer/class.phpmailer.php +++ b/modules/phpmailer/class.phpmailer.php @@ -2,15 +2,16 @@ /*~ class.phpmailer.php .---------------------------------------------------------------------------. | Software: PHPMailer - PHP email class | -| Version: 5.2 | -| Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ | +| Version: 5.2.6 | +| Site: https://github.com/PHPMailer/PHPMailer/ | | ------------------------------------------------------------------------- | -| Admin: Jim Jagielski (project admininistrator) | +| Admins: Marcus Bointon | +| Admins: Jim Jagielski | | Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net | -| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net | +| : Marcus Bointon (coolbru) phpmailer@synchromedia.co.uk | | : Jim Jagielski (jimjag) jimjag@gmail.com | | Founder: Brent R. Matzelle (original founder) | -| Copyright (c) 2010-2011, Jim Jagielski. All Rights Reserved. | +| Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved. | | Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. | | Copyright (c) 2001-2003, Brent R. Matzelle | | ------------------------------------------------------------------------- | @@ -23,20 +24,23 @@ */ /** - * PHPMailer - PHP email transport class + * PHPMailer - PHP email creation and transport class * NOTE: Requires PHP version 5 or later * @package PHPMailer * @author Andy Prevost * @author Marcus Bointon * @author Jim Jagielski - * @copyright 2010 - 2011 Jim Jagielski + * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @version $Id: class.phpmailer.php 450 2010-06-23 16:46:33Z coolbru $ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n"); +/** + * PHP email creation and transport class + * @package PHPMailer + */ class PHPMailer { ///////////////////////////////////////////////// @@ -94,6 +98,13 @@ class PHPMailer { public $Sender = ''; /** + * Sets the Return-Path of the message. If empty, it will + * be set to either From or Sender. + * @var string + */ + public $ReturnPath = ''; + + /** * Sets the Subject of the message. * @var string */ @@ -130,6 +141,13 @@ class PHPMailer { protected $MIMEHeader = ''; /** + * Stores the extra header list which CreateHeader() doesn't fold in + * @var string + * @access protected + */ + protected $mailHeader = ''; + + /** * Sets word wrapping on the body of the message to a given number of * characters. * @var int @@ -149,6 +167,13 @@ class PHPMailer { public $Sendmail = '/usr/sbin/sendmail'; /** + * Determine if mail() uses a fully sendmail compatible MTA that + * supports sendmail's "-oi -f" options + * @var boolean + */ + public $UseSendmailOptions = true; + + /** * Path to PHPMailer plugins. Useful if the SMTP class * is in a different directory than the PHP include path. * @var string @@ -176,12 +201,21 @@ class PHPMailer { */ public $MessageID = ''; + /** + * Sets the message Date to be used in the Date header. + * If empty, the current date will be added. + * @var string + */ + public $MessageDate = ''; + ///////////////////////////////////////////////// // PROPERTIES FOR SMTP ///////////////////////////////////////////////// /** - * Sets the SMTP hosts. All hosts must be separated by a + * Sets the SMTP hosts. + * + * All hosts must be separated by a * semicolon. You can also specify a different port * for each host by using this format: [hostname:port] * (e.g. "smtp1.example.com:25;smtp2.example.com"). @@ -203,8 +237,7 @@ class PHPMailer { public $Helo = ''; /** - * Sets connection prefix. - * Options are "", "ssl" or "tls" + * Sets connection prefix. Options are "", "ssl" or "tls" * @var string */ public $SMTPSecure = ''; @@ -228,6 +261,24 @@ class PHPMailer { public $Password = ''; /** + * Sets SMTP auth type. Options are LOGIN | PLAIN | NTLM | CRAM-MD5 (default LOGIN) + * @var string + */ + public $AuthType = ''; + + /** + * Sets SMTP realm. + * @var string + */ + public $Realm = ''; + + /** + * Sets SMTP workstation. + * @var string + */ + public $Workstation = ''; + + /** * Sets the SMTP server timeout in seconds. * This function will not work with the win32 version. * @var int @@ -241,6 +292,13 @@ class PHPMailer { public $SMTPDebug = false; /** + * Sets the function/method to use for debugging output. + * Right now we only honor "echo" or "error_log" + * @var string + */ + public $Debugoutput = "echo"; + + /** * Prevents the SMTP connection from being closed after each mail * sending. If this is set to true then to close the connection * requires an explicit call to SmtpClose(). @@ -261,54 +319,76 @@ class PHPMailer { */ public $SingleToArray = array(); - /** - * Provides the ability to change the line ending + /** + * Should we allow sending messages with empty body? + * @var bool + */ + public $AllowEmpty = false; + + /** + * Provides the ability to change the generic line ending + * NOTE: The default remains '\n'. We force CRLF where we KNOW + * it must be used via self::CRLF * @var string */ public $LE = "\n"; - /** - * Used with DKIM DNS Resource Record + /** + * Used with DKIM Signing + * required parameter if DKIM is enabled + * + * domain selector example domainkey * @var string */ - public $DKIM_selector = 'phpmailer'; + public $DKIM_selector = ''; /** - * Used with DKIM DNS Resource Record - * optional, in format of email address 'you@yourdomain.com' + * Used with DKIM Signing + * required if DKIM is enabled, in format of email address 'you@yourdomain.com' typically used as the source of the email * @var string */ public $DKIM_identity = ''; /** - * Used with DKIM DNS Resource Record + * Used with DKIM Signing + * optional parameter if your private key requires a passphras * @var string */ public $DKIM_passphrase = ''; /** - * Used with DKIM DNS Resource Record - * optional, in format of email address 'you@yourdomain.com' + * Used with DKIM Singing + * required if DKIM is enabled, in format of email address 'domain.com' * @var string */ public $DKIM_domain = ''; /** - * Used with DKIM DNS Resource Record - * optional, in format of email address 'you@yourdomain.com' + * Used with DKIM Signing + * required if DKIM is enabled, path to private key file * @var string */ public $DKIM_private = ''; /** - * Callback Action function name - * the function that handles the result of the send email action. Parameters: + * Callback Action function name. + * 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. + * + * Parameters: * bool $result result of the send action * string $to email address of the recipient * string $cc cc email addresses * string $bcc bcc email addresses * string $subject the subject * string $body the email body + * string $from email address of sender * @var string */ public $action_function = ''; //'callbackAction'; @@ -317,11 +397,11 @@ class PHPMailer { * Sets the PHPMailer Version number * @var string */ - public $Version = '5.2'; + public $Version = '5.2.6'; /** * What to use in the X-Mailer header - * @var string + * @var string NULL for default, whitespace for None, or actual string to use */ public $XMailer = ''; @@ -329,21 +409,85 @@ class PHPMailer { // PROPERTIES, PRIVATE AND PROTECTED ///////////////////////////////////////////////// - protected $smtp = NULL; + /** + * @var SMTP An instance of the SMTP sender class + * @access protected + */ + protected $smtp = null; + /** + * @var array An array of 'to' addresses + * @access protected + */ protected $to = array(); + /** + * @var array An array of 'cc' addresses + * @access protected + */ protected $cc = array(); + /** + * @var array An array of 'bcc' addresses + * @access protected + */ protected $bcc = array(); + /** + * @var array An array of reply-to name and address + * @access protected + */ protected $ReplyTo = array(); + /** + * @var array An array of all kinds of addresses: to, cc, bcc, replyto + * @access protected + */ protected $all_recipients = array(); + /** + * @var array An array of attachments + * @access protected + */ protected $attachment = array(); + /** + * @var array An array of custom headers + * @access protected + */ protected $CustomHeader = array(); + /** + * @var string The message's MIME type + * @access protected + */ protected $message_type = ''; + /** + * @var array An array of MIME boundary strings + * @access protected + */ protected $boundary = array(); + /** + * @var array An array of available languages + * @access protected + */ protected $language = array(); + /** + * @var integer The number of errors encountered + * @access protected + */ protected $error_count = 0; + /** + * @var string The filename of a DKIM certificate file + * @access protected + */ protected $sign_cert_file = ''; + /** + * @var string The filename of a DKIM key file + * @access protected + */ protected $sign_key_file = ''; + /** + * @var string The password of a DKIM key + * @access protected + */ protected $sign_key_pass = ''; + /** + * @var boolean Whether to throw exceptions for errors + * @access protected + */ protected $exceptions = false; ///////////////////////////////////////////////// @@ -353,12 +497,47 @@ class PHPMailer { const STOP_MESSAGE = 0; // message only, continue processing const STOP_CONTINUE = 1; // message?, likely ok to continue processing const STOP_CRITICAL = 2; // message, plus full stop, critical error reached + const CRLF = "\r\n"; // SMTP RFC specified EOL ///////////////////////////////////////////////// // METHODS, VARIABLES ///////////////////////////////////////////////// /** + * Calls actual mail() function, but in a safe_mode aware fashion + * Also, unless sendmail_path points to sendmail (or something that + * claims to be sendmail), don't pass params (not a perfect fix, + * but it will do) + * @param string $to To + * @param string $subject Subject + * @param string $body Message Body + * @param string $header Additional Header(s) + * @param string $params Params + * @access private + * @return bool + */ + private function mail_passthru($to, $subject, $body, $header, $params) { + if ( ini_get('safe_mode') || !($this->UseSendmailOptions) ) { + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header); + } else { + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header, $params); + } + return $rt; + } + + /** + * Outputs debugging info via user-defined method + * @param string $str + */ + private function edebug($str) { + if ($this->Debugoutput == "error_log") { + error_log($str); + } else { + echo $str; + } + } + + /** * Constructor * @param boolean $exceptions Should we throw external exceptions? */ @@ -367,6 +546,15 @@ class PHPMailer { } /** + * Destructor + */ + public function __destruct() { + if ($this->Mailer == 'smtp') { //Close any open SMTP connection nicely + $this->SmtpClose(); + } + } + + /** * Sets message type to HTML. * @param bool $ishtml * @return void @@ -460,7 +648,7 @@ class PHPMailer { * @return boolean */ public function AddReplyTo($address, $name = '') { - return $this->AddAnAddress('ReplyTo', $address, $name); + return $this->AddAnAddress('Reply-To', $address, $name); } /** @@ -469,29 +657,34 @@ class PHPMailer { * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo' * @param string $address The email address to send to * @param string $name + * @throws phpmailerException * @return boolean true on success, false if address already used or invalid in some way * @access protected */ protected function AddAnAddress($kind, $address, $name = '') { - if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) { + if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) { $this->SetError($this->Lang('Invalid recipient array').': '.$kind); if ($this->exceptions) { throw new phpmailerException('Invalid recipient array: ' . $kind); } - echo $this->Lang('Invalid recipient array').': '.$kind; + if ($this->SMTPDebug) { + $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 (!self::ValidateAddress($address)) { + if (!$this->ValidateAddress($address)) { $this->SetError($this->Lang('invalid_address').': '. $address); if ($this->exceptions) { throw new phpmailerException($this->Lang('invalid_address').': '.$address); } - echo $this->Lang('invalid_address').': '.$address; + if ($this->SMTPDebug) { + $this->edebug($this->Lang('invalid_address').': '.$address); + } return false; } - if ($kind != 'ReplyTo') { + if ($kind != 'Reply-To') { if (!isset($this->all_recipients[strtolower($address)])) { array_push($this->$kind, array($address, $name)); $this->all_recipients[strtolower($address)] = true; @@ -506,28 +699,32 @@ class PHPMailer { return false; } -/** - * Set the From and FromName properties - * @param string $address - * @param string $name - * @return boolean - */ + /** + * Set the From and FromName properties + * @param string $address + * @param string $name + * @param int $auto Also set Reply-To and Sender + * @throws phpmailerException + * @return boolean + */ public function SetFrom($address, $name = '', $auto = 1) { $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - if (!self::ValidateAddress($address)) { + if (!$this->ValidateAddress($address)) { $this->SetError($this->Lang('invalid_address').': '. $address); if ($this->exceptions) { throw new phpmailerException($this->Lang('invalid_address').': '.$address); } - echo $this->Lang('invalid_address').': '.$address; + if ($this->SMTPDebug) { + $this->edebug($this->Lang('invalid_address').': '.$address); + } return false; } $this->From = $address; $this->FromName = $name; if ($auto) { if (empty($this->ReplyTo)) { - $this->AddAnAddress('ReplyTo', $address, $name); + $this->AddAnAddress('Reply-To', $address, $name); } if (empty($this->Sender)) { $this->Sender = $address; @@ -538,25 +735,30 @@ class PHPMailer { /** * Check that a string looks roughly like an email address should - * Static so it can be used without instantiation - * Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator - * Conforms approximately to RFC2822 - * @link http://www.hexillion.com/samples/#Regex Original pattern found here + * Static so it can be used without instantiation, public so people can overload + * 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 :( + * @link http://squiloople.com/2009/12/20/email-address-validation/ + * @copyright regex Copyright Michael Rushton 2009-10 | http://squiloople.com/ | Feel free to use and redistribute this code. But please keep this copyright notice. * @param string $address The email address to check * @return boolean * @static * @access public */ public static function ValidateAddress($address) { - if (function_exists('filter_var')) { //Introduced in PHP 5.2 - if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) { - return false; + if (defined('PCRE_VERSION')) { //Check this instead of extension_loaded so it works when that function is disabled + if (version_compare(PCRE_VERSION, '8.0') >= 0) { + return (boolean)preg_match('/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', $address); + } else { + //Fall back to an older regex that doesn't need a recent PCRE + return (boolean)preg_match('/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', $address); + } } else { - return true; + //No PCRE! Do something _very_ approximate! + //Check the address is 3 chars or longer and contains an @ that's not the first or last char + return (strlen($address) >= 3 and strpos($address, '@') >= 1 and strpos($address, '@') != strlen($address) - 1); } - } else { - return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[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_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address); - } } ///////////////////////////////////////////////// @@ -567,6 +769,7 @@ class PHPMailer { * Creates message and assigns Mailer. If the message is * not sent successfully then it returns false. Use the ErrorInfo * variable to view description of the error. + * @throws phpmailerException * @return bool */ public function Send() { @@ -574,6 +777,7 @@ class PHPMailer { if(!$this->PreSend()) return false; return $this->PostSend(); } catch (phpmailerException $e) { + $this->mailHeader = ''; $this->SetError($e->getMessage()); if ($this->exceptions) { throw $e; @@ -582,8 +786,14 @@ class PHPMailer { } } - protected function PreSend() { + /** + * Prep mail by constructing all message entities + * @throws phpmailerException + * @return bool + */ + public function PreSend() { try { + $this->mailHeader = ""; if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL); } @@ -595,22 +805,33 @@ class PHPMailer { $this->error_count = 0; // reset errors $this->SetMessageType(); - //Refuse to send an empty message - if (empty($this->Body)) { + //Refuse to send an empty message unless we are specifically allowing it + if (!$this->AllowEmpty and empty($this->Body)) { throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL); } $this->MIMEHeader = $this->CreateHeader(); $this->MIMEBody = $this->CreateBody(); + // To capture the complete message when using mail(), create + // 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); + } else { + $this->mailHeader .= $this->HeaderLine("To", "undisclosed-recipients:;"); + } + $this->mailHeader .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader(trim($this->Subject)))); + } // digitally sign with DKIM if enabled - if ($this->DKIM_domain && $this->DKIM_private) { - $header_dkim = $this->DKIM_Add($this->MIMEHeader, $this->EncodeHeader($this->SecureHeader($this->Subject)), $this->MIMEBody); + if (!empty($this->DKIM_domain) && !empty($this->DKIM_private) && !empty($this->DKIM_selector) && !empty($this->DKIM_domain) && file_exists($this->DKIM_private)) { + $header_dkim = $this->DKIM_Add($this->MIMEHeader . $this->mailHeader, $this->EncodeHeader($this->SecureHeader($this->Subject)), $this->MIMEBody); $this->MIMEHeader = str_replace("\r\n", "\n", $header_dkim) . $this->MIMEHeader; } return true; + } catch (phpmailerException $e) { $this->SetError($e->getMessage()); if ($this->exceptions) { @@ -620,7 +841,13 @@ class PHPMailer { } } - protected function PostSend() { + /** + * Actual Email transport function + * Send the email via the selected mechanism + * @throws phpmailerException + * @return bool + */ + public function PostSend() { try { // Choose the mailer and send through it switch($this->Mailer) { @@ -628,35 +855,39 @@ class PHPMailer { 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: return $this->MailSend($this->MIMEHeader, $this->MIMEBody); } - } catch (phpmailerException $e) { $this->SetError($e->getMessage()); if ($this->exceptions) { throw $e; } - echo $e->getMessage()."\n"; - return false; + if ($this->SMTPDebug) { + $this->edebug($e->getMessage()."\n"); + } } + return false; } /** * Sends mail using the $Sendmail program. * @param string $header The message headers * @param string $body The message body + * @throws phpmailerException * @access protected * @return bool */ protected function SendmailSend($header, $body) { if ($this->Sender != '') { - $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); + $sendmail = sprintf("%s -oi -f%s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); } else { $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); } if ($this->SingleTo === true) { - foreach ($this->SingleToArray as $key => $val) { + foreach ($this->SingleToArray as $val) { if(!@$mail = popen($sendmail, 'w')) { throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } @@ -692,6 +923,7 @@ class PHPMailer { * Sends mail using the PHP mail() function. * @param string $header The message headers * @param string $body The message body + * @throws phpmailerException * @access protected * @return bool */ @@ -703,40 +935,27 @@ class PHPMailer { $to = implode(', ', $toArr); if (empty($this->Sender)) { - $params = "-oi -f %s"; + $params = " "; } else { - $params = sprintf("-oi -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); - if ($this->SingleTo === true && count($toArr) > 1) { - foreach ($toArr as $key => $val) { - $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); - // implement call back function if it exists - $isSent = ($rt == 1) ? 1 : 0; - $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body); - } - } else { - $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); + } + $rt = false; + if ($this->SingleTo === true && count($toArr) > 1) { + foreach ($toArr as $val) { + $rt = $this->mail_passthru($val, $this->Subject, $body, $header, $params); // implement call back function if it exists $isSent = ($rt == 1) ? 1 : 0; - $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body); + $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body); } } else { - if ($this->SingleTo === true && count($toArr) > 1) { - foreach ($toArr as $key => $val) { - $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); - // implement call back function if it exists - $isSent = ($rt == 1) ? 1 : 0; - $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body); - } - } else { - $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header); - // implement call back function if it exists - $isSent = ($rt == 1) ? 1 : 0; - $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body); - } + $rt = $this->mail_passthru($to, $this->Subject, $body, $header, $params); + // implement call back function if it exists + $isSent = ($rt == 1) ? 1 : 0; + $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body); } if (isset($old_from)) { ini_set('sendmail_from', $old_from); @@ -752,6 +971,7 @@ class PHPMailer { * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. * @param string $header The message headers * @param string $body The message body + * @throws phpmailerException * @uses SMTP * @access protected * @return bool @@ -765,7 +985,8 @@ class PHPMailer { } $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; if(!$this->smtp->Mail($smtp_from)) { - throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL); + $this->SetError($this->Lang('from_failed') . $smtp_from . ' : ' .implode(',', $this->smtp->getError())); + throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL); } // Attempt to send attach all recipients @@ -816,6 +1037,9 @@ class PHPMailer { } if($this->SMTPKeepAlive == true) { $this->smtp->Reset(); + } else { + $this->smtp->Quit(); + $this->smtp->Close(); } return true; } @@ -825,13 +1049,15 @@ class PHPMailer { * Returns false if the operation failed. * @uses SMTP * @access public + * @throws phpmailerException * @return bool */ public function SmtpConnect() { if(is_null($this->smtp)) { - $this->smtp = new SMTP(); + $this->smtp = new SMTP; } + $this->smtp->Timeout = $this->Timeout; $this->smtp->do_debug = $this->SMTPDebug; $hosts = explode(';', $this->Host); $index = 0; @@ -859,7 +1085,7 @@ class PHPMailer { if ($tls) { if (!$this->smtp->StartTLS()) { - throw new phpmailerException($this->Lang('tls')); + throw new phpmailerException($this->Lang('connect_host')); } //We must resend HELO after tls negotiation @@ -868,7 +1094,7 @@ class PHPMailer { $connection = true; if ($this->SMTPAuth) { - if (!$this->smtp->Authenticate($this->Username, $this->Password)) { + if (!$this->smtp->Authenticate($this->Username, $this->Password, $this->AuthType, $this->Realm, $this->Workstation)) { throw new phpmailerException($this->Lang('authenticate')); } } @@ -880,7 +1106,9 @@ class PHPMailer { } } catch (phpmailerException $e) { $this->smtp->Reset(); - throw $e; + if ($this->exceptions) { + throw $e; + } } return true; } @@ -890,7 +1118,7 @@ class PHPMailer { * @return void */ public function SmtpClose() { - if(!is_null($this->smtp)) { + if ($this->smtp !== null) { if($this->smtp->Connected()) { $this->smtp->Quit(); $this->smtp->Close(); @@ -899,32 +1127,34 @@ class PHPMailer { } /** - * Sets the language for all class error messages. - * Returns false if it cannot load the language file. The default language is English. - * @param string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br") - * @param string $lang_path Path to the language file directory - * @access public - */ + * Sets the language for all class error messages. + * Returns false if it cannot load the language file. The default language is English. + * @param string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br") + * @param string $lang_path Path to the language file directory + * @return bool + * @access public + */ function SetLanguage($langcode = 'en', $lang_path = 'language/') { //Define full set of translatable strings $PHPMAILER_LANG = array( - 'provide_address' => 'You must provide at least one recipient email address.', + 'authenticate' => 'SMTP Error: Could not authenticate.', + 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', + 'data_not_accepted' => 'SMTP Error: Data not accepted.', + 'empty_message' => 'Message body empty', + 'encoding' => 'Unknown encoding: ', + 'execute' => 'Could not execute: ', + 'file_access' => 'Could not access file: ', + 'file_open' => 'File Error: Could not open file: ', + 'from_failed' => 'The following From address failed: ', + 'instantiate' => 'Could not instantiate mail function.', + 'invalid_address' => 'Invalid address', 'mailer_not_supported' => ' mailer is not supported.', - 'execute' => 'Could not execute: ', - 'instantiate' => 'Could not instantiate mail function.', - 'authenticate' => 'SMTP Error: Could not authenticate.', - 'from_failed' => 'The following From address failed: ', - 'recipients_failed' => 'SMTP Error: The following recipients failed: ', - 'data_not_accepted' => 'SMTP Error: Data not accepted.', - 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', - 'file_access' => 'Could not access file: ', - 'file_open' => 'File Error: Could not open file: ', - 'encoding' => 'Unknown encoding: ', - 'signing' => 'Signing Error: ', - 'smtp_error' => 'SMTP server error: ', - 'empty_message' => 'Message body empty', - 'invalid_address' => 'Invalid address', - 'variable_set' => 'Cannot set or reset variable: ' + 'provide_address' => 'You must provide at least one recipient email address.', + 'recipients_failed' => 'SMTP Error: The following recipients failed: ', + 'signing' => 'Signing Error: ', + 'smtp_connect_failed' => 'SMTP Connect() failed.', + '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; @@ -950,6 +1180,8 @@ class PHPMailer { /** * Creates recipient headers. * @access public + * @param string $type + * @param array $addr * @return string */ public function AddrAppend($type, $addr) { @@ -967,6 +1199,7 @@ class PHPMailer { /** * Formats an address correctly. * @access public + * @param string $addr * @return string */ public function AddrFormat($addr) { @@ -992,13 +1225,15 @@ class PHPMailer { // 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"); + $lelen = strlen($this->LE); + $crlflen = strlen(self::CRLF); $message = $this->FixEOL($message); - if (substr($message, -1) == $this->LE) { - $message = substr($message, 0, -1); + if (substr($message, -$lelen) == $this->LE) { + $message = substr($message, 0, -$lelen); } - $line = explode($this->LE, $message); + $line = explode($this->LE, $message); // Magic. We know FixEOL uses $LE $message = ''; for ($i = 0 ;$i < count($line); $i++) { $line_part = explode(' ', $line[$i]); @@ -1006,7 +1241,7 @@ class PHPMailer { for ($e = 0; $e<count($line_part); $e++) { $word = $line_part[$e]; if ($qp_mode and (strlen($word) > $length)) { - $space_left = $length - strlen($buf) - 1; + $space_left = $length - strlen($buf) - $crlflen; if ($e != 0) { if ($space_left > 20) { $len = $space_left; @@ -1020,13 +1255,16 @@ class PHPMailer { $part = substr($word, 0, $len); $word = substr($word, $len); $buf .= ' ' . $part; - $message .= $buf . sprintf("=%s", $this->LE); + $message .= $buf . sprintf("=%s", self::CRLF); } else { $message .= $buf . $soft_break; } $buf = ''; } while (strlen($word) > 0) { + if ($length <= 0) { + break; + } $len = $length; if ($is_utf8) { $len = $this->UTF8CharBoundary($word, $len); @@ -1039,7 +1277,7 @@ class PHPMailer { $word = substr($word, $len); if (strlen($word) > 0) { - $message .= $part . sprintf("=%s", $this->LE); + $message .= $part . sprintf("=%s", self::CRLF); } else { $buf = $part; } @@ -1054,7 +1292,7 @@ class PHPMailer { } } } - $message .= $buf . $this->LE; + $message .= $buf . self::CRLF; } return $message; @@ -1139,11 +1377,18 @@ class PHPMailer { $this->boundary[2] = 'b2_' . $uniq_id; $this->boundary[3] = 'b3_' . $uniq_id; - $result .= $this->HeaderLine('Date', self::RFCDate()); - if($this->Sender == '') { - $result .= $this->HeaderLine('Return-Path', trim($this->From)); + if ($this->MessageDate == '') { + $result .= $this->HeaderLine('Date', self::RFCDate()); + } else { + $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)); + $result .= $this->HeaderLine('Return-Path', '<'.trim($this->Sender).'>'); } // To be created automatically by mail() @@ -1177,7 +1422,7 @@ class PHPMailer { } if(count($this->ReplyTo) > 0) { - $result .= $this->AddrAppend('Reply-to', $this->ReplyTo); + $result .= $this->AddrAppend('Reply-To', $this->ReplyTo); } // mail() sets the subject itself @@ -1191,10 +1436,13 @@ class PHPMailer { $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); } $result .= $this->HeaderLine('X-Priority', $this->Priority); - if($this->XMailer) { - $result .= $this->HeaderLine('X-Mailer', $this->XMailer); + if ($this->XMailer == '') { + $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (https://github.com/PHPMailer/PHPMailer/)'); } else { - $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (http://code.google.com/a/apache-extras.org/p/phpmailer/)'); + $myXmailer = trim($this->XMailer); + if ($myXmailer) { + $result .= $this->HeaderLine('X-Mailer', $myXmailer); + } } if($this->ConfirmReadingTo != '') { @@ -1221,10 +1469,6 @@ class PHPMailer { public function GetMailMIME() { $result = ''; switch($this->message_type) { - case 'plain': - $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding); - $result .= $this->TextLine('Content-Type: '.$this->ContentType.'; charset="'.$this->CharSet.'"'); - break; case 'inline': $result .= $this->HeaderLine('Content-Type', 'multipart/related;'); $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); @@ -1241,56 +1485,69 @@ class PHPMailer { $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;'); $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); break; + default: + // Catches case 'plain': and case '': + $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding); + $result .= $this->TextLine('Content-Type: '.$this->ContentType.'; charset='.$this->CharSet); + break; } if($this->Mailer != 'mail') { - $result .= $this->LE.$this->LE; + $result .= $this->LE; } return $result; } /** + * Returns the MIME message (headers and body). Only really valid post PreSend(). + * @access public + * @return string + */ + public function GetSentMIMEMessage() { + return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody; + } + + + /** * Assembles the message body. Returns an empty string on failure. * @access public + * @throws phpmailerException * @return string The assembled message body */ public function CreateBody() { $body = ''; if ($this->sign_key_file) { - $body .= $this->GetMailMIME(); + $body .= $this->GetMailMIME().$this->LE; } $this->SetWordWrap(); switch($this->message_type) { - case 'plain': - $body .= $this->EncodeString($this->Body, $this->Encoding); - break; case 'inline': $body .= $this->GetBoundary($this->boundary[1], '', '', ''); $body .= $this->EncodeString($this->Body, $this->Encoding); $body .= $this->LE.$this->LE; - $body .= $this->AttachAll("inline", $this->boundary[1]); + $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->LE.$this->LE; - $body .= $this->AttachAll("attachment", $this->boundary[1]); + $body .= $this->AttachAll('attachment', $this->boundary[1]); break; case 'inline_attach': - $body .= $this->TextLine("--" . $this->boundary[1]); + $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], '', '', ''); $body .= $this->EncodeString($this->Body, $this->Encoding); $body .= $this->LE.$this->LE; - $body .= $this->AttachAll("inline", $this->boundary[2]); + $body .= $this->AttachAll('inline', $this->boundary[2]); $body .= $this->LE; - $body .= $this->AttachAll("attachment", $this->boundary[1]); + $body .= $this->AttachAll('attachment', $this->boundary[1]); break; case 'alt': $body .= $this->GetBoundary($this->boundary[1], '', 'text/plain', ''); @@ -1305,19 +1562,19 @@ class PHPMailer { $body .= $this->GetBoundary($this->boundary[1], '', 'text/plain', ''); $body .= $this->EncodeString($this->AltBody, $this->Encoding); $body .= $this->LE.$this->LE; - $body .= $this->TextLine("--" . $this->boundary[1]); + $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->LE.$this->LE; - $body .= $this->AttachAll("inline", $this->boundary[2]); + $body .= $this->AttachAll('inline', $this->boundary[2]); $body .= $this->LE; $body .= $this->EndBoundary($this->boundary[1]); break; case 'alt_attach': - $body .= $this->TextLine("--" . $this->boundary[1]); + $body .= $this->TextLine('--' . $this->boundary[1]); $body .= $this->HeaderLine('Content-Type', 'multipart/alternative;'); $body .= $this->TextLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; @@ -1329,28 +1586,32 @@ class PHPMailer { $body .= $this->LE.$this->LE; $body .= $this->EndBoundary($this->boundary[2]); $body .= $this->LE; - $body .= $this->AttachAll("attachment", $this->boundary[1]); + $body .= $this->AttachAll('attachment', $this->boundary[1]); break; case 'alt_inline_attach': - $body .= $this->TextLine("--" . $this->boundary[1]); + $body .= $this->TextLine('--' . $this->boundary[1]); $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->LE.$this->LE; - $body .= $this->TextLine("--" . $this->boundary[2]); + $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->LE.$this->LE; - $body .= $this->AttachAll("inline", $this->boundary[3]); + $body .= $this->AttachAll('inline', $this->boundary[3]); $body .= $this->LE; $body .= $this->EndBoundary($this->boundary[2]); $body .= $this->LE; - $body .= $this->AttachAll("attachment", $this->boundary[1]); + $body .= $this->AttachAll('attachment', $this->boundary[1]); + break; + default: + // catch case 'plain' and case '' + $body .= $this->EncodeString($this->Body, $this->Encoding); break; } @@ -1358,17 +1619,20 @@ class PHPMailer { $body = ''; } elseif ($this->sign_key_file) { try { - $file = tempnam('', 'mail'); + if (!defined('PKCS7_TEXT')) { + throw new phpmailerException($this->Lang('signing').' OpenSSL extension missing.'); + } + $file = tempnam(sys_get_temp_dir(), 'mail'); file_put_contents($file, $body); //TODO check this worked - $signed = tempnam("", "signed"); - if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), NULL)) { + $signed = tempnam(sys_get_temp_dir(), 'signed'); + if (@openssl_pkcs7_sign($file, $signed, 'file://'.realpath($this->sign_cert_file), array('file://'.realpath($this->sign_key_file), $this->sign_key_pass), null)) { @unlink($file); - @unlink($signed); $body = file_get_contents($signed); + @unlink($signed); } else { @unlink($file); @unlink($signed); - throw new phpmailerException($this->Lang("signing").openssl_error_string()); + throw new phpmailerException($this->Lang('signing').openssl_error_string()); } } catch (phpmailerException $e) { $body = ''; @@ -1377,13 +1641,16 @@ class PHPMailer { } } } - return $body; } /** * Returns the start of a message boundary. * @access protected + * @param string $boundary + * @param string $charSet + * @param string $contentType + * @param string $encoding * @return string */ protected function GetBoundary($boundary, $charSet, $contentType, $encoding) { @@ -1398,7 +1665,7 @@ class PHPMailer { $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); $result .= $this->LE; @@ -1409,6 +1676,7 @@ class PHPMailer { /** * Returns the end of a message boundary. * @access protected + * @param string $boundary * @return string */ protected function EndBoundary($boundary) { @@ -1430,8 +1698,10 @@ class PHPMailer { } /** - * Returns a formatted header line. + * Returns a formatted header line. * @access public + * @param string $name + * @param string $value * @return string */ public function HeaderLine($name, $value) { @@ -1441,6 +1711,7 @@ class PHPMailer { /** * Returns a formatted mail line. * @access public + * @param string $value * @return string */ public function TextLine($value) { @@ -1459,6 +1730,7 @@ class PHPMailer { * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. + * @throws phpmailerException * @return bool */ public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { @@ -1487,7 +1759,9 @@ class PHPMailer { if ($this->exceptions) { throw $e; } - echo $e->getMessage()."\n"; + if ($this->SMTPDebug) { + $this->edebug($e->getMessage()."\n"); + } if ( $e->getCode() == self::STOP_CRITICAL ) { return false; } @@ -1507,6 +1781,8 @@ class PHPMailer { * Attaches all fs, string, and binary attachments to the message. * Returns an empty string on failure. * @access protected + * @param string $disposition_type + * @param string $boundary * @return string */ protected function AttachAll($disposition_type, $boundary) { @@ -1520,6 +1796,8 @@ class PHPMailer { // CHECK IF IT IS A VALID DISPOSITION_FILTER if($attachment[6] == $disposition_type) { // Check for string attachment + $string = ''; + $path = ''; $bString = $attachment[5]; if ($bString) { $string = $attachment[0]; @@ -1576,6 +1854,7 @@ class PHPMailer { * Returns an empty string on failure. * @param string $path The full path to the file * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * @throws phpmailerException * @see EncodeFile() * @access protected * @return string @@ -1585,19 +1864,22 @@ class PHPMailer { if (!is_readable($path)) { throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE); } - if (function_exists('get_magic_quotes')) { - function get_magic_quotes() { - return false; + $magic_quotes = get_magic_quotes_runtime(); + if ($magic_quotes) { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + set_magic_quotes_runtime(0); + } else { + ini_set('magic_quotes_runtime', 0); } } - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - $magic_quotes = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); - } $file_buffer = file_get_contents($path); $file_buffer = $this->EncodeString($file_buffer, $encoding); - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - set_magic_quotes_runtime($magic_quotes); + if ($magic_quotes) { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + set_magic_quotes_runtime($magic_quotes); + } else { + ini_set('magic_quotes_runtime', $magic_quotes); + } } return $file_buffer; } catch (Exception $e) { @@ -1643,6 +1925,8 @@ class PHPMailer { /** * Encode a header string to best (shortest) of Q, B, quoted or none. * @access public + * @param string $str + * @param string $position * @return string */ public function EncodeHeader($str, $position = 'text') { @@ -1670,18 +1954,18 @@ class PHPMailer { break; } - if ($x == 0) { + if ($x == 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 (strlen($str)/3 < $x) { + if ($x > 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)) { // Use a custom function which correctly encodes and wraps long // multibyte strings without breaking lines within a character - $encoded = $this->Base64EncodeWrapMB($str); + $encoded = $this->Base64EncodeWrapMB($str, "\n"); } else { $encoded = base64_encode($str); $maxlen -= $maxlen % 4; @@ -1691,7 +1975,7 @@ class PHPMailer { $encoding = 'Q'; $encoded = $this->EncodeQ($str, $position); $encoded = $this->WrapText($encoded, $maxlen, true); - $encoded = str_replace('='.$this->LE, "\n", trim($encoded)); + $encoded = str_replace('='.self::CRLF, "\n", trim($encoded)); } $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); @@ -1720,12 +2004,16 @@ class PHPMailer { * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php * @access public * @param string $str multi-byte text to wrap encode + * @param string $lf string to use as linefeed/end-of-line * @return string */ - public function Base64EncodeWrapMB($str) { + public function Base64EncodeWrapMB($str, $lf=null) { $start = "=?".$this->CharSet."?B?"; $end = "?="; $encoded = ""; + if ($lf === null) { + $lf = $this->LE; + } $mb_length = mb_strlen($str, $this->CharSet); // Each line must have length <= 75, including $start and $end @@ -1746,94 +2034,43 @@ class PHPMailer { } while (strlen($chunk) > $length); - $encoded .= $chunk . $this->LE; + $encoded .= $chunk . $lf; } // Chomp the last linefeed - $encoded = substr($encoded, 0, -strlen($this->LE)); + $encoded = substr($encoded, 0, -strlen($lf)); return $encoded; } /** - * Encode string to quoted-printable. - * Only uses standard PHP, slow, but will always work - * @access public - * @param string $string the text to encode - * @param integer $line_max Number of chars allowed on a line before wrapping - * @return string - */ - public function EncodeQPphp( $input = '', $line_max = 76, $space_conv = false) { - $hex = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); - $lines = preg_split('/(?:\r\n|\r|\n)/', $input); - $eol = "\r\n"; - $escape = '='; - $output = ''; - while( list(, $line) = each($lines) ) { - $linlen = strlen($line); - $newline = ''; - for($i = 0; $i < $linlen; $i++) { - $c = substr( $line, $i, 1 ); - $dec = ord( $c ); - if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E - $c = '=2E'; - } - if ( $dec == 32 ) { - if ( $i == ( $linlen - 1 ) ) { // convert space at eol only - $c = '=20'; - } else if ( $space_conv ) { - $c = '=20'; - } - } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required - $h2 = floor($dec/16); - $h1 = floor($dec%16); - $c = $escape.$hex[$h2].$hex[$h1]; - } - if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted - $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay - $newline = ''; - // check if newline first character will be point or not - if ( $dec == 46 ) { - $c = '=2E'; - } - } - $newline .= $c; - } // end of for - $output .= $newline.$eol; - } // end of while - return $output; - } - - /** - * Encode string to RFC2045 (6.7) quoted-printable format - * Uses a PHP5 stream filter to do the encoding about 64x faster than the old version - * Also results in same content as you started with after decoding - * @see EncodeQPphp() - * @access public - * @param string $string the text to encode - * @param integer $line_max Number of chars allowed on a line before wrapping - * @param boolean $space_conv Dummy param for compatibility with existing EncodeQP function - * @return string - * @author Marcus Bointon - */ - public function EncodeQP($string, $line_max = 76, $space_conv = false) { + * Encode string to RFC2045 (6.7) quoted-printable format + * @access public + * @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 + */ + 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); } - $filters = stream_get_filters(); - if (!in_array('convert.*', $filters)) { //Got convert stream filter? - return $this->EncodeQPphp($string, $line_max, $space_conv); //Fall back to old implementation - } - $fp = fopen('php://temp/', 'r+'); - $string = preg_replace('/\r\n?/', $this->LE, $string); //Normalise line breaks - $params = array('line-length' => $line_max, 'line-break-chars' => $this->LE); - $s = stream_filter_append($fp, 'convert.quoted-printable-encode', STREAM_FILTER_READ, $params); - fputs($fp, $string); - rewind($fp); - $out = stream_get_contents($fp); - stream_filter_remove($s); - $out = preg_replace('/^\./m', '=2E', $out); //Encode . if it is first char on a line, workaround for bug in Exchange - fclose($fp); - return $out; + //Fall back to a pure PHP implementation + $string = str_replace(array('%20', '%0D%0A.', '%0D%0A', '%'), array(' ', "\r\n=2E", "\r\n", '='), rawurlencode($string)); + $string = preg_replace('/[^\r\n]{'.($line_max - 3).'}[^=\r\n]{2}/', "$0=\r\n", $string); + return $string; + } + + /** + * Wrapper to preserve BC for old QP encoding function that was removed + * @see EncodeQP() + * @access public + * @param string $string + * @param integer $line_max + * @param bool $space_conv + * @return string + */ + public function EncodeQPphp($string, $line_max = 76, $space_conv = false) { + return $this->EncodeQP($string, $line_max); } /** @@ -1845,29 +2082,37 @@ class PHPMailer { * @return string */ public function EncodeQ($str, $position = 'text') { - // There should not be any EOL in the string - $encoded = preg_replace('/[\r\n]*/', '', $str); - + //There should not be any EOL in the string + $pattern=""; + $encoded = str_replace(array("\r", "\n"), '', $str); switch (strtolower($position)) { case 'phrase': - $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); + $pattern = '^A-Za-z0-9!*+\/ -'; break; + case 'comment': - $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); + $pattern = '\(\)"'; + //note that we don't break here! + //for this reason we build the $pattern without including delimiters and [] + case 'text': default: - // Replace every high ascii, control =, ? and _ characters - //TODO using /e (equivalent to eval()) is probably not a good idea - $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', - "'='.sprintf('%02X', ord(stripslashes('\\1')))", $encoded); + //Replace every high ascii, control =, ? and _ characters + //We put \075 (=) as first value to make sure it's the first one in being converted, preventing double encode + $pattern = '\075\000-\011\013\014\016-\037\077\137\177-\377' . $pattern; break; } - // Replace every spaces to _ (more readable than =20) - $encoded = str_replace(' ', '_', $encoded); + if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { + foreach (array_unique($matches[0]) as $char) { + $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); + } + } + + //Replace every spaces to _ (more readable than =20) + return str_replace(' ', '_', $encoded); +} - return $encoded; - } /** * Adds a string or binary attachment (non-filesystem) to the list. @@ -1894,17 +2139,17 @@ class PHPMailer { } /** - * Adds an embedded attachment. This can include images, sounds, and - * just about any other document. Make sure to set the $type to an - * image type. For JPEG images use "image/jpeg" and for GIF images - * use "image/gif". + * Add an embedded attachment from a file. + * This can include images, sounds, and just about any other document type. + * Be sure to set the $type to an image type for images: + * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'. * @param string $path Path to the attachment. - * @param string $cid Content ID of the attachment. Use this to identify - * the Id for accessing the image in an HTML form. + * @param string $cid Content ID of the attachment; Use this to reference + * the content when using an embedded image in HTML. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). - * @param string $type File extension (MIME) type. - * @return bool + * @param string $type File MIME type. + * @return bool True on successfully adding an attachment */ public function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { @@ -1929,22 +2174,36 @@ class PHPMailer { 6 => 'inline', 7 => $cid ); - return true; } - public function AddStringEmbeddedImage($string, $cid, $filename = '', $encoding = 'base64', $type = 'application/octet-stream') { + + /** + * Add an embedded stringified attachment. + * This can include images, sounds, and just about any other document type. + * Be sure to set the $type to an image type for images: + * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'. + * @param string $string The attachment binary data. + * @param string $cid Content ID of the attachment; Use this to reference + * the content when using an embedded image in HTML. + * @param string $name + * @param string $encoding File encoding (see $Encoding). + * @param string $type MIME type. + * @return bool True on successfully adding an attachment + */ + public function AddStringEmbeddedImage($string, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { // Append to $attachment array $this->attachment[] = array( 0 => $string, - 1 => $filename, - 2 => basename($filename), + 1 => $name, + 2 => $name, 3 => $encoding, 4 => $type, 5 => true, // isStringAttachment 6 => 'inline', 7 => $cid ); + return true; } /** @@ -1961,6 +2220,10 @@ class PHPMailer { return false; } + /** + * Returns true if an attachment (non-inline) is present. + * @return bool + */ public function AttachmentExists() { foreach($this->attachment as $attachment) { if ($attachment[6] == 'attachment') { @@ -1970,8 +2233,12 @@ class PHPMailer { return false; } + /** + * Does this message have an alternative body set? + * @return bool + */ public function AlternativeExists() { - return strlen($this->AltBody)>0; + return !empty($this->AltBody); } ///////////////////////////////////////////////// @@ -2055,6 +2322,7 @@ class PHPMailer { /** * Adds the error message to the error container. * @access protected + * @param string $msg * @return void */ protected function SetError($msg) { @@ -2075,13 +2343,10 @@ class PHPMailer { * @static */ public static function RFCDate() { - $tz = date('Z'); - $tzs = ($tz < 0) ? '-' : '+'; - $tz = abs($tz); - $tz = (int)($tz/3600)*100 + ($tz%3600)/60; - $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz); - - return $result; + //Set the time zone to whatever the default is to avoid 500 errors + //Will default to UTC if it's not set properly in php.ini + date_default_timezone_set(@date_default_timezone_get()); + return date('D, j M Y H:i:s O'); } /** @@ -2104,6 +2369,7 @@ class PHPMailer { /** * Returns a message in the appropriate language. * @access protected + * @param string $key * @return string */ protected function Lang($key) { @@ -2128,84 +2394,118 @@ class PHPMailer { } /** - * Changes every end of line from CR or LF to CRLF. + * Changes every end of line from CRLF, CR or LF to $this->LE. * @access public + * @param string $str String to FixEOL * @return string */ public function FixEOL($str) { - $str = str_replace("\r\n", "\n", $str); - $str = str_replace("\r", "\n", $str); - $str = str_replace("\n", $this->LE, $str); - return $str; + // condense down to \n + $nstr = str_replace(array("\r\n", "\r"), "\n", $str); + // Now convert LE as needed + if ($this->LE !== "\n") { + $nstr = str_replace("\n", $this->LE, $nstr); + } + return $nstr; } /** - * Adds a custom header. + * Adds a custom header. $name value can be overloaded to contain + * both header name and value (name:value) * @access public + * @param string $name custom header name + * @param string $value header value * @return void */ - public function AddCustomHeader($custom_header) { - $this->CustomHeader[] = explode(':', $custom_header, 2); + public function AddCustomHeader($name, $value=null) { + if ($value === null) { + // Value passed in as name:value + $this->CustomHeader[] = explode(':', $name, 2); + } else { + $this->CustomHeader[] = array($name, $value); + } } /** - * Evaluates the message and returns modifications for inline images and backgrounds + * Creates a message from an HTML string, making modifications for inline images and backgrounds + * and creates a plain-text version by converting the HTML + * Overwrites any existing values in $this->Body and $this->AltBody * @access public - * @return $message + * @param string $message HTML message string + * @param string $basedir baseline directory for path + * @param bool $advanced Whether to use the advanced HTML to text converter + * @return string $message */ - public function MsgHTML($message, $basedir = '') { - preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images); + public function MsgHTML($message, $basedir = '', $advanced = false) { + preg_match_all("/(src|background)=[\"'](.*)[\"']/Ui", $message, $images); if(isset($images[2])) { foreach($images[2] as $i => $url) { // do not change urls for absolute images (thanks to corvuscorax) if (!preg_match('#^[A-z]+://#', $url)) { $filename = basename($url); $directory = dirname($url); - ($directory == '.') ? $directory='': ''; - $cid = 'cid:' . md5($filename); + if ($directory == '.') { + $directory = ''; + } + $cid = 'cid:' . md5($url); $ext = pathinfo($filename, PATHINFO_EXTENSION); $mimeType = self::_mime_types($ext); if ( strlen($basedir) > 1 && substr($basedir, -1) != '/') { $basedir .= '/'; } if ( strlen($directory) > 1 && substr($directory, -1) != '/') { $directory .= '/'; } - if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64', $mimeType) ) { - $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message); + if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($url), $filename, 'base64', $mimeType) ) { + $message = preg_replace("/".$images[1][$i]."=[\"']".preg_quote($url, '/')."[\"']/Ui", $images[1][$i]."=\"".$cid."\"", $message); } } } } $this->IsHTML(true); $this->Body = $message; - $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s', '', $message))); - if (!empty($textMsg) && empty($this->AltBody)) { - $this->AltBody = html_entity_decode($textMsg); - } + $this->AltBody = $this->html2text($message, $advanced); if (empty($this->AltBody)) { $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n"; } + return $message; + } + + /** + * Convert an HTML string into a plain text version + * @param string $html The HTML text to convert + * @param bool $advanced Should this use the more complex html2text converter or just a simple one? + * @return string + */ + public function html2text($html, $advanced = false) { + if ($advanced) { + require_once 'extras/class.html2text.php'; + $h = new html2text($html); + return $h->get_text(); + } + return html_entity_decode(trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s', '', $html))), ENT_QUOTES, $this->CharSet); } /** * Gets the MIME type of the embedded or inline image - * @param string File extension + * @param string $ext File extension * @access public * @return string MIME type of ext * @static */ public static function _mime_types($ext = '') { $mimes = array( + 'xl' => 'application/excel', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', - 'doc' => 'application/msword', 'bin' => 'application/macbinary', + 'doc' => 'application/msword', + 'word' => 'application/msword', + 'class' => 'application/octet-stream', + 'dll' => 'application/octet-stream', 'dms' => 'application/octet-stream', + 'exe' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', - 'exe' => 'application/octet-stream', - 'class' => 'application/octet-stream', 'psd' => 'application/octet-stream', - 'so' => 'application/octet-stream', 'sea' => 'application/octet-stream', - 'dll' => 'application/octet-stream', + 'so' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', @@ -2223,9 +2523,9 @@ class PHPMailer { 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'gtar' => 'application/x-gtar', - 'php' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php' => 'application/x-httpd-php', 'phtml' => 'application/x-httpd-php', 'phps' => 'application/x-httpd-php-source', 'js' => 'application/x-javascript', @@ -2233,69 +2533,68 @@ class PHPMailer { 'sit' => 'application/x-stuffit', 'tar' => 'application/x-tar', 'tgz' => 'application/x-tar', - 'xhtml' => 'application/xhtml+xml', 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', 'zip' => 'application/zip', 'mid' => 'audio/midi', 'midi' => 'audio/midi', - 'mpga' => 'audio/mpeg', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', + 'mpga' => 'audio/mpeg', 'aif' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', - 'rv' => 'video/vnd.rn-realvideo', 'wav' => 'audio/x-wav', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', 'jpe' => 'image/jpeg', + 'jpg' => 'image/jpeg', 'png' => 'image/png', 'tiff' => 'image/tiff', 'tif' => 'image/tiff', + 'eml' => 'message/rfc822', 'css' => 'text/css', 'html' => 'text/html', 'htm' => 'text/html', 'shtml' => 'text/html', - 'txt' => 'text/plain', - 'text' => 'text/plain', 'log' => 'text/plain', + 'text' => 'text/plain', + 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'xml' => 'text/xml', 'xsl' => 'text/xml', 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', 'mpe' => 'video/mpeg', - 'qt' => 'video/quicktime', + 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', + 'qt' => 'video/quicktime', + 'rv' => 'video/vnd.rn-realvideo', 'avi' => 'video/x-msvideo', - 'movie' => 'video/x-sgi-movie', - 'doc' => 'application/msword', - 'word' => 'application/msword', - 'xl' => 'application/excel', - 'eml' => 'message/rfc822' + 'movie' => 'video/x-sgi-movie' ); return (!isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)]; } /** - * Set (or reset) Class Objects (variables) - * - * Usage Example: - * $page->set('X-Priority', '3'); - * - * @access public - * @param string $name Parameter Name - * @param mixed $value Parameter Value - * NOTE: will not work with arrays, there are no arrays to set/reset - * @todo Should this not be using __set() magic function? - */ + * Set (or reset) Class Objects (variables) + * + * Usage Example: + * $page->set('X-Priority', '3'); + * + * @access public + * @param string $name + * @param mixed $value + * NOTE: will not work with arrays, there are no arrays to set/reset + * @throws phpmailerException + * @return bool + * @todo Should this not be using __set() magic function? + */ public function set($name, $value = '') { try { if (isset($this->$name) ) { @@ -2315,20 +2614,19 @@ class PHPMailer { /** * Strips newlines to prevent header injection. * @access public - * @param string $str String + * @param string $str * @return string */ public function SecureHeader($str) { - $str = str_replace("\r", '', $str); - $str = str_replace("\n", '', $str); - return trim($str); + return trim(str_replace(array("\r", "\n"), '', $str)); } /** * Set the private key file and password to sign the message. * * @access public - * @param string $key_filename Parameter File Name + * @param string $cert_filename + * @param string $key_filename * @param string $key_pass Password for private key */ public function Sign($cert_filename, $key_filename, $key_pass) { @@ -2341,11 +2639,10 @@ class PHPMailer { * Set the private key file and password to sign the message. * * @access public - * @param string $key_filename Parameter File Name - * @param string $key_pass Password for private key + * @param string $txt + * @return string */ public function DKIM_QP($txt) { - $tmp = ''; $line = ''; for ($i = 0; $i < strlen($txt); $i++) { $ord = ord($txt[$i]); @@ -2363,8 +2660,16 @@ class PHPMailer { * * @access public * @param string $s Header + * @throws phpmailerException + * @return string */ public function DKIM_Sign($s) { + if (!defined('PKCS7_TEXT')) { + if ($this->exceptions) { + throw new phpmailerException($this->Lang("signing").' OpenSSL extension missing.'); + } + return ''; + } $privKeyStr = file_get_contents($this->DKIM_private); if ($this->DKIM_passphrase != '') { $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); @@ -2374,6 +2679,7 @@ class PHPMailer { if (openssl_sign($s, $signature, $privKey)) { return base64_encode($signature); } + return ''; } /** @@ -2381,6 +2687,7 @@ class PHPMailer { * * @access public * @param string $s Header + * @return string */ public function DKIM_HeaderC($s) { $s = preg_replace("/\r\n\s+/", " ", $s); @@ -2400,6 +2707,7 @@ class PHPMailer { * * @access public * @param string $body Message Body + * @return string */ public function DKIM_BodyC($body) { if ($body == '') return "\r\n"; @@ -2420,6 +2728,7 @@ class PHPMailer { * @param string $headers_line Header lines * @param string $subject Subject * @param string $body Body + * @return string */ public function DKIM_Add($headers_line, $subject, $body) { $DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms @@ -2428,11 +2737,22 @@ class PHPMailer { $DKIMtime = time() ; // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone) $subject_header = "Subject: $subject"; $headers = explode($this->LE, $headers_line); + $from_header = ''; + $to_header = ''; + $current = ''; foreach($headers as $header) { if (strpos($header, 'From:') === 0) { $from_header = $header; + $current = 'from_header'; } elseif (strpos($header, 'To:') === 0) { $to_header = $header; + $current = 'to_header'; + } else { + if($current && strpos($header, ' =?') === 0){ + $$current .= $header; + } else { + $current = ''; + } } } $from = str_replace('|', '=7C', $this->DKIM_QP($from_header)); @@ -2453,21 +2773,38 @@ class PHPMailer { "\tb="; $toSign = $this->DKIM_HeaderC($from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs); $signed = $this->DKIM_Sign($toSign); - return "X-PHPMAILER-DKIM: phpmailer.worxware.com\r\n".$dkimhdrs.$signed."\r\n"; + return $dkimhdrs.$signed."\r\n"; } - protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body) { - if (!empty($this->action_function) && function_exists($this->action_function)) { - $params = array($isSent, $to, $cc, $bcc, $subject, $body); + /** + * Perform callback + * @param boolean $isSent + * @param string $to + * @param string $cc + * @param string $bcc + * @param string $subject + * @param string $body + * @param string $from + */ + protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from = null) { + if (!empty($this->action_function) && is_callable($this->action_function)) { + $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from); call_user_func_array($this->action_function, $params); } } } +/** + * Exception handler for PHPMailer + * @package PHPMailer + */ class phpmailerException extends Exception { + /** + * Prettify error message output + * @return string + */ public function errorMessage() { $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n"; return $errorMsg; } } -?> diff --git a/modules/phpmailer/class.pop3.php b/modules/phpmailer/class.pop3.php index 83df20f3..17bb6756 100644 --- a/modules/phpmailer/class.pop3.php +++ b/modules/phpmailer/class.pop3.php @@ -2,15 +2,16 @@ /*~ class.pop3.php .---------------------------------------------------------------------------. | Software: PHPMailer - PHP email class | -| Version: 5.2 | -| Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ | +| Version: 5.2.6 | +| Site: https://github.com/PHPMailer/PHPMailer/ | | ------------------------------------------------------------------------- | -| Admin: Jim Jagielski (project admininistrator) | +| Admins: Marcus Bointon | +| Admins: Jim Jagielski | | Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net | | : Marcus Bointon (coolbru) coolbru@users.sourceforge.net | | : Jim Jagielski (jimjag) jimjag@gmail.com | | Founder: Brent R. Matzelle (original founder) | -| Copyright (c) 2010-2011, Jim Jagielski. All Rights Reserved. | +| Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved. | | Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. | | Copyright (c) 2001-2003, Brent R. Matzelle | | ------------------------------------------------------------------------- | @@ -29,22 +30,20 @@ * @author Andy Prevost * @author Marcus Bointon * @author Jim Jagielski - * @copyright 2010 - 2011 Jim Jagielski + * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) - * @version $Id: class.pop3.php 450 2010-06-23 16:46:33Z coolbru $ */ /** - * POP Before SMTP Authentication Class - * Version 5.2.0 + * PHP POP-Before-SMTP Authentication Class * - * Author: Richard Davey (rich@corephp.co.uk) - * Modifications: Andy Prevost - * License: LGPL, see PHPMailer License + * Version 5.2.6 + * + * @license: LGPL, see PHPMailer License * * Specifically for PHPMailer to allow POP before SMTP authentication. - * Does not yet work with APOP - if you have an APOP account, contact Richard Davey + * Does not yet work with APOP - if you have an APOP account, contact Jim Jagielski * and we can test changes to this script. * * This class is based on the structure of the SMTP class originally authored by Chris Ryan @@ -53,7 +52,9 @@ * required for POP3 connection, authentication and disconnection. * * @package PHPMailer - * @author Richard Davey + * @author Richard Davey (orig) <rich@corephp.co.uk> + * @author Andy Prevost + * @author Jim Jagielski */ class POP3 { @@ -115,14 +116,23 @@ class POP3 { * Sets the POP3 PHPMailer Version number * @var string */ - public $Version = '5.2'; + public $Version = '5.2.6'; ///////////////////////////////////////////////// // PROPERTIES, PRIVATE AND PROTECTED ///////////////////////////////////////////////// + /** + * @var resource Resource handle for the POP connection socket + */ private $pop_conn; + /** + * @var boolean Are we connected? + */ private $connected; + /** + * @var array Error container + */ private $error; // Error log array /** @@ -140,10 +150,12 @@ class POP3 { * Combination of public events - connect, login, disconnect * @access public * @param string $host - * @param integer $port - * @param integer $tval + * @param bool|int $port + * @param bool|int $tval * @param string $username * @param string $password + * @param int $debug_level + * @return bool */ public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) { $this->host = $host; @@ -193,7 +205,7 @@ class POP3 { * Connect to the POP3 server * @access public * @param string $host - * @param integer $port + * @param bool|int $port * @param integer $tval * @return boolean */ @@ -258,11 +270,11 @@ class POP3 { // Check for the +OK if ($this->checkResponse($pop3_response)) { - // The connection is established and the POP3 server is talking - $this->connected = true; + // The connection is established and the POP3 server is talking + $this->connected = true; return true; } - + return false; } /** @@ -303,12 +315,9 @@ class POP3 { if ($this->checkResponse($pop3_response)) { return true; - } else { - return false; } - } else { - return false; } + return false; } /** @@ -407,4 +416,3 @@ class POP3 { // End of class } -?> diff --git a/modules/phpmailer/class.smtp.php b/modules/phpmailer/class.smtp.php index 07c27593..8444eb89 100644 --- a/modules/phpmailer/class.smtp.php +++ b/modules/phpmailer/class.smtp.php @@ -2,15 +2,16 @@ /*~ class.smtp.php .---------------------------------------------------------------------------. | Software: PHPMailer - PHP email class | -| Version: 5.2 | -| Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ | +| Version: 5.2.6 | +| Site: https://github.com/PHPMailer/PHPMailer/ | | ------------------------------------------------------------------------- | -| Admin: Jim Jagielski (project admininistrator) | +| Admins: Marcus Bointon | +| Admins: Jim Jagielski | | Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net | -| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net | +| : Marcus Bointon (coolbru) phpmailer@synchromedia.co.uk | | : Jim Jagielski (jimjag) jimjag@gmail.com | | Founder: Brent R. Matzelle (original founder) | -| Copyright (c) 2010-2011, Jim Jagielski. All Rights Reserved. | +| Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved. | | Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. | | Copyright (c) 2001-2003, Brent R. Matzelle | | ------------------------------------------------------------------------- | @@ -30,17 +31,17 @@ * @author Marcus Bointon * @copyright 2004 - 2008 Andy Prevost * @author Jim Jagielski - * @copyright 2010 - 2011 Jim Jagielski + * @copyright 2010 - 2012 Jim Jagielski * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) - * @version $Id: class.smtp.php 450 2010-06-23 16:46:33Z coolbru $ */ /** - * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP - * commands except TURN which will always return a not implemented - * error. SMTP also provides some utility methods for sending mail - * to an SMTP server. - * original author: Chris Ryan + * PHP RFC821 SMTP client + * + * Implements all the RFC 821 SMTP commands except TURN which will always return a not implemented error. + * SMTP also provides some utility methods for sending mail to an SMTP server. + * @author Chris Ryan + * @package PHPMailer */ class SMTP { @@ -51,16 +52,23 @@ class SMTP { public $SMTP_PORT = 25; /** - * SMTP reply line ending + * SMTP reply line ending (don't change) * @var string */ public $CRLF = "\r\n"; /** - * Sets whether debugging is turned on - * @var bool + * Debug output level; 0 for no output + * @var int + */ + public $do_debug = 0; + + /** + * Sets the function/method to use for debugging output. + * Right now we only honor 'echo' or 'error_log' + * @var string */ - public $do_debug; // the level of debug to perform + public $Debugoutput = 'echo'; /** * Sets VERP use on/off (default is off) @@ -69,23 +77,56 @@ class SMTP { public $do_verp = false; /** + * Sets the SMTP timeout value for reads, in seconds + * @var int + */ + public $Timeout = 15; + + /** + * Sets the SMTP timelimit value for reads, in seconds + * @var int + */ + public $Timelimit = 30; + + /** * Sets the SMTP PHPMailer Version number * @var string */ - public $Version = '5.2'; + public $Version = '5.2.6'; ///////////////////////////////////////////////// // PROPERTIES, PRIVATE AND PROTECTED ///////////////////////////////////////////////// - private $smtp_conn; // the socket to the server - private $error; // error if any on the last call - private $helo_rply; // the reply the server sent to us for HELO + /** + * @var resource The socket to the server + */ + private $smtp_conn; + /** + * @var string Error message, if any, for the last call + */ + private $error; + /** + * @var string The reply the server sent to us for HELO + */ + private $helo_rply; + + /** + * Outputs debugging info via user-defined method + * @param string $str + */ + private function edebug($str) { + if ($this->Debugoutput == 'error_log') { + error_log($str); + } else { + echo $str; + } + } /** * Initialize the class so that the data is in a known state. * @access public - * @return void + * @return SMTP */ public function __construct() { $this->smtp_conn = 0; @@ -110,6 +151,9 @@ class SMTP { * SMTP CODE SUCCESS: 220 * SMTP CODE FAILURE: 421 * @access public + * @param string $host + * @param int $port + * @param int $tval * @return bool */ public function Connect($host, $port = 0, $tval = 30) { @@ -119,7 +163,7 @@ class SMTP { // make sure we are __not__ connected if($this->connected()) { // already connected, generate error - $this->error = array("error" => "Already connected to a server"); + $this->error = array('error' => 'Already connected to a server'); return false; } @@ -135,25 +179,30 @@ class SMTP { $tval); // give up after ? secs // verify we connected properly if(empty($this->smtp_conn)) { - $this->error = array("error" => "Failed to connect to server", - "errno" => $errno, - "errstr" => $errstr); + $this->error = array('error' => 'Failed to connect to server', + 'errno' => $errno, + 'errstr' => $errstr); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />'; + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ": $errstr ($errno)" . $this->CRLF . '<br />'); } return false; } // 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") - socket_set_timeout($this->smtp_conn, $tval, 0); + if(substr(PHP_OS, 0, 3) != 'WIN') { + $max = ini_get('max_execution_time'); + if ($max != 0 && $tval > $max) { // don't bother if unlimited + @set_time_limit($tval); + } + stream_set_timeout($this->smtp_conn, $tval, 0); + } // get any announcement $announce = $this->get_lines(); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />'; + $this->edebug('SMTP -> FROM SERVER:' . $announce . $this->CRLF . '<br />'); } return true; @@ -172,26 +221,26 @@ class SMTP { $this->error = null; # to avoid confusion if(!$this->connected()) { - $this->error = array("error" => "Called StartTLS() without being connected"); + $this->error = array('error' => 'Called StartTLS() without being connected'); return false; } - fputs($this->smtp_conn,"STARTTLS" . $this->CRLF); + $this->client_send('STARTTLS' . $this->CRLF); $rply = $this->get_lines(); - $code = substr($rply,0,3); + $code = substr($rply, 0, 3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> FROM SERVER:' . $rply . $this->CRLF . '<br />'); } if($code != 220) { $this->error = - array("error" => "STARTTLS not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); + array('error' => 'STARTTLS not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); } return false; } @@ -208,61 +257,238 @@ class SMTP { * Performs SMTP authentication. Must be run after running the * Hello() method. Returns true if successfully authenticated. * @access public + * @param string $username + * @param string $password + * @param string $authtype + * @param string $realm + * @param string $workstation * @return bool */ - public function Authenticate($username, $password) { - // Start authentication - fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); + public function Authenticate($username, $password, $authtype='LOGIN', $realm='', $workstation='') { + if (empty($authtype)) { + $authtype = 'LOGIN'; + } - $rply = $this->get_lines(); - $code = substr($rply,0,3); + switch ($authtype) { + case 'PLAIN': + // Start authentication + $this->client_send('AUTH PLAIN' . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply, 0, 3); + + if($code != 334) { + $this->error = + array('error' => 'AUTH not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); + if($this->do_debug >= 1) { + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); + } + return false; + } + // Send encoded username and password + $this->client_send(base64_encode("\0".$username."\0".$password) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply, 0, 3); + + if($code != 235) { + $this->error = + array('error' => 'Authentication not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); + if($this->do_debug >= 1) { + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); + } + return false; + } + break; + case 'LOGIN': + // Start authentication + $this->client_send('AUTH LOGIN' . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply, 0, 3); + + if($code != 334) { + $this->error = + array('error' => 'AUTH not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); + if($this->do_debug >= 1) { + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); + } + return false; + } - if($code != 334) { - $this->error = - array("error" => "AUTH not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; - } - return false; - } + // Send encoded username + $this->client_send(base64_encode($username) . $this->CRLF); - // Send encoded username - fputs($this->smtp_conn, base64_encode($username) . $this->CRLF); + $rply = $this->get_lines(); + $code = substr($rply, 0, 3); - $rply = $this->get_lines(); - $code = substr($rply,0,3); + if($code != 334) { + $this->error = + array('error' => 'Username not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); + if($this->do_debug >= 1) { + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); + } + return false; + } - if($code != 334) { - $this->error = - array("error" => "Username not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; - } - return false; + // Send encoded password + $this->client_send(base64_encode($password) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply, 0, 3); + + if($code != 235) { + $this->error = + array('error' => 'Password not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); + if($this->do_debug >= 1) { + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); + } + return false; + } + break; + case 'NTLM': + /* + * ntlm_sasl_client.php + ** Bundled with Permission + ** + ** How to telnet in windows: http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx + ** PROTOCOL Documentation http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication + */ + require_once 'extras/ntlm_sasl_client.php'; + $temp = new stdClass(); + $ntlm_client = new ntlm_sasl_client_class; + if(! $ntlm_client->Initialize($temp)){//let's test if every function its available + $this->error = array('error' => $temp->error); + if($this->do_debug >= 1) { + $this->edebug('You need to enable some modules in your php.ini file: ' . $this->error['error'] . $this->CRLF); + } + return false; + } + $msg1 = $ntlm_client->TypeMsg1($realm, $workstation);//msg1 + + $this->client_send('AUTH NTLM ' . base64_encode($msg1) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply, 0, 3); + + + if($code != 334) { + $this->error = + array('error' => 'AUTH not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); + if($this->do_debug >= 1) { + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF); + } + return false; + } + + $challenge = substr($rply, 3);//though 0 based, there is a white space after the 3 digit number....//msg2 + $challenge = base64_decode($challenge); + $ntlm_res = $ntlm_client->NTLMResponse(substr($challenge, 24, 8), $password); + $msg3 = $ntlm_client->TypeMsg3($ntlm_res, $username, $realm, $workstation);//msg3 + // Send encoded username + $this->client_send(base64_encode($msg3) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply, 0, 3); + + if($code != 235) { + $this->error = + array('error' => 'Could not authenticate', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); + if($this->do_debug >= 1) { + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF); + } + return false; + } + break; + case 'CRAM-MD5': + // Start authentication + $this->client_send('AUTH CRAM-MD5' . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply, 0, 3); + + if($code != 334) { + $this->error = + array('error' => 'AUTH not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); + if($this->do_debug >= 1) { + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); + } + return false; + } + + // Get the challenge + $challenge = base64_decode(substr($rply, 4)); + + // Build the response + $response = $username . ' ' . $this->hmac($challenge, $password); + + // Send encoded credentials + $this->client_send(base64_encode($response) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply, 0, 3); + + if($code != 334) { + $this->error = + array('error' => 'Credentials not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); + if($this->do_debug >= 1) { + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); + } + return false; + } + break; } + return true; + } - // Send encoded password - fputs($this->smtp_conn, base64_encode($password) . $this->CRLF); + /** + * Works like hash_hmac('md5', $data, $key) in case that function is not available + * @access private + * @param string $data + * @param string $key + * @return string + */ + private function hmac($data, $key) { + if (function_exists('hash_hmac')) { + return hash_hmac('md5', $data, $key); + } - $rply = $this->get_lines(); - $code = substr($rply,0,3); + // The following borrowed from http://php.net/manual/en/function.mhash.php#27225 - if($code != 235) { - $this->error = - array("error" => "Password not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; + // RFC 2104 HMAC implementation for php. + // Creates an md5 HMAC. + // Eliminates the need to install mhash to compute a HMAC + // Hacked by Lance Rushing + + $b = 64; // byte length for md5 + if (strlen($key) > $b) { + $key = pack('H*', md5($key)); } - return false; - } + $key = str_pad($key, $b, chr(0x00)); + $ipad = str_pad('', $b, chr(0x36)); + $opad = str_pad('', $b, chr(0x5c)); + $k_ipad = $key ^ $ipad ; + $k_opad = $key ^ $opad; - return true; + return md5($k_opad . pack('H*', md5($k_ipad . $data))); } /** @@ -272,11 +498,11 @@ class SMTP { */ public function Connected() { if(!empty($this->smtp_conn)) { - $sock_status = socket_get_status($this->smtp_conn); - if($sock_status["eof"]) { + $sock_status = stream_get_meta_data($this->smtp_conn); + if($sock_status['eof']) { // the socket is valid but we are not connected if($this->do_debug >= 1) { - echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected"; + $this->edebug('SMTP -> NOTICE:' . $this->CRLF . 'EOF caught while checking if connected'); } $this->Close(); return false; @@ -320,10 +546,11 @@ class SMTP { * [data] * <CRLF>.<CRLF> * SMTP CODE SUCCESS: 250 - * SMTP CODE FAILURE: 552,554,451,452 - * SMTP CODE FAILURE: 451,554 - * SMTP CODE ERROR : 500,501,503,421 + * SMTP CODE FAILURE: 552, 554, 451, 452 + * SMTP CODE FAILURE: 451, 554 + * SMTP CODE ERROR : 500, 501, 503, 421 * @access public + * @param string $msg_data * @return bool */ public function Data($msg_data) { @@ -331,26 +558,26 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Data() without being connected"); + 'error' => 'Called Data() without being connected'); return false; } - fputs($this->smtp_conn,"DATA" . $this->CRLF); + $this->client_send('DATA' . $this->CRLF); $rply = $this->get_lines(); - $code = substr($rply,0,3); + $code = substr($rply, 0, 3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> FROM SERVER:' . $rply . $this->CRLF . '<br />'); } if($code != 354) { $this->error = - array("error" => "DATA command not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); + array('error' => 'DATA command not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); } return false; } @@ -367,9 +594,9 @@ class SMTP { */ // normalize the line breaks so we know the explode works - $msg_data = str_replace("\r\n","\n",$msg_data); - $msg_data = str_replace("\r","\n",$msg_data); - $lines = explode("\n",$msg_data); + $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 is headers are * in the msg_data or if it is a straight msg body @@ -380,31 +607,31 @@ class SMTP { * headers. */ - $field = substr($lines[0],0,strpos($lines[0],":")); + $field = substr($lines[0], 0, strpos($lines[0], ':')); $in_headers = false; - if(!empty($field) && !strstr($field," ")) { + if(!empty($field) && !strstr($field, ' ')) { $in_headers = true; } $max_line_length = 998; // used below; set here for ease in change - while(list(,$line) = @each($lines)) { + while(list(, $line) = @each($lines)) { $lines_out = null; - if($line == "" && $in_headers) { + if($line == '' && $in_headers) { $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)," "); + $pos = strrpos(substr($line, 0, $max_line_length), ' '); // Patch to fix DOS attack if(!$pos) { $pos = $max_line_length - 1; - $lines_out[] = substr($line,0,$pos); - $line = substr($line,$pos); + $lines_out[] = substr($line, 0, $pos); + $line = substr($line, $pos); } else { - $lines_out[] = substr($line,0,$pos); - $line = substr($line,$pos + 1); + $lines_out[] = substr($line, 0, $pos); + $line = substr($line, $pos + 1); } /* if processing headers add a LWSP-char to the front of new line @@ -417,34 +644,34 @@ class SMTP { $lines_out[] = $line; // send the lines to the server - while(list(,$line_out) = @each($lines_out)) { + while(list(, $line_out) = @each($lines_out)) { if(strlen($line_out) > 0) { - if(substr($line_out, 0, 1) == ".") { - $line_out = "." . $line_out; + if(substr($line_out, 0, 1) == '.') { + $line_out = '.' . $line_out; } } - fputs($this->smtp_conn,$line_out . $this->CRLF); + $this->client_send($line_out . $this->CRLF); } } // message data has been sent - fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); + $this->client_send($this->CRLF . '.' . $this->CRLF); $rply = $this->get_lines(); - $code = substr($rply,0,3); + $code = substr($rply, 0, 3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> FROM SERVER:' . $rply . $this->CRLF . '<br />'); } if($code != 250) { $this->error = - array("error" => "DATA not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); + array('error' => 'DATA not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); } return false; } @@ -461,6 +688,7 @@ class SMTP { * SMTP CODE SUCCESS: 250 * SMTP CODE ERROR : 500, 501, 504, 421 * @access public + * @param string $host * @return bool */ public function Hello($host = '') { @@ -468,19 +696,19 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Hello() without being connected"); + 'error' => 'Called Hello() without being connected'); return false; } // if hostname for HELO was not specified send default if(empty($host)) { // determine appropriate default to send to server - $host = "localhost"; + $host = 'localhost'; } // Send extended hello first (RFC 2821) - if(!$this->SendHello("EHLO", $host)) { - if(!$this->SendHello("HELO", $host)) { + if(!$this->SendHello('EHLO', $host)) { + if(!$this->SendHello('HELO', $host)) { return false; } } @@ -491,25 +719,27 @@ class SMTP { /** * Sends a HELO/EHLO command. * @access private + * @param string $hello + * @param string $host * @return bool */ private function SendHello($hello, $host) { - fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); + $this->client_send($hello . ' ' . $host . $this->CRLF); $rply = $this->get_lines(); - $code = substr($rply,0,3); + $code = substr($rply, 0, 3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> FROM SERVER: ' . $rply . $this->CRLF . '<br />'); } if($code != 250) { $this->error = - array("error" => $hello . " not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); + array('error' => $hello . ' not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); } return false; } @@ -528,9 +758,10 @@ class SMTP { * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF> * * SMTP CODE SUCCESS: 250 - * SMTP CODE SUCCESS: 552,451,452 - * SMTP CODE SUCCESS: 500,501,421 + * SMTP CODE SUCCESS: 552, 451, 452 + * SMTP CODE SUCCESS: 500, 501, 421 * @access public + * @param string $from * @return bool */ public function Mail($from) { @@ -538,27 +769,27 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Mail() without being connected"); + 'error' => 'Called Mail() without being connected'); return false; } - $useVerp = ($this->do_verp ? "XVERP" : ""); - fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF); + $useVerp = ($this->do_verp ? ' XVERP' : ''); + $this->client_send('MAIL FROM:<' . $from . '>' . $useVerp . $this->CRLF); $rply = $this->get_lines(); - $code = substr($rply,0,3); + $code = substr($rply, 0, 3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> FROM SERVER:' . $rply . $this->CRLF . '<br />'); } if($code != 250) { $this->error = - array("error" => "MAIL not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); + array('error' => 'MAIL not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); } return false; } @@ -574,6 +805,7 @@ class SMTP { * SMTP CODE SUCCESS: 221 * SMTP CODE ERROR : 500 * @access public + * @param bool $close_on_error * @return bool */ public function Quit($close_on_error = true) { @@ -581,32 +813,32 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Quit() without being connected"); + 'error' => 'Called Quit() without being connected'); return false; } // send the quit command to the server - fputs($this->smtp_conn,"quit" . $this->CRLF); + $this->client_send('quit' . $this->CRLF); // get any good-bye messages $byemsg = $this->get_lines(); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />'; + $this->edebug('SMTP -> FROM SERVER:' . $byemsg . $this->CRLF . '<br />'); } $rval = true; $e = null; - $code = substr($byemsg,0,3); + $code = substr($byemsg, 0, 3); if($code != 221) { // use e as a tmp var cause Close will overwrite $this->error - $e = array("error" => "SMTP server rejected quit command", - "smtp_code" => $code, - "smtp_rply" => substr($byemsg,4)); + $e = array('error' => 'SMTP server rejected quit command', + 'smtp_code' => $code, + 'smtp_rply' => substr($byemsg, 4)); $rval = false; if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />'; + $this->edebug('SMTP -> ERROR: ' . $e['error'] . ': ' . $byemsg . $this->CRLF . '<br />'); } } @@ -623,10 +855,11 @@ class SMTP { * * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF> * - * SMTP CODE SUCCESS: 250,251 - * SMTP CODE FAILURE: 550,551,552,553,450,451,452 - * SMTP CODE ERROR : 500,501,503,421 + * SMTP CODE SUCCESS: 250, 251 + * SMTP CODE FAILURE: 550, 551, 552, 553, 450, 451, 452 + * SMTP CODE ERROR : 500, 501, 503, 421 * @access public + * @param string $to * @return bool */ public function Recipient($to) { @@ -634,26 +867,26 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Recipient() without being connected"); + 'error' => 'Called Recipient() without being connected'); return false; } - fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); + $this->client_send('RCPT TO:<' . $to . '>' . $this->CRLF); $rply = $this->get_lines(); - $code = substr($rply,0,3); + $code = substr($rply, 0, 3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> FROM SERVER:' . $rply . $this->CRLF . '<br />'); } if($code != 250 && $code != 251) { $this->error = - array("error" => "RCPT not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); + array('error' => 'RCPT not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); } return false; } @@ -668,7 +901,7 @@ class SMTP { * Implements rfc 821: RSET <CRLF> * * SMTP CODE SUCCESS: 250 - * SMTP CODE ERROR : 500,501,504,421 + * SMTP CODE ERROR : 500, 501, 504, 421 * @access public * @return bool */ @@ -676,27 +909,26 @@ class SMTP { $this->error = null; // so no confusion is caused if(!$this->connected()) { - $this->error = array( - "error" => "Called Reset() without being connected"); + $this->error = array('error' => 'Called Reset() without being connected'); return false; } - fputs($this->smtp_conn,"RSET" . $this->CRLF); + $this->client_send('RSET' . $this->CRLF); $rply = $this->get_lines(); - $code = substr($rply,0,3); + $code = substr($rply, 0, 3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> FROM SERVER:' . $rply . $this->CRLF . '<br />'); } if($code != 250) { $this->error = - array("error" => "RSET failed", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); + array('error' => 'RSET failed', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); } return false; } @@ -715,9 +947,10 @@ class SMTP { * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF> * * SMTP CODE SUCCESS: 250 - * SMTP CODE SUCCESS: 552,451,452 - * SMTP CODE SUCCESS: 500,501,502,421 + * SMTP CODE SUCCESS: 552, 451, 452 + * SMTP CODE SUCCESS: 500, 501, 502, 421 * @access public + * @param string $from * @return bool */ public function SendAndMail($from) { @@ -725,26 +958,26 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called SendAndMail() without being connected"); + 'error' => 'Called SendAndMail() without being connected'); return false; } - fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF); + $this->client_send('SAML FROM:' . $from . $this->CRLF); $rply = $this->get_lines(); - $code = substr($rply,0,3); + $code = substr($rply, 0, 3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> FROM SERVER:' . $rply . $this->CRLF . '<br />'); } if($code != 250) { $this->error = - array("error" => "SAML not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); + array('error' => 'SAML not accepted from server', + 'smtp_code' => $code, + 'smtp_msg' => substr($rply, 4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'; + $this->edebug('SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />'); } return false; } @@ -765,15 +998,28 @@ class SMTP { * @return bool */ public function Turn() { - $this->error = array("error" => "This method, TURN, of the SMTP ". - "is not implemented"); + $this->error = array('error' => 'This method, TURN, of the SMTP '. + 'is not implemented'); if($this->do_debug >= 1) { - echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />'; + $this->edebug('SMTP -> NOTICE: ' . $this->error['error'] . $this->CRLF . '<br />'); } return false; } /** + * Sends data to the server + * @param string $data + * @access public + * @return Integer 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->CRLF . '<br />'); + } + return fwrite($this->smtp_conn, $data); + } + + /** * Get the current error * @access public * @return array @@ -796,22 +1042,47 @@ class SMTP { * @return string */ private function get_lines() { - $data = ""; - while($str = @fgets($this->smtp_conn,515)) { + $data = ''; + $endtime = 0; + /* If for some reason the fp is bad, don't inf loop */ + if (!is_resource($this->smtp_conn)) { + return $data; + } + stream_set_timeout($this->smtp_conn, $this->Timeout); + if ($this->Timelimit > 0) { + $endtime = time() + $this->Timelimit; + } + while(is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { + $str = @fgets($this->smtp_conn, 515); if($this->do_debug >= 4) { - echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />'; - echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />'; + $this->edebug("SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />'); + $this->edebug("SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />'); } $data .= $str; if($this->do_debug >= 4) { - echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />'; + $this->edebug("SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />'); } // if 4th character is a space, we are done reading, break the loop - if(substr($str,3,1) == " ") { break; } + if(substr($str, 3, 1) == ' ') { break; } + // Timed-out? Log and break + $info = stream_get_meta_data($this->smtp_conn); + if ($info['timed_out']) { + if($this->do_debug >= 4) { + $this->edebug('SMTP -> get_lines(): timed-out (' . $this->Timeout . ' seconds) <br />'); + } + 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 . ' seconds) <br />'); + } + break; + } + } } return $data; } } - -?> diff --git a/modules/phpmailer/composer.json b/modules/phpmailer/composer.json new file mode 100644 index 00000000..fb772097 --- /dev/null +++ b/modules/phpmailer/composer.json @@ -0,0 +1,32 @@ +{ + "name": "phpmailer/phpmailer", + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "authors": [ + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "require": { + "php": ">=5.0.0" + }, + "require-dev": { + "phpdocumentor/phpdocumentor": "*", + "phpunit/phpunit": "*" + }, + "autoload": { + "classmap": ["class.phpmailer.php", "class.pop3.php", "class.smtp.php"] + }, + "license": "LGPL-2.1" +}
\ No newline at end of file diff --git a/modules/phpmailer/docs/generatedocs.sh b/modules/phpmailer/docs/generatedocs.sh new file mode 100755 index 00000000..e4d690bf --- /dev/null +++ b/modules/phpmailer/docs/generatedocs.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# Regenerate PHPMailer documentation +rm -rf phpdocs/* +phpdoc --directory .. --target ./phpdoc --ignore test/,examples/,extras/,test_script/ --sourcecode --force --title PHPMailer diff --git a/modules/phpmailer/docs/use_gmail.txt b/modules/phpmailer/docs/use_gmail.txt index 7519d7d2..2be1dffb 100644 --- a/modules/phpmailer/docs/use_gmail.txt +++ b/modules/phpmailer/docs/use_gmail.txt @@ -7,8 +7,7 @@ include("class.smtp.php"); // note, this is optional - gets called from main cla $mail = new PHPMailer(); -$body = $mail->getFile('contents.html'); -$body = eregi_replace("[\]",'',$body); +$body = file_get_contents('contents.html'); $mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication diff --git a/modules/phpmailer/extras/class.html2text.php b/modules/phpmailer/extras/class.html2text.php new file mode 100644 index 00000000..4dcd5acc --- /dev/null +++ b/modules/phpmailer/extras/class.html2text.php @@ -0,0 +1,696 @@ +<?php +/************************************************************************* + * * + * Converts HTML to formatted plain text * + * * + * Portions Copyright (c) 2005-2007 Jon Abernathy <jon@chuggnutt.com> * + * This version from https://github.com/mtibben/html2text * + * * + * This script is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * The GNU General Public License can be found at * + * http://www.gnu.org/copyleft/gpl.html. * + * * + * This script is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + *************************************************************************/ + + +class html2text +{ + + /** + * Contains the HTML content to convert. + * + * @var string $html + * @access public + */ + public $html; + + /** + * Contains the converted, formatted text. + * + * @var string $text + * @access public + */ + public $text; + + /** + * Maximum width of the formatted text, in columns. + * + * Set this value to 0 (or less) to ignore word wrapping + * and not constrain text to a fixed-width column. + * + * @var integer $width + * @access public + */ + public $width = 70; + + /** + * List of preg* regular expression patterns to search for, + * used in conjunction with $replace. + * + * @var array $search + * @access public + * @see $replace + */ + public $search = array( + "/\r/", // Non-legal carriage return + "/[\n\t]+/", // Newlines and tabs + '/<head[^>]*>.*?<\/head>/i', // <head> + '/<script[^>]*>.*?<\/script>/i', // <script>s -- which strip_tags supposedly has problems with + '/<style[^>]*>.*?<\/style>/i', // <style>s -- which strip_tags supposedly has problems with + '/<p[^>]*>/i', // <P> + '/<br[^>]*>/i', // <br> + '/<i[^>]*>(.*?)<\/i>/i', // <i> + '/<em[^>]*>(.*?)<\/em>/i', // <em> + '/(<ul[^>]*>|<\/ul>)/i', // <ul> and </ul> + '/(<ol[^>]*>|<\/ol>)/i', // <ol> and </ol> + '/<li[^>]*>(.*?)<\/li>/i', // <li> and </li> + '/<li[^>]*>/i', // <li> + '/<hr[^>]*>/i', // <hr> + '/<div[^>]*>/i', // <div> + '/(<table[^>]*>|<\/table>)/i', // <table> and </table> + '/(<tr[^>]*>|<\/tr>)/i', // <tr> and </tr> + '/<td[^>]*>(.*?)<\/td>/i', // <td> and </td> + '/<span class="_html2text_ignore">.+?<\/span>/i' // <span class="_html2text_ignore">...</span> + ); + + /** + * List of pattern replacements corresponding to patterns searched. + * + * @var array $replace + * @access public + * @see $search + */ + public $replace = array( + '', // Non-legal carriage return + ' ', // Newlines and tabs + '', // <head> + '', // <script>s -- which strip_tags supposedly has problems with + '', // <style>s -- which strip_tags supposedly has problems with + "\n\n", // <P> + "\n", // <br> + '_\\1_', // <i> + '_\\1_', // <em> + "\n\n", // <ul> and </ul> + "\n\n", // <ol> and </ol> + "\t* \\1\n", // <li> and </li> + "\n\t* ", // <li> + "\n-------------------------\n", // <hr> + "<div>\n", // <div> + "\n\n", // <table> and </table> + "\n", // <tr> and </tr> + "\t\t\\1\n", // <td> and </td> + "" // <span class="_html2text_ignore">...</span> + ); + + /** + * List of preg* regular expression patterns to search for, + * used in conjunction with $ent_replace. + * + * @var array $ent_search + * @access public + * @see $ent_replace + */ + public $ent_search = array( + '/&(nbsp|#160);/i', // Non-breaking space + '/&(quot|rdquo|ldquo|#8220|#8221|#147|#148);/i', + // Double quotes + '/&(apos|rsquo|lsquo|#8216|#8217);/i', // Single quotes + '/>/i', // Greater-than + '/</i', // Less-than + '/&(copy|#169);/i', // Copyright + '/&(trade|#8482|#153);/i', // Trademark + '/&(reg|#174);/i', // Registered + '/&(mdash|#151|#8212);/i', // mdash + '/&(ndash|minus|#8211|#8722);/i', // ndash + '/&(bull|#149|#8226);/i', // Bullet + '/&(pound|#163);/i', // Pound sign + '/&(euro|#8364);/i', // Euro sign + '/&(amp|#38);/i', // Ampersand: see _converter() + '/[ ]{2,}/', // Runs of spaces, post-handling + ); + + /** + * List of pattern replacements corresponding to patterns searched. + * + * @var array $ent_replace + * @access public + * @see $ent_search + */ + public $ent_replace = array( + ' ', // Non-breaking space + '"', // Double quotes + "'", // Single quotes + '>', + '<', + '(c)', + '(tm)', + '(R)', + '--', + '-', + '*', + '£', + 'EUR', // Euro sign. € ? + '|+|amp|+|', // Ampersand: see _converter() + ' ', // Runs of spaces, post-handling + ); + + /** + * List of preg* regular expression patterns to search for + * and replace using callback function. + * + * @var array $callback_search + * @access public + */ + public $callback_search = array( + '/<(a) [^>]*href=("|\')([^"\']+)\2([^>]*)>(.*?)<\/a>/i', // <a href=""> + '/<(h)[123456]( [^>]*)?>(.*?)<\/h[123456]>/i', // h1 - h6 + '/<(b)( [^>]*)?>(.*?)<\/b>/i', // <b> + '/<(strong)( [^>]*)?>(.*?)<\/strong>/i', // <strong> + '/<(th)( [^>]*)?>(.*?)<\/th>/i', // <th> and </th> + ); + + /** + * List of preg* regular expression patterns to search for in PRE body, + * used in conjunction with $pre_replace. + * + * @var array $pre_search + * @access public + * @see $pre_replace + */ + public $pre_search = array( + "/\n/", + "/\t/", + '/ /', + '/<pre[^>]*>/', + '/<\/pre>/' + ); + + /** + * List of pattern replacements corresponding to patterns searched for PRE body. + * + * @var array $pre_replace + * @access public + * @see $pre_search + */ + public $pre_replace = array( + '<br>', + ' ', + ' ', + '', + '' + ); + + /** + * Contains a list of HTML tags to allow in the resulting text. + * + * @var string $allowed_tags + * @access public + * @see set_allowed_tags() + */ + public $allowed_tags = ''; + + /** + * Contains the base URL that relative links should resolve to. + * + * @var string $url + * @access public + */ + public $url; + + /** + * Indicates whether content in the $html variable has been converted yet. + * + * @var boolean $_converted + * @access private + * @see $html, $text + */ + private $_converted = false; + + /** + * Contains URL addresses from links to be rendered in plain text. + * + * @var array $_link_list + * @access private + * @see _build_link_list() + */ + private $_link_list = array(); + + + /** + * Various configuration options (able to be set in the constructor) + * + * @var array $_options + * @access private + */ + private $_options = array( + + // 'none' + // 'inline' (show links inline) + // 'nextline' (show links on the next line) + // 'table' (if a table of link URLs should be listed after the text. + 'do_links' => 'inline', + + // Maximum width of the formatted text, in columns. + // Set this value to 0 (or less) to ignore word wrapping + // and not constrain text to a fixed-width column. + 'width' => 70, + ); + + + /** + * Constructor. + * + * If the HTML source string (or file) is supplied, the class + * will instantiate with that source propagated, all that has + * to be done it to call get_text(). + * + * @param string $source HTML content + * @param boolean $from_file Indicates $source is a file to pull content from + * @param array $options Set configuration options + * @access public + * @return void + */ + public function __construct( $source = '', $from_file = false, $options = array() ) + { + $this->_options = array_merge($this->_options, $options); + + if ( !empty($source) ) { + $this->set_html($source, $from_file); + } + + $this->set_base_url(); + } + + /** + * Loads source HTML into memory, either from $source string or a file. + * + * @param string $source HTML content + * @param boolean $from_file Indicates $source is a file to pull content from + * @access public + * @return void + */ + public function set_html( $source, $from_file = false ) + { + if ( $from_file && file_exists($source) ) { + $this->html = file_get_contents($source); + } + else + $this->html = $source; + + $this->_converted = false; + } + + /** + * Returns the text, converted from HTML. + * + * @access public + * @return string + */ + public function get_text() + { + if ( !$this->_converted ) { + $this->_convert(); + } + + return $this->text; + } + + /** + * Prints the text, converted from HTML. + * + * @access public + * @return void + */ + public function print_text() + { + print $this->get_text(); + } + + /** + * Alias to print_text(), operates identically. + * + * @access public + * @return void + * @see print_text() + */ + public function p() + { + print $this->get_text(); + } + + /** + * Sets the allowed HTML tags to pass through to the resulting text. + * + * Tags should be in the form "<p>", with no corresponding closing tag. + * + * @access public + * @return void + */ + public function set_allowed_tags( $allowed_tags = '' ) + { + if ( !empty($allowed_tags) ) { + $this->allowed_tags = $allowed_tags; + } + } + + /** + * Sets a base URL to handle relative links. + * + * @access public + * @return void + */ + public function set_base_url( $url = '' ) + { + if ( empty($url) ) { + if ( !empty($_SERVER['HTTP_HOST']) ) { + $this->url = 'http://' . $_SERVER['HTTP_HOST']; + } else { + $this->url = ''; + } + } else { + // Strip any trailing slashes for consistency (relative + // URLs may already start with a slash like "/file.html") + if ( substr($url, -1) == '/' ) { + $url = substr($url, 0, -1); + } + $this->url = $url; + } + } + + /** + * Workhorse function that does actual conversion (calls _converter() method). + * + * @access private + * @return void + */ + private function _convert() + { + // Variables used for building the link list + $this->_link_list = array(); + + $text = trim(stripslashes($this->html)); + + // Convert HTML to TXT + $this->_converter($text); + + // Add link list + if (!empty($this->_link_list)) { + $text .= "\n\nLinks:\n------\n"; + foreach ($this->_link_list as $idx => $url) { + $text .= '[' . ($idx+1) . '] ' . $url . "\n"; + } + } + + $this->text = $text; + + $this->_converted = true; + } + + /** + * Workhorse function that does actual conversion. + * + * First performs custom tag replacement specified by $search and + * $replace arrays. Then strips any remaining HTML tags, reduces whitespace + * and newlines to a readable format, and word wraps the text to + * $this->_options['width'] characters. + * + * @param string Reference to HTML content string + * + * @access private + * @return void + */ + private function _converter(&$text) + { + // Convert <BLOCKQUOTE> (before PRE!) + $this->_convert_blockquotes($text); + + // Convert <PRE> + $this->_convert_pre($text); + + // Run our defined tags search-and-replace + $text = preg_replace($this->search, $this->replace, $text); + + // Run our defined tags search-and-replace with callback + $text = preg_replace_callback($this->callback_search, array($this, '_preg_callback'), $text); + + // Strip any other HTML tags + $text = strip_tags($text, $this->allowed_tags); + + // Run our defined entities/characters search-and-replace + $text = preg_replace($this->ent_search, $this->ent_replace, $text); + + // Replace known html entities + $text = html_entity_decode($text, ENT_QUOTES); + + // Remove unknown/unhandled entities (this cannot be done in search-and-replace block) + $text = preg_replace('/&([a-zA-Z0-9]{2,6}|#[0-9]{2,4});/', '', $text); + + // Convert "|+|amp|+|" into "&", need to be done after handling of unknown entities + // This properly handles situation of "&quot;" in input string + $text = str_replace('|+|amp|+|', '&', $text); + + // Bring down number of empty lines to 2 max + $text = preg_replace("/\n\s+\n/", "\n\n", $text); + $text = preg_replace("/[\n]{3,}/", "\n\n", $text); + + // remove leading empty lines (can be produced by eg. P tag on the beginning) + $text = ltrim($text, "\n"); + + // Wrap the text to a readable format + // for PHP versions >= 4.0.2. Default width is 75 + // If width is 0 or less, don't wrap the text. + if ( $this->_options['width'] > 0 ) { + $text = wordwrap($text, $this->_options['width']); + } + } + + /** + * Helper function called by preg_replace() on link replacement. + * + * Maintains an internal list of links to be displayed at the end of the + * text, with numeric indices to the original point in the text they + * appeared. Also makes an effort at identifying and handling absolute + * and relative links. + * + * @param string $link URL of the link + * @param string $display Part of the text to associate number with + * @access private + * @return string + */ + private function _build_link_list( $link, $display, $link_override = null) + { + $link_method = ($link_override) ? $link_override : $this->_options['do_links']; + if ($link_method == 'none') + return $display; + + + // Ignored link types + if (preg_match('!^(javascript:|mailto:|#)!i', $link)) { + return $display; + } + if (preg_match('!^([a-z][a-z0-9.+-]+:)!i', $link)) { + $url = $link; + } + else { + $url = $this->url; + if (substr($link, 0, 1) != '/') { + $url .= '/'; + } + $url .= "$link"; + } + + if ($link_method == 'table') + { + if (($index = array_search($url, $this->_link_list)) === false) { + $index = count($this->_link_list); + $this->_link_list[] = $url; + } + + return $display . ' [' . ($index+1) . ']'; + } + elseif ($link_method == 'nextline') + { + return $display . "\n[" . $url . ']'; + } + else // link_method defaults to inline + { + return $display . ' [' . $url . ']'; + } + } + + /** + * Helper function for PRE body conversion. + * + * @param string HTML content + * @access private + */ + private function _convert_pre(&$text) + { + // get the content of PRE element + while (preg_match('/<pre[^>]*>(.*)<\/pre>/ismU', $text, $matches)) { + $this->pre_content = $matches[1]; + + // Run our defined tags search-and-replace with callback + $this->pre_content = preg_replace_callback($this->callback_search, + array($this, '_preg_callback'), $this->pre_content); + + // convert the content + $this->pre_content = sprintf('<div><br>%s<br></div>', + preg_replace($this->pre_search, $this->pre_replace, $this->pre_content)); + // replace the content (use callback because content can contain $0 variable) + $text = preg_replace_callback('/<pre[^>]*>.*<\/pre>/ismU', + array($this, '_preg_pre_callback'), $text, 1); + + // free memory + $this->pre_content = ''; + } + } + + /** + * Helper function for BLOCKQUOTE body conversion. + * + * @param string HTML content + * @access private + */ + private function _convert_blockquotes(&$text) + { + if (preg_match_all('/<\/*blockquote[^>]*>/i', $text, $matches, PREG_OFFSET_CAPTURE)) { + $level = 0; + $diff = 0; + $start = 0; + $taglen = 0; + foreach ($matches[0] as $m) { + if ($m[0][0] == '<' && $m[0][1] == '/') { + $level--; + if ($level < 0) { + $level = 0; // malformed HTML: go to next blockquote + } + else if ($level > 0) { + // skip inner blockquote + } + else { + $end = $m[1]; + $len = $end - $taglen - $start; + // Get blockquote content + $body = substr($text, $start + $taglen - $diff, $len); + + // Set text width + $p_width = $this->_options['width']; + if ($this->_options['width'] > 0) $this->_options['width'] -= 2; + // Convert blockquote content + $body = trim($body); + $this->_converter($body); + // Add citation markers and create PRE block + $body = preg_replace('/((^|\n)>*)/', '\\1> ', trim($body)); + $body = '<pre>' . htmlspecialchars($body) . '</pre>'; + // Re-set text width + $this->_options['width'] = $p_width; + // Replace content + $text = substr($text, 0, $start - $diff) + . $body . substr($text, $end + strlen($m[0]) - $diff); + + $diff = $len + $taglen + strlen($m[0]) - strlen($body); + unset($body); + } + } + else { + if ($level == 0) { + $start = $m[1]; + $taglen = strlen($m[0]); + } + $level ++; + } + } + } + } + + /** + * Callback function for preg_replace_callback use. + * + * @param array PREG matches + * @return string + */ + private function _preg_callback($matches) + { + switch (strtolower($matches[1])) { + case 'b': + case 'strong': + return $this->_toupper($matches[3]); + case 'th': + return $this->_toupper("\t\t". $matches[3] ."\n"); + case 'h': + return $this->_toupper("\n\n". $matches[3] ."\n\n"); + case 'a': + // override the link method + $link_override = null; + if (preg_match("/_html2text_link_(\w+)/", $matches[4], $link_override_match)) + { + $link_override = $link_override_match[1]; + } + // Remove spaces in URL (#1487805) + $url = str_replace(' ', '', $matches[3]); + return $this->_build_link_list($url, $matches[5], $link_override); + } + } + + /** + * Callback function for preg_replace_callback use in PRE content handler. + * + * @param array PREG matches + * @return string + */ + private function _preg_pre_callback($matches) + { + return $this->pre_content; + } + + /** + * Strtoupper function with HTML tags and entities handling. + * + * @param string $str Text to convert + * @return string Converted text + */ + private function _toupper($str) + { + // string can containg HTML tags + $chunks = preg_split('/(<[^>]*>)/', $str, null, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); + + // convert toupper only the text between HTML tags + foreach ($chunks as $idx => $chunk) { + if ($chunk[0] != '<') { + $chunks[$idx] = $this->_strtoupper($chunk); + } + } + + return implode($chunks); + } + + /** + * Strtoupper multibyte wrapper function with HTML entities handling. + * + * @param string $str Text to convert + * @return string Converted text + */ + private function _strtoupper($str) + { + $str = html_entity_decode($str, ENT_COMPAT); + + if (function_exists('mb_strtoupper')) + $str = mb_strtoupper($str); + else + $str = strtoupper($str); + + $str = htmlspecialchars($str, ENT_COMPAT); + + return $str; + } +}
\ No newline at end of file diff --git a/modules/phpmailer/extras/ntlm_sasl_client.php b/modules/phpmailer/extras/ntlm_sasl_client.php new file mode 100644 index 00000000..b21ccce0 --- /dev/null +++ b/modules/phpmailer/extras/ntlm_sasl_client.php @@ -0,0 +1,185 @@ +<?php +/* + * ntlm_sasl_client.php + * + * @(#) $Id: ntlm_sasl_client.php,v 1.3 2004/11/17 08:00:37 mlemos Exp $ + * + ** + ** Source: http://www.phpclasses.org/browse/file/7495.html + ** License: BSD (http://www.phpclasses.org/package/1888-PHP-Single-API-for-standard-authentication-mechanisms.html) + ** Bundled with Permission + ** + */ + +define("SASL_NTLM_STATE_START", 0); +define("SASL_NTLM_STATE_IDENTIFY_DOMAIN", 1); +define("SASL_NTLM_STATE_RESPOND_CHALLENGE", 2); +define("SASL_NTLM_STATE_DONE", 3); + +class ntlm_sasl_client_class +{ + var $credentials=array(); + var $state=SASL_NTLM_STATE_START; + + Function Initialize(&$client) + { + if(!function_exists($function="mcrypt_encrypt") + || !function_exists($function="mhash")) + { + $extensions=array( + "mcrypt_encrypt"=>"mcrypt", + "mhash"=>"mhash" + ); + $client->error="the extension ".$extensions[$function]." required by the NTLM SASL client class is not available in this PHP configuration"; + return(0); + } + return(1); + } + + Function ASCIIToUnicode($ascii) + { + for($unicode="",$a=0;$a<strlen($ascii);$a++) + $unicode.=substr($ascii,$a,1).chr(0); + return($unicode); + } + + Function TypeMsg1($domain,$workstation) + { + $domain_length=strlen($domain); + $workstation_length=strlen($workstation); + $workstation_offset=32; + $domain_offset=$workstation_offset+$workstation_length; + return( + "NTLMSSP\0". + "\x01\x00\x00\x00". + "\x07\x32\x00\x00". + pack("v",$domain_length). + pack("v",$domain_length). + pack("V",$domain_offset). + pack("v",$workstation_length). + pack("v",$workstation_length). + pack("V",$workstation_offset). + $workstation. + $domain + ); + } + + Function NTLMResponse($challenge,$password) + { + $unicode=$this->ASCIIToUnicode($password); + $md4=mhash(MHASH_MD4,$unicode); + $padded=$md4.str_repeat(chr(0),21-strlen($md4)); + $iv_size=mcrypt_get_iv_size(MCRYPT_DES,MCRYPT_MODE_ECB); + $iv=mcrypt_create_iv($iv_size,MCRYPT_RAND); + for($response="",$third=0;$third<21;$third+=7) + { + for($packed="",$p=$third;$p<$third+7;$p++) + $packed.=str_pad(decbin(ord(substr($padded,$p,1))),8,"0",STR_PAD_LEFT); + for($key="",$p=0;$p<strlen($packed);$p+=7) + { + $s=substr($packed,$p,7); + $b=$s.((substr_count($s,"1") % 2) ? "0" : "1"); + $key.=chr(bindec($b)); + } + $ciphertext=mcrypt_encrypt(MCRYPT_DES,$key,$challenge,MCRYPT_MODE_ECB,$iv); + $response.=$ciphertext; + } + return $response; + } + + Function TypeMsg3($ntlm_response,$user,$domain,$workstation) + { + $domain_unicode=$this->ASCIIToUnicode($domain); + $domain_length=strlen($domain_unicode); + $domain_offset=64; + $user_unicode=$this->ASCIIToUnicode($user); + $user_length=strlen($user_unicode); + $user_offset=$domain_offset+$domain_length; + $workstation_unicode=$this->ASCIIToUnicode($workstation); + $workstation_length=strlen($workstation_unicode); + $workstation_offset=$user_offset+$user_length; + $lm=""; + $lm_length=strlen($lm); + $lm_offset=$workstation_offset+$workstation_length; + $ntlm=$ntlm_response; + $ntlm_length=strlen($ntlm); + $ntlm_offset=$lm_offset+$lm_length; + $session=""; + $session_length=strlen($session); + $session_offset=$ntlm_offset+$ntlm_length; + return( + "NTLMSSP\0". + "\x03\x00\x00\x00". + pack("v",$lm_length). + pack("v",$lm_length). + pack("V",$lm_offset). + pack("v",$ntlm_length). + pack("v",$ntlm_length). + pack("V",$ntlm_offset). + pack("v",$domain_length). + pack("v",$domain_length). + pack("V",$domain_offset). + pack("v",$user_length). + pack("v",$user_length). + pack("V",$user_offset). + pack("v",$workstation_length). + pack("v",$workstation_length). + pack("V",$workstation_offset). + pack("v",$session_length). + pack("v",$session_length). + pack("V",$session_offset). + "\x01\x02\x00\x00". + $domain_unicode. + $user_unicode. + $workstation_unicode. + $lm. + $ntlm + ); + } + + Function Start(&$client, &$message, &$interactions) + { + if($this->state!=SASL_NTLM_STATE_START) + { + $client->error="NTLM authentication state is not at the start"; + return(SASL_FAIL); + } + $this->credentials=array( + "user"=>"", + "password"=>"", + "realm"=>"", + "workstation"=>"" + ); + $defaults=array(); + $status=$client->GetCredentials($this->credentials,$defaults,$interactions); + if($status==SASL_CONTINUE) + $this->state=SASL_NTLM_STATE_IDENTIFY_DOMAIN; + Unset($message); + return($status); + } + + Function Step(&$client, $response, &$message, &$interactions) + { + switch($this->state) + { + case SASL_NTLM_STATE_IDENTIFY_DOMAIN: + $message=$this->TypeMsg1($this->credentials["realm"],$this->credentials["workstation"]); + $this->state=SASL_NTLM_STATE_RESPOND_CHALLENGE; + break; + case SASL_NTLM_STATE_RESPOND_CHALLENGE: + $ntlm_response=$this->NTLMResponse(substr($response,24,8),$this->credentials["password"]); + $message=$this->TypeMsg3($ntlm_response,$this->credentials["user"],$this->credentials["realm"],$this->credentials["workstation"]); + $this->state=SASL_NTLM_STATE_DONE; + break; + case SASL_NTLM_STATE_DONE: + $client->error="NTLM authentication was finished without success"; + return(SASL_FAIL); + default: + $client->error="invalid NTLM authentication step state"; + return(SASL_FAIL); + } + return(SASL_CONTINUE); + } +}; + +?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-ar.php b/modules/phpmailer/language/phpmailer.lang-ar.php index b7c5057d..67364e96 100644 --- a/modules/phpmailer/language/phpmailer.lang-ar.php +++ b/modules/phpmailer/language/phpmailer.lang-ar.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = 'لم نستطع الوصول للمل $PHPMAILER_LANG['file_open'] = 'File Error: لم نستطع فتح الملف: '; $PHPMAILER_LANG['from_failed'] = 'البريد التالي لم نستطع ارسال البريد له : '; $PHPMAILER_LANG['instantiate'] = 'لم نستطع توفير خدمة البريد.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.'; //$PHPMAILER_LANG['provide_address'] = 'You must provide at least one recipient email address.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: الأخطاء التالية ' . @@ -24,4 +24,3 @@ $PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-br.php b/modules/phpmailer/language/phpmailer.lang-br.php index 6afe60b1..87ecbdfa 100644 --- a/modules/phpmailer/language/phpmailer.lang-br.php +++ b/modules/phpmailer/language/phpmailer.lang-br.php @@ -3,24 +3,24 @@ * PHPMailer language file: refer to English translation for definitive list * Portuguese Version * By Paulo Henrique Garcia - paulo@controllerweb.com.br +* Edited by Lucas Guimarães - lucas@lucasguimaraes.com */ $PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; $PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar com o servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados não aceitos.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; +$PHPMAILER_LANG['empty_message'] = 'Corpo da mensagem vazio'; $PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; $PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; $PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; $PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; -$PHPMAILER_LANG['from_failed'] = 'Os endereços de rementente a seguir falharam: '; -$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não suportado.'; -$PHPMAILER_LANG['provide_address'] = 'Você deve fornecer pelo menos um endereço de destinatário de email.'; +$PHPMAILER_LANG['from_failed'] = 'Os endereços dos remententes a seguir falharam: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Não enviando, endereço de e-mail inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Você deve fornecer pelo menos um endereço de destinatário de e-mail.'; $PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os endereços de destinatário a seguir falharam: '; -//$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: '; -?>
\ No newline at end of file +$PHPMAILER_LANG['signing'] = 'Erro ao assinar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou resetar a variável: '; diff --git a/modules/phpmailer/language/phpmailer.lang-ca.php b/modules/phpmailer/language/phpmailer.lang-ca.php index 4a160a21..dc563e77 100644 --- a/modules/phpmailer/language/phpmailer.lang-ca.php +++ b/modules/phpmailer/language/phpmailer.lang-ca.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = 'No es pot accedir a l\'arxiu: '; $PHPMAILER_LANG['file_open'] = 'Error d\'Arxiu: No es pot obrir l\'arxiu: '; $PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: '; $PHPMAILER_LANG['instantiate'] = 'No s\'ha pogut crear una instància de la funció Mail.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat'; $PHPMAILER_LANG['provide_address'] = 'S\'ha de proveir almenys una adreça d\'email com a destinatari.'; $PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: '; @@ -23,4 +23,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinatari //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-ch.php b/modules/phpmailer/language/phpmailer.lang-ch.php index 31ebd861..d28eba61 100644 --- a/modules/phpmailer/language/phpmailer.lang-ch.php +++ b/modules/phpmailer/language/phpmailer.lang-ch.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = '不能访问文件:'; $PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:'; $PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: '; $PHPMAILER_LANG['instantiate'] = '不能实现mail方法。'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。'; $PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: '; @@ -23,4 +23,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败 //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-cz.php b/modules/phpmailer/language/phpmailer.lang-cz.php index 1c8b2063..b1f0a51c 100644 --- a/modules/phpmailer/language/phpmailer.lang-cz.php +++ b/modules/phpmailer/language/phpmailer.lang-cz.php @@ -14,7 +14,7 @@ $PHPMAILER_LANG['file_access'] = 'Soubor nenalezen: '; $PHPMAILER_LANG['file_open'] = 'File Error: Nelze otevøít soubor pro ètení: '; $PHPMAILER_LANG['from_failed'] = 'Následující adresa From je nesprávná: '; $PHPMAILER_LANG['instantiate'] = 'Nelze vytvoøit instanci emailové funkce.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailový klient není podporován.'; $PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoò jednu emailovou adresu pøíjemce.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy pøíjemcù nejsou správné '; @@ -22,4 +22,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy pøíjemcù nejsou //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-de.php b/modules/phpmailer/language/phpmailer.lang-de.php index b2a76ce1..ba17a92a 100644 --- a/modules/phpmailer/language/phpmailer.lang-de.php +++ b/modules/phpmailer/language/phpmailer.lang-de.php @@ -14,7 +14,7 @@ $PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschl $PHPMAILER_LANG['file_open'] = 'Datei Fehler: konnte folgende Datei nicht öffnen: '; $PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: '; $PHPMAILER_LANG['instantiate'] = 'Mail Funktion konnte nicht initialisiert werden.'; -$PHPMAILER_LANG['invalid_email'] = 'E-Mail wird nicht gesendet, die Adresse ist ungültig.'; +$PHPMAILER_LANG['invalid_address'] = 'E-Mail wird nicht gesendet, die Adresse ist ungültig.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.'; $PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfänger E-Mailadresse an.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: '; @@ -22,4 +22,3 @@ $PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zu SMTP Server fehlgeschlagen.'; $PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP Server: '; $PHPMAILER_LANG['variable_set'] = 'Kann Variable nicht setzen oder zurücksetzen: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-dk.php b/modules/phpmailer/language/phpmailer.lang-dk.php index b2625731..fdb0b17b 100644 --- a/modules/phpmailer/language/phpmailer.lang-dk.php +++ b/modules/phpmailer/language/phpmailer.lang-dk.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: '; $PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; $PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; $PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; $PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; @@ -23,4 +23,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er for //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-eo.php b/modules/phpmailer/language/phpmailer.lang-eo.php new file mode 100644 index 00000000..3465c458 --- /dev/null +++ b/modules/phpmailer/language/phpmailer.lang-eo.php @@ -0,0 +1,23 @@ +<?php +/** +* PHPMailer language file: refer to English translation for definitive list +* Esperanto version +*/ + +$PHPMAILER_LANG['authenticate'] = 'Eraro de servilo SMTP : aŭtentigo malsukcesis.'; +$PHPMAILER_LANG['connect_host'] = 'Eraro de servilo SMTP : konektado al servilo malsukcesis.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Eraro de servilo SMTP : neĝustaj datumoj.'; +$PHPMAILER_LANG['empty_message'] = 'Teksto de mesaĝo mankas.'; +$PHPMAILER_LANG['encoding'] = 'Nekonata kodoprezento: '; +$PHPMAILER_LANG['execute'] = 'Lanĉi rulumadon ne eblis: '; +$PHPMAILER_LANG['file_access'] = 'Aliro al dosiero ne sukcesis: '; +$PHPMAILER_LANG['file_open'] = 'Eraro de dosiero: malfermo neeblas: '; +$PHPMAILER_LANG['from_failed'] = 'Jena adreso de sendinto malsukcesis: '; +$PHPMAILER_LANG['instantiate'] = 'Genero de retmesaĝa funkcio neeblis.'; +$PHPMAILER_LANG['invalid_address'] = 'Retadreso ne validas: '; +$PHPMAILER_LANG['provide_address'] = 'Vi devas tajpi almenaŭ unu recevontan retadreson.'; +$PHPMAILER_LANG['recipients_failed'] = 'Eraro de servilo SMTP : la jenaj poŝtrecivuloj kaŭzis eraron: '; +$PHPMAILER_LANG['signing'] = 'Eraro de subskribo: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP konektado malsukcesis.'; +$PHPMAILER_LANG['smtp_error'] = 'Eraro de servilo SMTP : '; +$PHPMAILER_LANG['variable_set'] = 'Variablo ne pravalorizeblas aŭ ne repravalorizeblas: '; diff --git a/modules/phpmailer/language/phpmailer.lang-es.php b/modules/phpmailer/language/phpmailer.lang-es.php index 69b68174..b81520f2 100644 --- a/modules/phpmailer/language/phpmailer.lang-es.php +++ b/modules/phpmailer/language/phpmailer.lang-es.php @@ -3,24 +3,24 @@ * PHPMailer language file: refer to English translation for definitive list * Spanish version * Versión en español +* Edited by Matt Sturdy - matt.sturdy@gmail.com */ $PHPMAILER_LANG['authenticate'] = 'Error SMTP: No se pudo autentificar.'; -$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No puedo conectar al servidor SMTP.'; +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No se pudo conectar al servidor SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['empty_message'] = 'Cuerpo del mensaje vacío'; $PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; -$PHPMAILER_LANG['execute'] = 'No puedo ejecutar: '; -$PHPMAILER_LANG['file_access'] = 'No puedo acceder al archivo: '; -$PHPMAILER_LANG['file_open'] = 'Error de Archivo: No puede abrir el archivo: '; +$PHPMAILER_LANG['execute'] = 'No se pudo ejecutar: '; +$PHPMAILER_LANG['file_access'] = 'No se pudo acceder al archivo: '; +$PHPMAILER_LANG['file_open'] = 'Error de Archivo: No se pudo abrir el archivo: '; $PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; -$PHPMAILER_LANG['instantiate'] = 'No pude crear una instancia de la función Mail.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['instantiate'] = 'No se pudo crear una instancia de la función Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'No se pudo enviar: dirección de email inválido: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; -$PHPMAILER_LANG['provide_address'] = 'Debe proveer al menos una dirección de email como destinatario.'; -$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinatarios fallaron: '; +$PHPMAILER_LANG['provide_address'] = 'Debe proveer al menos una dirección de email como destino.'; +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; $PHPMAILER_LANG['signing'] = 'Error al firmar: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() se falló.'; +$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'No se pudo ajustar o reajustar la variable: '; diff --git a/modules/phpmailer/language/phpmailer.lang-et.php b/modules/phpmailer/language/phpmailer.lang-et.php index cf61779b..eee4e58e 100644 --- a/modules/phpmailer/language/phpmailer.lang-et.php +++ b/modules/phpmailer/language/phpmailer.lang-et.php @@ -3,24 +3,24 @@ * PHPMailer language file: refer to English translation for definitive list * Estonian Version * By Indrek Päri +* Revised By Elan Ruusamäe <glen@delfi.ee> */ $PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.'; $PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Tundmatu Unknown kodeering: '; +$PHPMAILER_LANG['empty_message'] = 'Tühi kirja sisu'; +$PHPMAILER_LANG["encoding"] = 'Tundmatu kodeering: '; $PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: '; $PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: '; $PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: '; $PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: '; $PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: '; $PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.'; $PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: '; -//$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: '; -?>
\ No newline at end of file +$PHPMAILER_LANG["signing"] = 'Viga allkirjastamisel: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() ebaõnnestus.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri viga: '; +$PHPMAILER_LANG['variable_set'] = 'Ei õnnestunud määrata või lähtestada muutujat: '; diff --git a/modules/phpmailer/language/phpmailer.lang-fi.php b/modules/phpmailer/language/phpmailer.lang-fi.php index 12a845aa..16a02e13 100644 --- a/modules/phpmailer/language/phpmailer.lang-fi.php +++ b/modules/phpmailer/language/phpmailer.lang-fi.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = 'Seuraavaan tiedostoon ei ole oikeuksi $PHPMAILER_LANG['file_open'] = 'Tiedostovirhe: Ei voida avata tiedostoa: '; $PHPMAILER_LANG['from_failed'] = 'Seuraava lähettäjän osoite on virheellinen: '; $PHPMAILER_LANG['instantiate'] = 'mail-funktion luonti epäonnistui.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.'; $PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähköpostiosoite.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.'; @@ -24,4 +24,3 @@ $PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-fo.php b/modules/phpmailer/language/phpmailer.lang-fo.php index 6bd9b0a2..fc5d6d56 100644 --- a/modules/phpmailer/language/phpmailer.lang-fo.php +++ b/modules/phpmailer/language/phpmailer.lang-fo.php @@ -16,7 +16,7 @@ $PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: '; $PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: '; $PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: '; $PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.'; $PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: '; @@ -24,4 +24,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar mi //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-fr.php b/modules/phpmailer/language/phpmailer.lang-fr.php index c99ac3ca..98707e30 100644 --- a/modules/phpmailer/language/phpmailer.lang-fr.php +++ b/modules/phpmailer/language/phpmailer.lang-fr.php @@ -4,22 +4,21 @@ * French Version */ -$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : Echec 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 incorrects.'; +$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['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 Fichier : ouverture impossible : '; -$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échouée : '; +$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['instantiate'] = 'Impossible d\'instancier la fonction mail.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide : '; $PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.'; $PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : Les destinataires suivants sont en erreur : '; -//$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: '; -?>
\ No newline at end of file +$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants sont en erreur : '; +$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 : '; diff --git a/modules/phpmailer/language/phpmailer.lang-he.php b/modules/phpmailer/language/phpmailer.lang-he.php new file mode 100644 index 00000000..e30b596d --- /dev/null +++ b/modules/phpmailer/language/phpmailer.lang-he.php @@ -0,0 +1,25 @@ +<?php +/** +* PHPMailer language file: refer to English translation for definitive list +* Hebrew Version, UTF-8 +* by : Ronny Sherer <ronny@hoojima.com> +*/ + +$PHPMAILER_LANG['authenticate'] = 'שגיאת SMTP: פעולת האימות נכשלה.'; +$PHPMAILER_LANG['connect_host'] = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'שגיאת SMTP: מידע לא התקבל.'; +$PHPMAILER_LANG['empty_message'] = 'גוף ההודעה ריק'; +$PHPMAILER_LANG['invalid_address'] = 'כתובת שגויה'; +$PHPMAILER_LANG['encoding'] = 'קידוד לא מוכר: '; +$PHPMAILER_LANG['execute'] = 'לא הצלחתי להפעיל את: '; +$PHPMAILER_LANG['file_access'] = 'לא ניתן לגשת לקובץ: '; +$PHPMAILER_LANG['file_open'] = 'שגיאת קובץ: לא ניתן לגשת לקובץ: '; +$PHPMAILER_LANG['from_failed'] = 'כתובות הנמענים הבאות נכשלו: '; +$PHPMAILER_LANG['instantiate'] = 'לא הצלחתי להפעיל את פונקציית המייל.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.'; +$PHPMAILER_LANG['provide_address'] = 'חובה לספק לפחות כתובת אחת של מקבל המייל.'; +$PHPMAILER_LANG['recipients_failed'] = 'שגיאת SMTP: הנמענים הבאים נכשלו: '; +$PHPMAILER_LANG['signing'] = 'שגיאת חתימה: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +$PHPMAILER_LANG['smtp_error'] = 'שגיאת שרת SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'לא ניתן לקבוע או לשנות את המשתנה: '; diff --git a/modules/phpmailer/language/phpmailer.lang-hu.php b/modules/phpmailer/language/phpmailer.lang-hu.php index caca0b50..68339e95 100644 --- a/modules/phpmailer/language/phpmailer.lang-hu.php +++ b/modules/phpmailer/language/phpmailer.lang-hu.php @@ -14,7 +14,7 @@ $PHPMAILER_LANG['file_access'] = 'Nem sikerült elérni a következõ f $PHPMAILER_LANG['file_open'] = 'Fájl Hiba: Nem sikerült megnyitni a következõ fájlt: '; $PHPMAILER_LANG['from_failed'] = 'Az alábbi Feladó cím hibás: '; $PHPMAILER_LANG['instantiate'] = 'Nem sikerült példányosítani a mail funkciót.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = 'Meg kell adnod legalább egy címzett email címet.'; $PHPMAILER_LANG['mailer_not_supported'] = ' levelezõ nem támogatott.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Hiba: Az alábbi címzettek hibásak: '; @@ -22,4 +22,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'SMTP Hiba: Az alábbi címzettek hib //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-it.php b/modules/phpmailer/language/phpmailer.lang-it.php index fc1fcb8d..27ab0ead 100644 --- a/modules/phpmailer/language/phpmailer.lang-it.php +++ b/modules/phpmailer/language/phpmailer.lang-it.php @@ -3,25 +3,24 @@ * PHPMailer language file: refer to English translation for definitive list * Italian version * @package PHPMailer -* @author Ilias Bartolini <brain79@inwind.it> +* @author Ilias Bartolini <brain79@inwind.it>, Stefano Sabatini <sabas88@gmail.com> */ $PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; $PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal server.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: '; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dati non accettati dal server.'; +$PHPMAILER_LANG['empty_message'] = 'Il corpo del messaggio è vuoto'; +$PHPMAILER_LANG['encoding'] = 'Codifica dei caratteri sconosciuta: '; $PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; $PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; $PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; $PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; $PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: '; $PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; $PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato errore: '; -//$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: '; -?>
\ No newline at end of file +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: '; +$PHPMAILER_LANG['signing'] = 'Errore nella firma: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallita.'; +$PHPMAILER_LANG['smtp_error'] = 'Errore del server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Impossibile impostare o resettare la variabile: '; diff --git a/modules/phpmailer/language/phpmailer.lang-ja.php b/modules/phpmailer/language/phpmailer.lang-ja.php index 63cfb23b..ca6de909 100644 --- a/modules/phpmailer/language/phpmailer.lang-ja.php +++ b/modules/phpmailer/language/phpmailer.lang-ja.php @@ -3,6 +3,7 @@ * PHPMailer language file: refer to English translation for definitive list * Japanese Version * By Mitsuhiro Yoshida - http://mitstek.com/ +* Modified by Yoshi Sakai - http://bluemooninc.jp/ */ $PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; @@ -13,9 +14,9 @@ $PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; $PHPMAILER_LANG['execute'] = '実行できませんでした: '; $PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; $PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; -$PHPMAILER_LANG['from_failed'] = '次のFromアドレスに間違いがあります: '; +$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; $PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; $PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; @@ -23,4 +24,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレ //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-nl.php b/modules/phpmailer/language/phpmailer.lang-nl.php index d2c380b0..c86d7699 100644 --- a/modules/phpmailer/language/phpmailer.lang-nl.php +++ b/modules/phpmailer/language/phpmailer.lang-nl.php @@ -1,25 +1,24 @@ <?php /** -* PHPMailer language file: refer to English translation for definitive list -* Dutch Version +* PHPMailer language file: refer to class.phpmailer.php for definitive list. +* Dutch Version by Tuxion <team@tuxion.nl> */ -$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'] = 'Message body empty'; -$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'] = 'De volgende afzender adressen zijn mislukt: '; -$PHPMAILER_LANG['instantiate'] = 'Kon mail functie niet initialiseren.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; -$PHPMAILER_LANG['provide_address'] = 'Er moet tenmiste één ontvanger emailadres opgegeven worden.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Fout: De volgende ontvangers zijn mislukt: '; -//$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: '; -?>
\ No newline at end of file +$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['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: diff --git a/modules/phpmailer/language/phpmailer.lang-no.php b/modules/phpmailer/language/phpmailer.lang-no.php index 65cb8843..37384fc1 100644 --- a/modules/phpmailer/language/phpmailer.lang-no.php +++ b/modules/phpmailer/language/phpmailer.lang-no.php @@ -14,7 +14,7 @@ $PHPMAILER_LANG['file_access'] = 'Kunne ikke få tilgang til filen: '; $PHPMAILER_LANG['file_open'] = 'Fil feil: Kunne ikke åpne filen: '; $PHPMAILER_LANG['from_failed'] = 'Følgende Fra feilet: '; $PHPMAILER_LANG['instantiate'] = 'Kunne ikke instantiate mail funksjonen.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = 'Du må ha med minst en mottager adresse.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer er ikke supportert.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottagere feilet: '; @@ -22,4 +22,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottagere feilet //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-pl.php b/modules/phpmailer/language/phpmailer.lang-pl.php index f4fd801d..6b17f2a6 100644 --- a/modules/phpmailer/language/phpmailer.lang-pl.php +++ b/modules/phpmailer/language/phpmailer.lang-pl.php @@ -14,7 +14,7 @@ $PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: '; $PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: '; $PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest jest nieprawidłowy: '; $PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $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: '; @@ -22,4 +22,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-ro.php b/modules/phpmailer/language/phpmailer.lang-ro.php index f6aa9225..1727cef0 100644 --- a/modules/phpmailer/language/phpmailer.lang-ro.php +++ b/modules/phpmailer/language/phpmailer.lang-ro.php @@ -16,7 +16,7 @@ $PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: '; $PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: '; $PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: '; $PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; $PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).'; $PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: '; @@ -24,4 +24,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de ma //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-ru.php b/modules/phpmailer/language/phpmailer.lang-ru.php index d6990525..9e583dae 100644 --- a/modules/phpmailer/language/phpmailer.lang-ru.php +++ b/modules/phpmailer/language/phpmailer.lang-ru.php @@ -7,19 +7,18 @@ $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['encoding'] = 'Неизвестный вид кодировки: '; $PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; $PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; $PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: '; $PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; $PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.'; $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: '; -?>
\ No newline at end of file +$PHPMAILER_LANG['empty_message'] = 'Пустое тело сообщения'; +$PHPMAILER_LANG['invalid_address'] = 'Не отослано, неправильный формат email адреса: '; +$PHPMAILER_LANG['signing'] = 'Ошибка подписывания: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером'; +$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или переустановить переменную: '; diff --git a/modules/phpmailer/language/phpmailer.lang-se.php b/modules/phpmailer/language/phpmailer.lang-se.php index 67e05f59..65d19799 100644 --- a/modules/phpmailer/language/phpmailer.lang-se.php +++ b/modules/phpmailer/language/phpmailer.lang-se.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; $PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; $PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; $PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; @@ -23,4 +23,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är fel //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-sk.php b/modules/phpmailer/language/phpmailer.lang-sk.php new file mode 100644 index 00000000..1722a5f5 --- /dev/null +++ b/modules/phpmailer/language/phpmailer.lang-sk.php @@ -0,0 +1,25 @@ +<?php +/** +* PHPMailer language file: refer to English translation for definitive list +* Slovak Version +* Author: Michal Tinka <michaltinka@gmail.com> +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dáta neboli prijaté'; +$PHPMAILER_LANG['empty_message'] = 'Prázdne telo správy.'; +$PHPMAILER_LANG['encoding'] = 'Neznáme kódovanie: '; +$PHPMAILER_LANG['execute'] = 'Nedá sa vykonať: '; +$PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre čítanie: '; +$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; +$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.'; +$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; +$PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; +$PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: '; +$PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviť alebo resetovať premennú: '; diff --git a/modules/phpmailer/language/phpmailer.lang-tr.php b/modules/phpmailer/language/phpmailer.lang-tr.php index d24627a4..abba0818 100644 --- a/modules/phpmailer/language/phpmailer.lang-tr.php +++ b/modules/phpmailer/language/phpmailer.lang-tr.php @@ -6,22 +6,21 @@ * ÝZYAZILIM - Elçin Özel - Can Yýlmaz - Mehmet Benlioðlu */ -$PHPMAILER_LANG['authenticate'] = 'SMTP Hatasý: Doðrulanamýyor.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Hatasý: SMTP hosta baðlanýlamýyor.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatasý: Veri kabul edilmedi.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$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 yaratýlamadý.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; -$PHPMAILER_LANG['provide_address'] = 'En az bir tane mail adresi belirtmek zorundasýnýz alýcýnýn email adresi.'; +$PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Doğrulanamıyor.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP hosta bağlanılamıyor.'; +$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['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: '; -?>
\ No newline at end of file +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: alıcılara ulaımadı: '; +$PHPMAILER_LANG['signing'] = 'İmzalama hatası: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP bağlantı() başarısız.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP sunucu hatası: '; +$PHPMAILER_LANG['variable_set'] = 'Ayarlanamıyor yada sıfırlanamıyor: '; diff --git a/modules/phpmailer/language/phpmailer.lang-zh.php b/modules/phpmailer/language/phpmailer.lang-zh.php index fef66f8c..b0e8f4e0 100644 --- a/modules/phpmailer/language/phpmailer.lang-zh.php +++ b/modules/phpmailer/language/phpmailer.lang-zh.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:'; $PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; $PHPMAILER_LANG['execute'] = '無法執行:'; $PHPMAILER_LANG['instantiate'] = '未知函數調用。'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; $PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:'; @@ -23,4 +23,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:'; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file diff --git a/modules/phpmailer/language/phpmailer.lang-zh_cn.php b/modules/phpmailer/language/phpmailer.lang-zh_cn.php index b1884043..78eb9acf 100644 --- a/modules/phpmailer/language/phpmailer.lang-zh_cn.php +++ b/modules/phpmailer/language/phpmailer.lang-zh_cn.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = '无法访问文件:'; $PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; $PHPMAILER_LANG['from_failed'] = '发送地址错误:'; $PHPMAILER_LANG['instantiate'] = '未知函数调用。'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; $PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; @@ -23,4 +23,3 @@ $PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?>
\ No newline at end of file |