Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

Commit

Permalink
1.6
Browse files Browse the repository at this point in the history
Last Multimailer version. PHPMailer 5.2.14
  • Loading branch information
Bizley committed Dec 7, 2015
1 parent aee3fc7 commit 810b24d
Show file tree
Hide file tree
Showing 130 changed files with 4,926 additions and 364 deletions.
24 changes: 5 additions & 19 deletions MultiMailer/MultiMailer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @author Paweł Bizley Brzozowski
* @version 1.5
* @version 1.6
* @license BSD 2-Clause License
* @see LICENSE file
*
Expand All @@ -16,7 +16,7 @@
* http://www.yiiframework.com
* https://github.com/yiisoft/yii
*
* MultiMailer 1.5 uses PHPMailer version 5.2.10
* MultiMailer 1.6 uses PHPMailer version 5.2.14
* https://github.com/PHPMailer/PHPMailer
* PHPMailer is distributed under the LGPL 2.1 license.
*
Expand Down Expand Up @@ -438,7 +438,6 @@ protected function _dbColumn($name, $value = true)
protected function _initDB()
{
if (!empty($this->setDbModel) && is_string($this->setDbModel)) {

foreach ($this->_defaultColumns as $key => $value) {
if (!isset($this->setDbModelColumns[$key])) {
$this->setDbModelColumns[$key] = $value;
Expand Down Expand Up @@ -686,18 +685,13 @@ protected function _processBody()
protected function _saveModel()
{
foreach ($this->_addresses as $address) {

try {
$this->_model = new $this->setDbModel;

if ($this->_model) {

foreach ($this->setDbModelColumns as $key => $value) {

if ($key != self::KEY_OTHERS) {

if (!is_null($value) || $value !== false) {

switch ($key) {
case self::COLUMN_EMAIL:
$emailProperty = $address['email'];
Expand Down Expand Up @@ -784,6 +778,7 @@ public function altbody($altbody)
/**
* Adds an attachment from a path on the filesystem for initialised object.
* Returns false if the file could not be found or read.
* THIS METHOD CANNOT BE CHAINED WITH OTHERS.
* @param string $path path to the attachment.
* @param string $name overrides the attachment name.
* @param string $encoding file encoding (options: "8bit", "7bit", "binary",
Expand All @@ -797,16 +792,13 @@ public function altbody($altbody)
public function attachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
{
if ($this->_initState) {

try {
return $this->getPhpmailer()->addAttachment($path, $name, $encoding, $type, $disposition);
}
catch (phpmailerException $e) {

$this->setMultiError($e->errorMessage());
}
catch (Exception $e) {

$this->setMultiError($e->getMessage());
}
}
Expand All @@ -818,6 +810,7 @@ public function attachment($path, $name = '', $encoding = 'base64', $type = '',
* Adds the list of attachments from a path on the filesystem for
* initialised object.
* Returns false if one of the files could not be found or read.
* THIS METHOD CANNOT BE CHAINED WITH OTHERS.
* @param array $attachments arrays of files data
* @see attachment()
* @see PHPMailer::addAttachment()
Expand All @@ -827,7 +820,6 @@ public function attachment($path, $name = '', $encoding = 'base64', $type = '',
public function attachments($attachments)
{
if ($this->_initState) {

try {
foreach ($attachments as $attachment) {
if (!$this->getPhpmailer()->addAttachment(
Expand All @@ -841,15 +833,12 @@ public function attachments($attachments)
return false;
}
}

return true;
}
catch (phpmailerException $e) {

$this->setMultiError($e->errorMessage());
}
catch (Exception $e) {

$this->setMultiError($e->getMessage());
}
}
Expand Down Expand Up @@ -1108,7 +1097,6 @@ public function replyto($address, $name = '', $skipInit = false)
public function send()
{
if ($this->_initState) {

try {
$this->_processBody();

Expand All @@ -1122,11 +1110,9 @@ public function send()
return true;
}
catch (phpmailerException $e) {

$this->setMultiError($e->errorMessage());
}
catch (Exception $e) {

$this->setMultiError($e->getMessage());
}
}
Expand Down Expand Up @@ -1347,4 +1333,4 @@ public function tos($addresses)

return $this;
}
}
}
1 change: 0 additions & 1 deletion MultiMailer/PHPMailer-5.2.10/VERSION

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ test/testbootstrap.php
test/*.pem
.idea
build/
vendor/
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ php:

matrix:
allow_failures:
- php: 7.0
- php: hhvm

before_install:
Expand All @@ -25,9 +24,7 @@ before_script:
- sudo mkdir -p /var/qmail/bin
- sudo cp fakesendmail.sh /var/qmail/bin/sendmail
- sudo cp fakesendmail.sh /usr/sbin/sendmail
- echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' | sudo tee "/home/travis/.phpenv/versions/`php -r 'echo PHP_VERSION;'`/etc/conf.d/sendmail.ini"
- pwd
- ls -al
- echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' > $(php --ini|grep -m 1 "ini files in:"|cut -d ":" -f 2)/sendmail.ini
script:
- phpunit --configuration ../travis.phpunit.xml.dist
after_script:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](h
## Class Features

- Probably the world's most popular code for sending email from PHP!
- Used by many open-source projects: Wordpress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more
- Used by many open-source projects: WordPress, Drupal, 1CRM, 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 UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
- SMTP authentication with LOGIN, PLAIN, NTLM and CRAM-MD5 mechanisms over SSL and TLS transports
- SMTP authentication with LOGIN, PLAIN, NTLM, CRAM-MD5 and Google's XOAUTH2 mechanisms over SSL and TLS transports
- Error messages in 47 languages!
- DKIM and S/MIME signing support
- Compatible with PHP 5.0 and later
Expand All @@ -33,24 +33,36 @@ The PHP mail() function usually sends via a local mail server, typically fronted

## 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
This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license. Please read LICENSE for information on the
software availability and distribution.

## Installation & loading

PHPMailer is available via [Composer/Packagist](https://packagist.org/packages/phpmailer/phpmailer), so just add this line to your `composer.json` file:
PHPMailer is available via [Composer/Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), so just add this line to your `composer.json` file:

"phpmailer/phpmailer": "~5.2"
```json
"phpmailer/phpmailer": "~5.2"
```

or

```sh
composer require phpmailer/phpmailer
```

Alternatively, 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.
If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package.

Alternatively, copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration.. If you don't speak git or just want a tarball, click the 'zip' button at the top of the page in GitHub.

If you're not using composer's autoloader, PHPMailer provides an SPL-compatible autoloader, and that is the preferred way of loading the library - just `require '/path/to/PHPMailerAutoload.php';` and everything should work. The autoloader does not throw errors if it can't find classes so it prepends itself to the SPL list, allowing your own (or your framework's) autoloader to catch errors. SPL autoloading was introduced in PHP 5.1.0, so if you are using a version older than that you will need to require/include each class manually.

PHPMailer does *not* declare a namespace because namespaces were only introduced in PHP 5.3.

If you want to use Google's XOAUTH2 authentication mechanism, you need to be running at least PHP 5.4, and load the dependencies listed in `composer.json`.

### Minimal installation

While installing the entire package manually or with composer is simple, convenient and reliable, you may want to include only vital files in your project. At the very least you will need [class.phpmailer.php](class.phpmailer.php). If you're using SMTP, you'll need [class.smtp.php](class.smtp.php), and if you're using POP-before SMTP, you'll need [class.pop3.php](class.pop3.php). For all of these, we recommend you use [the autoloader](PHPMailerAutoload.php) too as otherwise you will either have to `require` all classes manually or use some other autoloader. You can skip the [language](language/) folder if you're not showing errors to users and can make do with English-only errors. You may need the additional classes in the [extras](extras/) folder if you are using those features, including NTLM authentication and ics generation.
While installing the entire package manually or with composer is simple, convenient and reliable, you may want to include only vital files in your project. At the very least you will need [class.phpmailer.php](class.phpmailer.php). If you're using SMTP, you'll need [class.smtp.php](class.smtp.php), and if you're using POP-before SMTP, you'll need [class.pop3.php](class.pop3.php). For all of these, we recommend you use [the autoloader](PHPMailerAutoload.php) too as otherwise you will either have to `require` all classes manually or use some other autoloader. You can skip the [language](language/) folder if you're not showing errors to users and can make do with English-only errors. You may need the additional classes in the [extras](extras/) folder if you are using those features, including NTLM authentication and ics generation. If you're using Google XOAUTH2 you will need `class.phpmaileroauth.php` and `class.oauth.php` classes too, as well as the composer dependencies.

## A Simple Example

Expand All @@ -70,8 +82,7 @@ $mail->Password = 'secret'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to

$mail->From = 'from@example.com';
$mail->FromName = 'Mailer';
$mail->setFrom('from@example.com', 'Mailer');
$mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient
$mail->addAddress('ellen@example.com'); // Name is optional
$mail->addReplyTo('info@example.com', 'Information');
Expand Down Expand Up @@ -136,7 +147,9 @@ We're particularly interested in fixing edge-cases, expanding test coverage and

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`
```sh
git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git
```

Please *don't* use the SourceForge or Google Code projects any more.

Expand Down
1 change: 1 addition & 0 deletions MultiMailer/PHPMailer/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.2.14
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# ChangeLog

## Version 5.2.14 (Nov 1st 2015)
* Allow addresses with IDN (Internationalized Domain Name) in PHP 5.3+, thanks to @fbonzon
* Allow access to POP3 errors
* Make all POP3 private properties and methods protected
* **SECURITY** Fix vulnerability that allowed email addresses with line breaks (valid in RFC5322) to pass to SMTP, permitting message injection at the SMTP level. Mitigated in both the address validator and in the lower-level SMTP class. Thanks to Takeshi Terada.
* Updated Brazilian Portuguese translations (Thanks to @phelipealves)

## Version 5.2.13 (Sep 14th 2015)
* Rename internal oauth class to avoid name clashes
* Improve Estonian translations

## Version 5.2.12 (Sep 1st 2015)
* Fix incorrect composer package dependencies
* Skip existing embedded image `cid`s in `msgHTML`

## Version 5.2.11 (Aug 31st 2015)
* Don't switch to quoted-printable for long lines if already using base64
* Fixed Travis-CI config when run on PHP 7
* Added Google XOAUTH2 authentication mechanism, thanks to @sherryl4george
* Add address parser for RFC822-format addresses
* Update MS Office MIME types
* Don't convert line breaks when using quoted-printable encoding
* Handle MS Exchange returning an invalid empty AUTH-type list in EHLO
* Don't set name or filename properties on MIME parts that don't have one

## Version 5.2.10 (May 4th 2015)
* Add custom header getter
* Use `application/javascript` for .js attachments
Expand Down
Loading

0 comments on commit 810b24d

Please sign in to comment.