Compare commits

...

1790 Commits

Author SHA1 Message Date
Marcus Bointon ebf1655bd5
7.0.2 2026-01-09 19:02:33 +01:00
Marcus Bointon b938991866
Merge pull request #3283 from SirLouen/patch/3282
Fixing troubles with mailSend and Sender enabled
2026-01-09 17:34:10 +00:00
Marcus Bointon 7e3f24386f
Merge pull request #3288 from RobinvanderVliet/patch-1
Improve memory usage when sending large attachments
2025-12-22 14:31:02 +00:00
Robin van der Vliet 1a0004b51b
Improve memory usage when sending large attachments 2025-12-22 15:08:17 +01:00
Marcus Bointon a969e57c06
Merge pull request #3287 from PHPMailer/dependabot/github_actions/actions/upload-artifact-6.0.0
GH Actions: Bump actions/upload-artifact from 5.0.0 to 6.0.0
2025-12-20 23:09:19 +00:00
Marcus Bointon 28caa24930
Merge pull request #3286 from PHPMailer/dependabot/github_actions/action-runners-197cbf0a63
GH Actions: Bump the action-runners group with 3 updates
2025-12-20 23:08:37 +00:00
dependabot[bot] 5f710689e5
GH Actions: Bump actions/upload-artifact from 5.0.0 to 6.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](330a01c490...b7c566a772)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-20 22:26:48 +00:00
dependabot[bot] 827e170f50
GH Actions: Bump the action-runners group with 3 updates
Bumps the action-runners group with 3 updates: [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action), [github/codeql-action](https://github.com/github/codeql-action) and [codecov/codecov-action](https://github.com/codecov/codecov-action).


Updates `JamesIves/github-pages-deploy-action` from 4.7.4 to 4.7.6
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](4a3abc783e...9d877eea73)

Updates `github/codeql-action` from 4.31.7 to 4.31.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cf1bb45a27...5d4e8d1aca)

Updates `codecov/codecov-action` from 5.5.1 to 5.5.2
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](5a1091511a...671740ac38)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-version: 4.7.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
- dependency-name: github/codeql-action
  dependency-version: 4.31.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
- dependency-name: codecov/codecov-action
  dependency-version: 5.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-20 22:26:44 +00:00
SirLouen 0d4c5ee8da
fix: Correct sendmail_path validation to ensure proper formatting for sender address 2025-12-09 01:37:34 +01:00
SirLouen 14e1efe293
docs: Fixing array multiline syntax for sendmailPathProvider 2025-12-08 16:54:13 +01:00
SirLouen dca8e03946
fix: Add more causitry to testParseSendmailPath and nclude -oi with related tests 2025-12-08 16:48:09 +01:00
Marcus Bointon 84097ce614
Merge pull request #3285 from jrfnl/feature/dependabot-every-two-weeks
Dependabot/gh-actions: move to bi-weekly schedule
2025-12-08 14:00:32 +01:00
jrfnl 7ff3620f50
Dependabot/gh-actions: move to bi-weekly schedule
👉 Important: this is for **version** updates only, not for security updates, which are handled separately and don't depend on this configuration.

---

PR 3229 updated the GitHub Actions workflows used in this repo to use "pinned" versions for external action runners to improve workflow security.

The current "frequency" is weekly. As these updates are rarely time-sensitive, it should be fine to receive them less frequently.

This commit tries to make it so by changing the Dependabot schedule for GitHub Actions to once every two weeks and late in the day when the queue should be mostly empty (as long as it's not a Monday), so the update PR will come in on a more predictable schedule.
2025-12-08 12:36:18 +01:00
Marcus Bointon 85df414ab4
Merge pull request #3284 from PHPMailer/dependabot/github_actions/action-runners-a03ee4dddf
GH Actions: Bump the action-runners group across 1 directory with 3 updates
2025-12-08 08:47:27 +01:00
dependabot[bot] d04efe78e1
GH Actions: Bump the action-runners group across 1 directory with 3 updates
Bumps the action-runners group with 3 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action) and [shivammathur/setup-php](https://github.com/shivammathur/setup-php).


Updates `actions/checkout` from 6.0.0 to 6.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](1af3b93b68...8e8c483db8)

Updates `github/codeql-action` from 4.31.4 to 4.31.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](e12f017898...cf1bb45a27)

Updates `shivammathur/setup-php` from 2.35.5 to 2.36.0
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](bf6b4fbd49...44454db4f0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
- dependency-name: github/codeql-action
  dependency-version: 4.31.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
- dependency-name: shivammathur/setup-php
  dependency-version: 2.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: action-runners
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-08 06:02:37 +00:00
SirLouen 2b240b44e9
docs Update parseSendmailPath documentation to clarify parameter handling 2025-12-08 01:42:13 +01:00
SirLouen 4c06f874c9
fix: Refactor sendmail parameter handling and update related tests 2025-12-08 01:35:57 +01:00
SirLouen 4e8292f43c
fix: Refactor to fix linting issues in PHP 5.5 2025-12-07 19:11:59 +01:00
SirLouen 8d27fb6b7c
fix: Enhance sendmail parameter parsing, sendmailSend and add related unit tests 2025-12-07 19:05:45 +01:00
SirLouen 34b209f864
fix: Improve sendmail formatting logic and enhance related tests 2025-12-07 03:13:29 +01:00
SirLouen 31e3d491aa
fix: Correct sendmail path check logic in PHPMailer class 2025-12-07 02:00:54 +01:00
SirLouen 96d82b913a
fix: Update testMailSendWithSendmailParams to use example.org in sendmail path 2025-12-07 01:27:56 +01:00
SirLouen 8ff00047a8
docs: Add doc block to the testMailSendWithSendmailParams test 2025-12-06 17:44:11 +01:00
SirLouen a767d446c2
fix: Remove useless sendmail path check in testMailSend method 2025-12-06 17:05:27 +01:00
SirLouen b6729d7bd2
Fixing troubles with mailSend and Sender enabled 2025-12-06 16:56:00 +01:00
Marcus Bointon 360ae911ce
7.0.1 2025-11-25 08:18:09 +01:00
Marcus Bointon 6db653f5a8
Changelog 2025-11-25 08:16:03 +01:00
Marcus Bointon 2050f506c3
Deprecate version constants in SMTP and POP3 classes; they will always be the same as PHPMailer:VERSION 2025-11-25 08:08:54 +01:00
Marcus Bointon 6631e9049e
Merge pull request #3276 from jrfnl/feature/use-phpcompatibility-10.0
Use PHPCompatibility 10.0.0(-alpha1)
2025-11-25 07:58:05 +01:00
Marcus Bointon 12494b1830
Fix syntax 2025-11-24 18:17:31 +01:00
Marcus Bointon 381c209df1
Switch away from the IMAP functions, suggest using an IMAP library instead, and update the example to do that 2025-11-24 18:12:56 +01:00
jrfnl 57ef8c914f
Escape special characters the same way in all PHP versions
The `htmlspecialchars()` function is used to escape arbitrary text strings for display.

Original the default for the `$flags` parameter of that function in PHP was `ENT_COMPAT`, which translates to "convert double quotes to `&quot;` and leave single quotes alone".

As of PHP 8.1, the default value for the `$flags` parameter has been made more robust and was changed to `ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401`, which translates to "convert both double and single quotes, replace invalid code unit sequences with a Unicode Replacement Character and treat code as HTML 4.01".

For code to provide the same/predictable output cross-version PHP, the `$flags` parameter should be explicitly set and what with the new default value being the more robust one, this commit adds that value for `$flags` in all instances of function calls to `htmlspecialchars()`.

Once the application minimum PHP version is PHP 8.1 or higher, the parameter can be removed again (as the value will then be the same as the default parameter value).

Ref: https://www.php.net/manual/en/function.htmlspecialchars.php
2025-11-24 10:50:37 +01:00
Marcus Bointon 6dc895d1d9
Merge pull request #3278 from PHPMailer/dependabot/github_actions/actions/checkout-6.0.0
GH Actions: Bump actions/checkout from 5.0.0 to 6.0.0
2025-11-24 10:03:09 +01:00
Marcus Bointon 127dde31e2
Merge pull request #3277 from PHPMailer/dependabot/github_actions/action-runners-4b98d4914e
GH Actions: Bump github/codeql-action from 4.31.2 to 4.31.4 in the action-runners group
2025-11-24 10:02:32 +01:00
dependabot[bot] 606c699536
GH Actions: Bump actions/checkout from 5.0.0 to 6.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](08c6903cd8...1af3b93b68)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 06:03:12 +00:00
dependabot[bot] abe4691505
GH Actions: Bump github/codeql-action in the action-runners group
Bumps the action-runners group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.31.2 to 4.31.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0499de31b9...e12f017898)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 06:03:05 +00:00
Marcus Bointon 7284079a6d
Merge pull request #3275 from jrfnl/feature/cs-remove-superfluous-import-uses
Tests: remove unused import `use` statements
2025-11-23 23:23:24 +01:00
jrfnl b9d0e242fb
Examples/mailing_list: remove use of `E_STRICT`
While this is only example code, it is still code which should be functional for all supported PHP versions.

As `E_STRICT` has been deprecated since PHP 8.4 and wasn't really all that useful since PHP 7.0 anyway, it's probably better not to mention it in the example code.

Ref: https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant
2025-11-23 05:23:36 +01:00
jrfnl c24a4147cd
PHPCS: add a few more selective ignores
... for things already handled correctly in the code.
2025-11-23 05:23:36 +01:00
jrfnl 19fb4e2727
PHPCS/PHPCompatibility: favour inline ignores over blanket rule excludes
Best practice tweak regarding the use of PHPCompatibility.

It is strongly recommended to use inline ignore annotations when a reported issue is not a problem (because it is accompanied by a `function_exists()`, `defined()` or other check), instead of excluding a rule completely via the ruleset.

Blanket code-base wide ignores mean that:
* ... if a PR introduces new code (or changes existing code) which uses a non-cross-version compatible PHP feature...
* ... and the code doesn't have the right safeguards in place for cross-version compatibility...
* ... PHPCompatibility would not flag it because of the codebase wide ignore...
* ... which could cause problems for the end-users.

Selective, inline ignores ensure that only the annotated error is ignored and only for that specific bit of code, preventing the above described problem.

It also means that when something changes in PHP - like a deprecated method being removed -, you will be notified about the issue again so you can review if the current cross-version compatibility tweak is still the most optimal one.
2025-11-23 05:23:36 +01:00
jrfnl 051b81791f
CS: start using PHPCompatibility 10
Long anticipated, finally here: PHPCompatibility 10.0.0-alpha1 🎉

PHPCompatibility 10.0.0 brings huge improvements in both what is being detected (> 50 new sniffs), as well as the detection accuracy for pre-existing sniffs.

Even though still "unstable", it is stable enough for our purposes and the advantages of using it outweigh the disadvantage of it being an unstable version. By setting the `minimum-stability` and `prefer-stable` settings in the `composer.json`, we can ensure that we don't get the `dev-develop` branch, but rather get a `10.0.0` tag, unstable or not.

Includes updating the PHPCS version constraints to match.
Includes updating the exclusions in the ruleset for changes in the error codes due to further changes in PHP having been made (and now being detected).

Ref:
* https://github.com/PHPCompatibility/PHPCompatibility/wiki/Upgrading-to-PHPCompatibility-10.0
* https://github.com/PHPCompatibility/PHPCompatibility/releases/tag/10.0.0-alpha1
2025-11-23 05:23:22 +01:00
jrfnl d34204b729
Tests: remove unused import `use` statements 2025-11-23 04:49:42 +01:00
Marcus Bointon cc366ae351
Merge pull request #3272 from jrfnl/feature/ghactions-update-for-php-8.5-release
GH Actions: update for the release of PHP 8.5
2025-11-20 23:21:32 +01:00
jrfnl f5cc77c68a
GH Actions: update for the release of PHP 8.5
... which is expected to be released this Thursday.

* Builds against PHP 8.5 are no longer allowed to fail.
* Update PHP version on which code coverage is run (high should now be 8.5).
* Add _allowed to fail_ build against PHP 8.6.
* Update the README.

Note: for some jobs I use "nightly" for the "next" PHP version, for some `8.6`. While it may appear there is no difference and this is true for the better part of the year, there is a difference for about two months.

To illustrate, consider PHP 8.5:
* PHP "nightly" refers to the PHP `master` branch, so was PHP 8.5 until the PHP 8.5 was branched off when the first RC was cut in September.
* As of that moment, "nightly" basically became PHP 8.6, so to test against PHP 8.5, one would need to explicitly request `8.5`.
* As of the release of PHP 8.5, it is expected for "nightly" to be PHP 8.6, so the difference is moot again.

For that reason, the unit test workflow uses the explicit `8.6` version for PHP "next".
2025-11-18 21:12:43 +01:00
Marcus Bointon da2c9f9919
Merge pull request #3270 from jrfnl/feature/allow-test-runs-on-forks
GH Actions: allow test runs to succeed on fork
2025-11-13 21:18:11 +01:00
Marcus Bointon 5e41861a0e
Merge pull request #3269 from jrfnl/feature/composer-remove-roave-security-advisories
Composer: remove roave/security-advisories
2025-11-13 21:17:08 +01:00
jrfnl a0a3e6a3ef
GH Actions: allow test runs to succeed on fork
As things were, test runs on forks would always fail on the "upload code coverage reports" step, as forks (justifiably) don't have access to the `CODECOV_TOKEN`.

Fixed now by updating the conditions to run that step.
2025-11-13 20:43:39 +01:00
jrfnl 1645b1a7be
Composer: remove roave/security-advisories
The `roave/security-advisories` package was an inventive method to block installation of known insecure versions of other dependencies (via a `conflict` annotation).

As of Composer 2.9, using the `roave/security-advisories` package for this purpose is no longer needed as Composer will now natively block installation of known insecure versions of dependencies.

And while not all contributors to this repo may be using Composer 2.9+ (yet), Composer 2.9+ **_will_** be used in CI and CI failing on Composer blocking an insecure dependency offers the same level of protection as the package previously offered.

Refs:
* https://blog.packagist.com/composer-2-9/
* https://github.com/composer/composer/releases/tag/2.9.0
2025-11-13 20:15:45 +01:00
Marcus Bointon a522b78c67
Merge pull request #3267 from RobinvanderVliet/patch-1
Update Dutch translations
2025-11-10 14:53:39 +01:00
Robin van der Vliet a0ee4a34ed
Merge branch 'master' into patch-1 2025-11-10 13:34:14 +01:00
Marcus Bointon a39e1db862
Merge pull request #3268 from PHPMailer/dependabot/github_actions/action-runners-cf016e0bec
GH Actions: Bump JamesIves/github-pages-deploy-action from 4.7.3 to 4.7.4 in the action-runners group
2025-11-10 08:41:13 +01:00
dependabot[bot] 25658b754f
GH Actions: Bump JamesIves/github-pages-deploy-action
Bumps the action-runners group with 1 update: [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action).


Updates `JamesIves/github-pages-deploy-action` from 4.7.3 to 4.7.4
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](6c2d9db40f...4a3abc783e)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-version: 4.7.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-10 06:03:18 +00:00
Robin van der Vliet d616c7fc76
Update Dutch translations 2025-11-07 23:25:43 +01:00
Marcus Bointon 15c3d21fa1
Merge pull request #3266 from RobinvanderVliet/patch-1
Recreate Esperanto translations
2025-11-07 23:05:03 +01:00
Robin van der Vliet b336ed18b5
Recreate Esperanto translations 2025-11-07 22:12:02 +01:00
Marcus Bointon 37d628dd22
Merge pull request #3264 from PHPMailer/dependabot/github_actions/action-runners-02cf758a13
GH Actions: Bump github/codeql-action from 4.31.0 to 4.31.2 in the action-runners group
2025-11-05 15:11:07 +01:00
dependabot[bot] 9aa8367be6
GH Actions: Bump github/codeql-action in the action-runners group
Bumps the action-runners group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.31.0 to 4.31.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4e94bd11f7...0499de31b9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-03 06:03:34 +00:00
Marcus Bointon 4384c206d3
Merge pull request #3262 from greew/add-missing-da-lang
Added missing Danish translations
2025-10-29 10:46:09 +01:00
Jesper Skytte 8b7828d3b0
Added missing Danish translations 2025-10-29 09:42:18 +01:00
Marcus Bointon 8a06a2ddd1
Merge pull request #3261 from greew/master
Add XOAUTH2 token exception handling
2025-10-29 09:39:27 +01:00
Jesper Skytte 8f59b82488
Add XOAUTH2 token exception handling
If generating an OAuth2 token fails in the provider and an exception is thrown, we never catch that exception, but just let exception propagate up to whatever.

I suggest this change, such that we can handle errors when generating oauth tokens. It is based on the fact that ^League\OAuth2\Client\Provider\AbstractProvider` can throw exceptions during getting the oauth token, but we are nowhere near to knowing why.

I have decided on catching all exception (`\Exception`) because if someone uses another OAuthTokenProvider (it's just an interface, so it's possible), we won't know specifically which exceptions can be thrown here, so we need to catch them all.

By throwing a PHPMailer exception and adding the existing exception as the `$previous` variable, we can show a generic error message to regular users and advice how developers can get actually meaningful error messages from the previous exception.
2025-10-29 09:04:06 +01:00
Marcus Bointon eec5710309
Merge pull request #3252 from wera-as/master
Update phpmailer.lang-nb.php
2025-10-27 10:33:49 +01:00
Marcus Bointon a231b7d4c4 Fix missing newline at end of file in language file 2025-10-27 10:19:00 +01:00
Adrian Thomassen 74e7f4c72a Update phpmailer.lang-nb.php
Add missing strings without whitespace changes
2025-10-27 10:19:00 +01:00
Adrian Thomassen 07db4a7a0f Revert "Update phpmailer.lang-nb.php"
This reverts commit 102f7bfa4d.
2025-10-27 10:19:00 +01:00
Adrian Thomassen 6f42027abe Update phpmailer.lang-nb.php
Refined the current translation and added missing strings
2025-10-27 10:19:00 +01:00
Marcus Bointon 494e8d60e4
Merge pull request #3259 from PHPMailer/dependabot/github_actions/action-runners-499cb248b3
GH Actions: Bump github/codeql-action from 4.30.9 to 4.31.0 in the action-runners group
2025-10-27 09:58:54 +01:00
Marcus Bointon ad20fe54b9
Merge pull request #3258 from PHPMailer/dependabot/github_actions/actions/upload-artifact-5.0.0
GH Actions: Bump actions/upload-artifact from 4.6.2 to 5.0.0
2025-10-27 09:58:31 +01:00
dependabot[bot] d9cf457a92
GH Actions: Bump github/codeql-action in the action-runners group
Bumps the action-runners group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.30.9 to 4.31.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](16140ae1a1...4e94bd11f7)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: action-runners
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 06:32:22 +00:00
dependabot[bot] 060cf931c3
GH Actions: Bump actions/upload-artifact from 4.6.2 to 5.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.2 to 5.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](ea165f8d65...330a01c490)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 06:15:15 +00:00
Marcus Bointon 54a5a950dd
Merge pull request #3253 from PHPMailer/dependabot/github_actions/action-runners-ff6e0617b3
GH Actions: Bump github/codeql-action from 4.30.8 to 4.30.9 in the action-runners group
2025-10-20 10:15:39 +02:00
dependabot[bot] effe349964
GH Actions: Bump github/codeql-action in the action-runners group
Bumps the action-runners group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.30.8 to 4.30.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f443b600d9...16140ae1a1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.30.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-20 06:11:04 +00:00
Marcus Bointon 22b1e59f53
Merge pull request #3248 from KaminskiDaniell/patch-3
Corrected Polish translation
2025-10-15 19:27:26 +02:00
Daniel Kamiński 5ef071ed30
Remove extra line 2025-10-15 19:21:14 +02:00
Daniel Kamiński e75e5ee3e3
Merge branch 'master' into patch-3 2025-10-15 19:19:38 +02:00
Marcus Bointon 36ea61cf21
Merge changes from 6.12.0 2025-10-15 19:01:55 +02:00
Marcus Bointon 8bc8f15714
Merge changes from 7.0.0 2025-10-15 19:01:45 +02:00
Marcus Bointon c523ee67a8
Merge changes from 7.0.0 2025-10-15 18:59:43 +02:00
Marcus Bointon c7111310c6
7.0.0 2025-10-15 18:40:02 +02:00
Daniel Kamiński d49feed6fd
Corrected Polish translation 2025-10-13 16:06:28 +02:00
Marcus Bointon b17101946b
Merge pull request #3247 from PHPMailer/dependabot/github_actions/github/codeql-action-4.30.8
GH Actions: Bump github/codeql-action from 3.30.6 to 4.30.8
2025-10-13 09:40:24 +02:00
dependabot[bot] 1cf86b0762
GH Actions: Bump github/codeql-action from 3.30.6 to 4.30.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.6 to 4.30.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](64d10c1313...f443b600d9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.30.8
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-13 06:03:01 +00:00
Marcus Bointon 97ccd46848
Merge pull request #3036 from mariuszkrzaczkowski/patch-1
Add cid default domain
2025-10-06 09:55:06 +02:00
Mariusz Krzaczkowski 86b9838806
Merge branch 'PHPMailer:master' into patch-1 2025-10-06 09:38:53 +02:00
Marcus Bointon 46f72568d5
Changelog 2025-10-06 09:33:42 +02:00
Marcus Bointon ad2821203f
Unset From address to check default CID behaviour 2025-10-06 09:28:56 +02:00
Marcus Bointon 54b2ab00d3
Fix $cid assembly 2025-10-06 09:21:07 +02:00
Marcus Bointon 73afb4a8b1
Merge remote-tracking branch 'cid/patch-1' into patch-1 2025-10-06 09:11:15 +02:00
Marcus Bointon c09730a7d7
CS 2025-10-06 09:10:51 +02:00
Mariusz Krzaczkowski 306ea7022f
Update PHPMailer.php 2025-10-06 09:10:51 +02:00
Mariusz Krzaczkowski 0f9ebf7c3c
Update PHPMailerTest.php 2025-10-06 09:10:51 +02:00
Mariusz Krzaczkowski 6aad52aa06
Update PHPMailerTest.php 2025-10-06 09:10:51 +02:00
Mariusz Krzaczkowski 7a18c0bc98
Update PHPMailerTest.php 2025-10-06 09:10:51 +02:00
Mariusz Krzaczkowski 9489d4c5c3
Update PHPMailer.php 2025-10-06 09:10:51 +02:00
Mariusz Krzaczkowski 2e38fff8f3
Add cid default domain 2025-10-06 09:10:51 +02:00
Mariusz Krzaczkowski 9a5f46f747
Add cid default domain 2025-10-06 09:10:51 +02:00
Marcus Bointon 7251db8b19
CS 2025-10-06 09:07:54 +02:00
Marcus Bointon 27e89fabc3
Merge pull request #3245 from PHPMailer/dependabot/github_actions/action-runners-2eaf09b135
GH Actions: Bump the action-runners group with 2 updates
2025-10-06 08:44:48 +02:00
dependabot[bot] c60f5ab888
GH Actions: Bump the action-runners group with 2 updates
Bumps the action-runners group with 2 updates: [ossf/scorecard-action](https://github.com/ossf/scorecard-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `ossf/scorecard-action` from 2.4.2 to 2.4.3
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](05b42c6244...4eaacf0543)

Updates `github/codeql-action` from 3.30.5 to 3.30.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](3599b3baa1...64d10c1313)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
- dependency-name: github/codeql-action
  dependency-version: 3.30.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-06 06:02:48 +00:00
Mariusz Krzaczkowski e8f4d86c66
Update PHPMailer.php 2025-10-02 11:18:08 +02:00
Mariusz Krzaczkowski dc2ecee788
Update PHPMailerTest.php 2025-10-02 10:31:27 +02:00
Mariusz Krzaczkowski 07755f0f69
Update PHPMailerTest.php 2025-10-02 10:30:50 +02:00
Mariusz Krzaczkowski 512e26bffc
Update PHPMailerTest.php 2025-10-02 10:27:01 +02:00
Mariusz Krzaczkowski b135f4f284
Update PHPMailer.php 2025-10-02 10:19:16 +02:00
Marcus Bointon 5acdb20adf
Merge pull request #3241 from SirLouen/patch/3201v3
Improving docs and translations for deprecated useimap
2025-09-30 17:28:50 +02:00
SirLouen a26214d5a3
Fixing spanish translations 2025-09-30 17:25:47 +02:00
SirLouen 0b6ed12ed3
Adding new Translation format proposed by @Synchro 2025-09-30 17:24:11 +02:00
SirLouen 817d1e604e
Forgot one 2025-09-30 14:52:07 +02:00
SirLouen 94f8565fd0
Improving docs and translations for deprecated useimap 2025-09-30 14:48:13 +02:00
Marcus Bointon d9e3b36b47
6.11.1 2025-09-30 13:54:53 +02:00
Marcus Bointon fe380a85e0
Merge pull request #3240 from SirLouen/patch/3201v2
Regressing deprecatedArg
2025-09-30 13:51:19 +02:00
SirLouen 29f48d454e
Regressing deprecatedArg 2025-09-30 13:21:53 +02:00
Marcus Bointon 6ed58a9c60
Merge pull request #3238 from PHPMailer/dependabot/github_actions/action-runners-206d0ace73
GH Actions: Bump github/codeql-action from 3.30.3 to 3.30.5 in the action-runners group
2025-09-29 19:56:59 +02:00
Marcus Bointon 9500c37b70
Version and changelog 2025-09-29 18:40:59 +02:00
Marcus Bointon 39a1bc905c
Merge pull request #3237 from SirLouen/patch/3234
Reply-To to Indexed Array Conversion
2025-09-29 18:28:02 +02:00
Marcus Bointon 22a8dce04e
Merge pull request #3202 from SirLouen/patch/3201
Adding Name Encoding Improvement without MbString Extension
2025-09-29 18:26:33 +02:00
dependabot[bot] 9b899a0f22
GH Actions: Bump github/codeql-action in the action-runners group
Bumps the action-runners group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.30.3 to 3.30.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](192325c861...3599b3baa1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: action-runners
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-29 07:07:40 +00:00
SirLouen 8e8b503db9
Doing some cleaning up 2025-09-26 22:16:18 +02:00
SirLouen bcc4d84893
Reply-To to Indexed Array Conversion 2025-09-26 22:05:05 +02:00
SirLouen b0f96abda0
Next version will be 6.11.0 for this deprecatedArg 2025-09-26 17:17:09 +02:00
SirLouen 0d5d8854f9
Fixing 8.3+ mb_decode_mimeheader changes 2025-09-26 17:13:11 +02:00
SirLouen 1191a4ef0b
Better use expectException 2025-09-26 02:36:03 +02:00
SirLouen 5060f5405c
Switching to expectError 2025-09-26 02:00:15 +02:00
SirLouen cae960ed2b
Remove xdebug function 2025-09-26 01:51:06 +02:00
SirLouen b1860a4e86
Better using static 2025-09-26 01:22:41 +02:00
SirLouen f4d321633d
Taking advantage of the new static translator 2025-09-26 01:16:38 +02:00
SirLouen 238af6720e
Remove iconv suggestion 2025-09-26 01:09:21 +02:00
SirLouen 95ff455f9d
Adding #3235 and reorganizing tests 2025-09-26 01:07:01 +02:00
SirLouen bda1fee442
Merge branch 'master' into patch/3201 2025-09-25 14:20:23 +02:00
Marcus Bointon ec08e9497d
Merge pull request #3200 from SirLouen/patch/3199
Improving Copy for mbstring intl test requirements
2025-09-24 18:49:05 +01:00
Marcus Bointon a49806c893
Merge branch 'master' into patch/3199 2025-09-24 18:35:25 +01:00
Marcus Bointon 759c73ef98
Merge pull request #3232 from jrfnl/feature/ghactions-set-minimal-permissions
GH Actions: set permissions for each workflow/job
2025-09-21 15:49:43 +01:00
jrfnl c8fdd4178e
GH Actions: set permissions for each workflow/job
> Users frequently over-scope their workflow and job permissions, or set broad workflow-level permissions without realizing that all jobs inherit those permissions.
>
> Furthermore, users often don't realize that the _default_ `GITHUB_TOKEN` permissions can be very broad, meaning that workflows that don't configure any permissions at all can _still_ provide excessive credentials to their individual jobs.
>
> **Remediation**
> In general, permissions should be declared as minimally as possible, and as close to their usage site as possible.
>
> In practice, this means that workflows should almost always set `permissions: {}` at the workflow level to disable all permissions by default, and then set specific job-level permissions as needed.

This was already addressed for the other two workflows, just not for the `tests` one.

As far as I can see, the jobs here do not need the `GITHUB_TOKEN` secret and even if they do, only for `content: read`, which for public repos does not need to be set explicitly, though it doesn't do any harm to have that set anyway.

Refs:
* https://docs.zizmor.sh/audits/#excessive-permissions
2025-09-21 16:39:02 +02:00
Marcus Bointon 041c556075
Merge pull request #3231 from jrfnl/feature/ghactions-do-not-persist-credentials
GH Actions: do not persist credentials
2025-09-21 15:08:42 +01:00
Marcus Bointon 7f75a4220a
Merge pull request #3113 from PHPMailer/dependabot/github_actions/codecov/codecov-action-5
GH Actions: Bump codecov/codecov-action from 4 to 5
2025-09-21 15:08:17 +01:00
dependabot[bot] eef3fef3ae
GH Actions: Bump codecov/codecov-action from 4 to 5
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-21 13:59:33 +00:00
Marcus Bointon d418826b0d
Merge branch 'master' into feature/ghactions-do-not-persist-credentials 2025-09-21 14:57:23 +01:00
Marcus Bointon 7e878a18f1
Merge pull request #3230 from PHPMailer/dependabot/github_actions/actions/checkout-5.0.0
GH Actions: Bump actions/checkout from 4.3.0 to 5.0.0
2025-09-21 14:54:18 +01:00
jrfnl a209299105
GH Actions: do not persist credentials
> By default, using `actions/checkout` causes a credential to be persisted in the checked-out repo's `.git/config`, so that subsequent `git` operations can be authenticated.
>
> Subsequent steps may accidentally publicly persist `.git/config`, e.g. by including it in a publicly accessible artifact via `actions/upload-artifact`.
>
> However, even without this, persisting the credential in the `.git/config` is non-ideal unless actually needed.
>
> **Remediation**
>
> Unless needed for `git` operations, `actions/checkout` should be used with `persist-credentials: false`.
>
> If the persisted credential is needed, it should be made explicit with `persist-credentials: true`.

This has now been addressed in all workflows.

Refs:
* https://unit42.paloaltonetworks.com/github-repo-artifacts-leak-tokens/
* https://docs.zizmor.sh/audits/#artipacked
2025-09-21 15:01:18 +02:00
dependabot[bot] 0d6eaeb3a9
GH Actions: Bump actions/checkout from 4.3.0 to 5.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.3.0 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](08eba0b27e...08c6903cd8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-21 10:20:29 +00:00
Marcus Bointon 80cd2d5f3a
Merge pull request #3228 from jrfnl/feature/ghactions-update-permissions-scorecard
GH Actions/scorecard: update permissions
2025-09-21 11:20:24 +01:00
Marcus Bointon 1714708220
Merge pull request #3229 from jrfnl/feature/ghactions-pin-action-runners
GH Actions: "pin" all action runners
2025-09-21 11:19:30 +01:00
jrfnl 5ce9b04aae
Dependabot: update config
This commit makes the following change to the Dependabot config:
* It introduces a "group".
    By default Dependabot raises individual PRs for each update. Now, it will group updates to new minor or patch release for all action runners into a single PR.
    Updates to new major releases of action runners will still be raised as individual PRs.

Refs:
* https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/optimizing-pr-creation-version-updates
* https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference
2025-09-20 05:10:40 +02:00
jrfnl 086dfbe727
GH Actions: "pin" all action runners
Recently there has been more and more focus on securing GH Actions workflows - in part due to some incidents.

The problem with "unpinned" action runners is as follows:
* Tags are mutable, which means that a tag could point to a safe commit today, but to a malicious commit tomorrow.
    Note that GitHub is currently beta-testing a new "immutable releases" feature (= tags and release artifacts can not be changed anymore once the release is published), but whether that has much effect depends on the ecosystem of the packages using the feature.
    Aside from that, it will likely take years before all projects adopt _immutable releases_.
* Action runners often don't even point to a tag, but to a branch, making the used action runner a moving target.
    _Note: this type of "floating major" for action runners used to be promoted as good practice when the ecosystem was "young". Insights have since changed._

While it is convenient to use "floating majors" of action runners, as this means you only need to update the workflows on a new major release of the action runner, the price is higher risk of malicious code being executed in workflows.

Dependabot, by now, can automatically submit PRs to update pinned action runners too, as long as the commit-hash pinned runner is followed by a comment listing the released version the commit is pointing to.

So, what with Dependabot being capable of updating workflows with pinned action runners, I believe it is time to update the workflows to the _current_ best practice of using commit-hash pinned action runners.

The downside of this change is that there will be more frequent Dependabot PRs.

If this would become a burden/irritating, the following mitigations can be implemented:
1. Updating the Dependabot config to group updates instead of sending individual PRs per action runner.
2. A workflow to automatically merge Dependabot PRs as long as CI passes.

Includes updating the version for `ossf/scorecard-action` as it was a couple of version behind.

Ref: https://docs.github.com/en/actions/reference/security/secure-use#using-third-party-actions
2025-09-20 05:10:21 +02:00
jrfnl 63540d8cf3
GH Actions/scorecard: update permissions
... to match the current recommendations.

I've removed the "read" permissions as those should only be needed for "private" repos.

Ref: https://github.com/ossf/scorecard-action#additional-permissions-for-private-repositories
2025-09-20 05:09:45 +02:00
Marcus Bointon 6f0f7a7f68
Extract gmail transaction IDs, fixes #3224 2025-09-18 17:27:24 +02:00
Marcus Bointon 9f0387fb37
Changelog 2025-09-18 17:27:24 +02:00
Manuel Camargo 6cab1544fa
Merge branch 'master' into patch/3201 2025-09-12 13:41:55 +02:00
Marcus Bointon 5bc453d6c5
Merge pull request #3226 from schorschii/smime-longline-encoding-header-fix
Fix encoding header for SMIME signed messages with long lines
2025-09-11 22:23:42 +01:00
Marcus Bointon 4c917a9b46
CS 2025-09-11 23:16:50 +02:00
Georg Sieber 5470c1e795
add test 2025-09-11 22:52:01 +02:00
Georg Sieber fd9f8d33cb
fix encoding header for SMIME signed messages with long lines 2025-09-11 19:03:20 +02:00
Manuel Camargo 6a6e66abf4
Merge branch 'master' into patch/3201 2025-09-11 14:42:41 +02:00
SirLouen b1b1f65f0b
Merge branch 'master' into patch/3201 2025-09-11 14:32:06 +02:00
SirLouen 7e61c84718
Add an extra test 2025-09-09 17:18:43 +02:00
Marcus Bointon 5ddea0610b
Merge pull request #3217 from SirLouen/patch/3210
Modularizing and Simplifying the Address Parser
2025-09-02 21:11:31 +02:00
SirLouen 3c93e8d6f3
Adding Temporary Specific Tests for Native Function 2025-08-24 16:03:51 +02:00
SirLouen e72170c6ba
Little separator line 2025-08-24 15:38:03 +02:00
SirLouen 69a2b8038f
Removing Tests. Reintroducing them fixed in #3197 2025-08-24 15:37:42 +02:00
SirLouen 0ce6905391
Merge branch 'master' into patch/3210 2025-08-24 15:29:04 +02:00
Marcus Bointon a848a67c50
Merge pull request #3216 from SirLouen/patch/3215
Staticfying the Language Pack
2025-08-24 15:08:15 +02:00
SirLouen 22885eaf4a
Preparing new version for no-IMAP, Tests Pending 2025-08-23 16:40:10 +02:00
SirLouen b41dd255a2
Staticfying the Language Pack 2025-08-23 16:16:14 +02:00
Marcus Bointon 85f7f98f59
Merge branch 'master' into patch/3201
# Conflicts:
#	src/PHPMailer.php
2025-08-22 17:25:24 +02:00
SirLouen f2af1cafb5
Merge from master 2025-08-22 17:20:23 +02:00
SirLouen 34c6423ac6
Sorting the Array problem in doCallback 2025-08-22 17:19:27 +02:00
Marcus Bointon 81eedda461
Alphabetical 2025-08-22 16:49:10 +02:00
Marcus Bointon d43654d445
Merge pull request #3208 from SirLouen/patch/3207
Sorting the Array problem in doCallback
2025-08-22 15:15:04 +02:00
Marcus Bointon 19f17f8aeb
CS 2025-08-22 15:12:14 +02:00
Marcus Bointon fef2d5cf15
Merge branch 'master' into patch/3201 2025-08-22 10:46:57 +02:00
Marcus Bointon f78d341f06
Merge pull request #3191 from jrfnl/feature/fix-test-runtime-deprecations-php-8.5
PHP 8.5 | Tests: prevent deprecation notice for Reflection*::setAccessible()
2025-08-22 10:45:27 +02:00
Marcus Bointon 276eb1e879
Merge pull request #3211 from jrfnl/feature/fix-lint-issue-php-8.5
Fix linting issue on PHP 8.5
2025-08-22 10:44:33 +02:00
jrfnl 855bf067fc
Fix linting issue on PHP 8.5
As per the options described in https://github.com/PHPMailer/PHPMailer/pull/3202#issuecomment-3212478928.

Note: the linting ignore comment triggers some PHPCS errors (_sigh_), so I'm selectively excluding those.
Alternatively, it could be considered to exclude test fixture files completely from the PHPCS scan.
2025-08-22 02:27:01 +02:00
Marcus Bointon da0cffbc05
CS 2025-08-21 10:23:38 +02:00
SirLouen 71dfc112c9
Better this deprecation method 2025-08-19 16:04:16 +02:00
SirLouen f1255a0a55
Deprecation & Composer Updates 2025-08-19 16:00:45 +02:00
SirLouen 97f4e58e18 Sorting the Array problem in doCallback 2025-08-17 13:18:53 +02:00
SirLouen f7b82634c9 Return useimap for BC 2025-08-17 12:28:52 +02:00
SirLouen 99b482752e Final Act including iconv_mime_decode 2025-08-17 00:01:46 +02:00
SirLouen d2fc22a4f1 Fixing #3204 2025-08-16 18:28:42 +02:00
SirLouen a3ddc21741 Adding Tests 2025-08-16 00:05:45 +02:00
SirLouen bf8e97d3c8 Adding Name Encoding Improvement without MbString Extension 2025-08-14 02:19:38 +02:00
Marcus Bointon 800919c6a4
Merge pull request #3193 from christianseel/patch-1
Enhance 'interrupted system call' check to handle non-english locale
2025-08-13 00:38:01 +02:00
SirLouen 2f92d9c841 Improving Copy for mbstring intl test requirements 2025-08-12 23:50:19 +02:00
Christian Seel 5b970527ae
Enhance interrupted system call check for non-english locale
on applications with a different locale than english, the message "interrupted system call" is not found because it's translated. So we also check for the SOCKET_EINTR constant which is defined under Windows and UNIX-like platforms (if available on the platform).
2025-08-11 14:09:44 +02:00
Marcus Bointon ca34869b2c
Merge pull request #3190 from jrfnl/feature/ghactions-show-startup-errors
GH Actions: update PHP ini configuration
2025-08-10 10:14:27 +02:00
jrfnl 096b24646e
PHP 8.5 | Tests: prevent deprecation notice for Reflection*::setAccessible()
Since PHP 8.1, calling the `Reflection*::setAccessible()` methods is no longer necessary as reflected properties/methods/etc will always be accessible.
However, the method calls are still needed for PHP < 8.1.

As of PHP 8.5, calling the `Reflection*::setAccessible()` methods is now formally deprecated and will yield a deprecation notice, which will fail test runs.
As of PHP 9.0, the `setAccessible()` method(s) will be removed.

With the latter in mind, this commit prevents the deprecation notice by making the calls to `setAccessible()` conditional.

Silencing the deprecation would mean, this would need to be "fixed" again come PHP 9.0, while the current solution should be stable, including for PHP 9.0.

Ref: https://wiki.php.net/rfc/deprecations_php_8_5#extreflection_deprecations
2025-08-10 05:38:47 +02:00
jrfnl 91ef7d0e54
GH Actions: update PHP ini configuration
Add `display_startup_errors=On` as per the current recommendation from PHPUnit.

Ref: b3b159cbe9
2025-08-10 05:32:47 +02:00
Marcus Bointon f202f351ca
Don't use `-t` switch with qmail, see #3189 2025-08-08 11:58:13 +02:00
Marcus Bointon 52d0fe4916
Merge pull request #3187 from jrfnl/feature/ghactions-dont-run-cronjobs-on-forks
GH Actions: don't run cron jobs on forks
2025-08-04 18:26:34 +02:00
jrfnl fc8c76f3be
GH Actions: don't run cron jobs on forks
While workflows are disabled by default in forks, it is quite common for contributors to enable them to verify CI will pass before submitting a pull request.

When enabling workflow runs in forks, it's "all or nothing".
This means that:
* All workflows which are only intended to be run on the canonical repo will also be enabled.
    These workflows will also often need access to repo-specific secrets and will typically fail when run from a fork.
* Workflows which contain cron jobs will also be enabled.
    Depending on the type of account the contributor has, this can burn through their "CI minutes".

This commit is based on a review of workflows containing cron jobs and disables running the jobs when a cron job is triggered in a fork.
2025-08-04 18:10:23 +02:00
Marcus Bointon 0ff2d3c8ea
Changelog 2025-06-18 23:02:11 +02:00
Marcus Bointon a2fa102104
Merge pull request #3170 from llemoine/master
XOAUTH : Added support for long auth tokens
2025-06-18 22:52:38 +02:00
Marcus Bointon ffbe1ad27f
CS 2025-06-18 20:32:55 +02:00
Marcus Bointon ce9d1b6883
Add support for empty tokens 2025-06-18 19:37:59 +02:00
Marcus Bointon 90cdf758c2
Clean up 2025-06-18 19:37:28 +02:00
LE MOINE Laurent 5fc635571b Fixed typo and added strict comparison on response code 2025-06-18 16:19:12 +02:00
LE MOINE Laurent 8ca031797f Added support for maximum command size during XOAUTH2 authentication 2025-06-18 11:01:34 +02:00
Marcus Bointon 912f278a48
Add workaround for #3163 2025-05-31 10:46:53 +02:00
Marcus Bointon 2efdf63a32
Add formatting script 2025-05-31 10:41:07 +02:00
Marcus Bointon bf74d75a1f
6.10.0 2025-04-24 17:19:31 +02:00
Marcus Bointon e932843879
Docs 2025-04-24 17:15:26 +02:00
Marcus Bointon ca87ef20d2
Docs 2025-04-24 15:26:45 +02:00
Marcus Bointon 80b6275ebc
Skip this test when UTF-8 isn't usable 2025-04-23 21:42:01 +02:00
Marcus Bointon c5dae41b32
Merge branch 'SMTPUTF8-test' into SMTPUTF8 2025-04-10 16:11:46 +02:00
Marcus Bointon fc6779f050
Fail to add an address if it uses 8-bit chars in the domain, but we are missing extensions to support IDN. 2025-04-10 16:10:46 +02:00
Marcus Bointon 154743c305
nah 2025-04-09 22:51:34 +02:00
Marcus Bointon 1ef59a2a99
Try without mbstring 2025-04-09 22:32:36 +02:00
Marcus Bointon 1db5c74f76
Use existing function to check for test config 2025-04-09 14:35:24 +02:00
Arnt Gulbrandsen d31cb27117
Adjust eai regex to disallow emoji and letters/numbers.
Update a few tests to match the recent changes.

Use the eai validator (unless another is being used) for addresses such as
info@müller-schmidt.de, for which PHPMailer may not choose to use SMTPUTF8.
2025-04-09 14:13:35 +02:00
Marcus Bointon b62de86fd2
Explain eai 2025-04-09 14:13:33 +02:00
Marcus Bointon eda0313e07
Explain eai 2025-04-09 14:13:30 +02:00
Marcus Bointon 17b3dfbdb9
Explain eai 2025-04-09 14:13:26 +02:00
Marcus Bointon 6467d54259
Explain why 2025-04-09 14:13:23 +02:00
Marcus Bointon 2818f3e6a3
Use falsy check as it could be null or false 2025-04-09 14:13:18 +02:00
Marcus Bointon ddebeb0565
Default CharSet to UTF-8 if we are using UTF-8 addresses and the validator has not been changed. 2025-04-09 14:13:13 +02:00
Marcus Bointon 29a04c283a
Consistent quotes 2025-04-09 14:13:09 +02:00
Marcus Bointon 956a31928c
Cleanup 2025-04-09 14:13:06 +02:00
Marcus Bointon 6d7233935f
Comment 2025-04-09 14:13:03 +02:00
Marcus Bointon 8b0667099d
CS 2025-04-09 14:13:00 +02:00
Arnt Gulbrandsen e588719eec
Send unencoded UTF8 in subject/body text when SMTPUTF8 allows that. 2025-04-09 14:12:59 +02:00
Arnt Gulbrandsen 2f0af94d33
Set UseSMTPUTF8 fully automatically when needed
This makes SMTPUTF8 support the default when the user chooses to use UTF-8
as charset, without affecting code that uses ISO 8859-1.
2025-04-09 14:12:59 +02:00
Marcus Bointon 0e7b094a32
Throw an exception if the server doesn't support SMTPUTF8 and we need it 2025-04-09 14:12:58 +02:00
Marcus Bointon c6d62ac4af
Comment 2025-04-09 14:12:55 +02:00
Marcus Bointon 7cda202270
Check explicit validation 2025-04-09 14:12:51 +02:00
Marcus Bointon bfd4c3db1a
Choose a validator that should fail 2025-04-09 14:12:45 +02:00
Marcus Bointon 321aeb200d
Typo 2025-04-09 14:12:42 +02:00
Marcus Bointon 7fb51f0c50
Changelog 2025-04-09 14:12:39 +02:00
Marcus Bointon c1c3b24e9c
Unicode is a proper name 2025-04-09 14:12:35 +02:00
Marcus Bointon 37e54ed3ed
CS 2025-04-09 14:12:08 +02:00
Arnt Gulbrandsen 9278e5774a
Add support for RFC6530, using it only when required.
This adds the ability to send email to addresses like grå@grå.org, but
preserves phpmailer's old behaviour for all addresses that worked before
(such as info@grå.org).
2025-04-09 10:59:48 +02:00
Marcus Bointon e7b1334cf2
Update Readme 2025-04-01 10:08:58 +02:00
Marcus Bointon ca476d4d55
Merge pull request #3147 from sudojoao/master
Add missing translations and improve grammar for professionalism European Portuguese 🇵🇹
2025-03-25 15:31:16 +01:00
Marcus Bointon cd219181e9
Update test strings after #3148 2025-03-23 21:39:24 +01:00
Marcus Bointon 71d87be28f
Merge pull request #3148 from sudwebdesign/patch-1 2025-03-23 12:35:42 -04:00
Thomas Ingles 57347817b4
Fix the smtp error `ErrorInfo` msg: Troubleshooting url glued
`SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingSMTP server error: Failed to connect to server SMTP code: 111 Additional SMTP info: Connection refused`

Become

`SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting SMTP server error: Failed to connect to server SMTP code: 111 Additional SMTP info: Connection refused`
2025-03-23 16:52:48 +01:00
João Vieira 101bb806dd
Add missing translations and improve grammar for professionalism 2025-03-21 16:03:40 +00:00
João Vieira 7d81c4b189
Add missing translations and improve grammar for professionalism 2025-03-21 15:53:53 +00:00
Marcus Bointon ab8d4f87a4
Use the `email` field to check for form submission, see #3144 2025-03-04 19:11:22 +01:00
Marcus Bointon ac30223de5
Merge pull request #3133 from no-one/master
Remove a space
2025-02-05 21:13:57 +01:00
CeeKay 22392c8fed
Remove a space 2025-02-05 19:59:08 +01:00
Marcus Bointon 0408a4926a
Merge pull request #3132 from no-one/master
Replace Swiftmailer with Symfony Mailer
2025-02-05 14:59:38 +01:00
CeeKay 0de87f8fda
Replace Swiftmailer with Symfony Mailer
https://symfony.com/blog/the-end-of-swiftmailer
2025-02-05 13:28:59 +01:00
Marcus Bointon ccce6f6ce9
Merge pull request #3130 from ziegenberg/dont-export-editorconfig
Do not add `.editorconfig` file to releases
2025-02-02 21:34:18 +01:00
Daniel Ziegenberg 35b6ca5085
Do not add .editorconfig file to releases
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2025-02-02 19:56:13 +01:00
Marcus Bointon 2f5c94fe74
6.9.3 2024-11-24 19:04:13 +01:00
Marcus Bointon 2c73ad9dd5
Changelog 2024-11-22 06:36:49 +01:00
Marcus Bointon 7e2e8d53e6
Merge pull request #3115 from jrfnl/feature/ghactions-update-for-php-8.4-release
GH Actions: PHP 8.4 has been released
2024-11-22 05:02:58 +01:00
jrfnl 7c786ca890
GH Actions: PHP 8.4 has been released
* Builds against PHP 8.4 are no longer allowed to fail.
* Add _allowed to fail_ builds against PHP 8.5.

Ref: https://www.php.net/releases/8.4/en.php
2024-11-22 01:58:32 +01:00
Marcus Bointon 561609ac2e
Merge pull request #3114 from emmanuel-ferdman/master
Update `PHPMailerTest.php` reference
2024-11-18 16:50:36 +01:00
Emmanuel Ferdman 5c95844f50
Update `PHPMailerTest.php` reference
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2024-11-18 07:29:21 -08:00
Marcus Bointon 611235697c
CS 2024-10-21 11:42:14 +02:00
Marcus Bointon 5fc8d634b5
Clarify comment 2024-10-21 11:36:38 +02:00
Marcus Bointon 182f7b9158
Use rfc-editor.org for all docs links 2024-10-15 22:20:47 +02:00
Marcus Bointon a7b17b42fa
6.9.2 2024-10-09 12:07:50 +02:00
Marcus Bointon f658da94f1
Changelog 2024-10-02 23:35:19 +02:00
Marcus Bointon 4617ffee59
Changelog 2024-10-02 23:32:15 +02:00
Marcus Bointon df46489479
Add Kurdish Sorani translation 2024-10-02 23:26:04 +02:00
Marcus Bointon d234e50f25
Simpler regex 2024-10-02 23:17:14 +02:00
Marcus Bointon c1c075a69e
This will never match, so look for a string instead 2024-10-02 23:17:13 +02:00
Marcus Bointon f851553d26
Merge pull request #3020 from Yurunsoft/fix-set_error_handler
Fix cannot access protected method
2024-10-02 23:12:07 +02:00
Marcus Bointon 7a67257f84
Merge pull request #3003 from jeijei4/patch-1
Update of PHPDoc comment of the addOrEnqueueAnAddress function
2024-10-02 22:45:21 +02:00
Marcus Bointon 9d05d769dd
Merge pull request #3096 from jrfnl/feature/ghactions-extension-variation-in-tests
GH Actions: test with different sets of extensions
2024-10-02 08:41:43 +02:00
jrfnl 6b2e692d45
GH Actions: test with different sets of extensions
PHP 8.4 removes the IMAP extension (moved to PECL).

With this in mind, I've reviewed how the tests are being run versus the extension requirements and recommendations.

As things are, the tests are currently run in the "ideal" environment, i.e. with all required and optional extensions available.

However, the codebase also contains fall-backs for when certain extensions are **_not_** available and for at least some of those fallbacks, there are dedicated tests available, but in an ideal environment those tests will not run and the fall-backs are not tested, which is the case with the current CI setup.

To improve this situation, I'm proposing to keep running the tests against all PHP versions with the "ideal" extension set, but to also have additional test runs with a far more limited set of PHP extensions.

To determine which extensions should be in each set, I've looked at the following:
* `@requires` tags found in the test suite and the conditions for calls to `markTestSkipped()`.
    This brought to light that the `openssl` extension was currently not listed in the "ideal" extension set. This has now been fixed.
* The required extensions of PHPUnit - `dom, json, libxml, mbstring, tokenizer, xml, xmlwriter`.
* The required extensions of PHPMailer itself - `ctype, filter, hash`.
* Not strictly required, but more for convenience/workflow speed: `curl` for Composer.
* And `xdebug` will still be enabled/disabled based on the `coverage` setting.

Note: while some tests would benefit from being run _without_ the `mbstring` extension, that's unfortunately not an option as `mbstring` is a requirement of PHPUnit 🤷

Also note, the tests with the "minimal" extension setup needs to run `composer install` with an `--ignore-platform-req` flag to prevent running into the following issue:
```
Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.
```

As this extension "requirement" is for a dependency which is not used in the test run, the extension requirement can be safely ignored.
2024-09-18 17:34:12 +02:00
Marcus Bointon 81599d1554
Merge pull request #3094 from jrfnl/feature/testGivenIdnAddress-set-requirements
PHPMailerTest::testGivenIdnAddress...(): set test requirements
2024-09-18 16:27:31 +02:00
jrfnl 6028776a63
PHPMailerTest::testGivenIdnAddress...(): set test requirements
As per the discussion in 3092, this commit removes the `fakefunctions.php` file and adds explicit requirements for the `PHPMailerTest::testGivenIdnAddress_addAddress_returns_true()` test method.

Closes 3092
2024-09-12 09:11:34 +02:00
Marcus Bointon b554b1e6ca
Merge pull request #3091 from jrfnl/feature/tests-fix-dkim-test
DKIMTest: two fixes for tests for when OpenSSL is disabled/unavailable
2024-09-12 08:43:06 +02:00
jrfnl 78146fb172
DKIMTest::testDKIMSignOpenSSLNotAvailable(): fix the test
As things were, the `DKIMTest::testDKIMSignOpenSSLNotAvailable()` could not pass as the `DKIMTest` class sets the `USE_EXCEPTIONS` class constant to `true`, which means the method would fail on an exception.

As this test is specifically about testing the behaviour when exceptions are _disabled_, the test needs to be in its own test class, which sets `USE_EXCEPTIONS` to `false`.

That should allow the test to run properly and to pass.
2024-09-11 21:05:02 +02:00
jrfnl 10f76cd790
DKIMTest: make exception expectation more specific
As things were, the `DKIMTest::testDKIMSignOpenSSLNotAvailableException()` test _could_ potentially pass even when another `Exception` than the `PHPMailer\PHPMailer\Exception` was being thrown, as _all_ exceptions extend the PHP native `Exception` class.
Now this risk is not that high, as there is also a check on the exception message, but still.

Making the exception expectation more specific (by changing the import `use` statement), should still make the test more stable.
2024-09-11 21:05:02 +02:00
Marcus Bointon aaddfdf6ec
Merge pull request #3090 from jrfnl/feature/composer-no-lock
Composer: prevent a lock file from being created
2024-09-11 19:07:10 +02:00
jrfnl 3a8e00e4dc
Composer: prevent a lock file from being created
Composer 1.10.0 introduced a `lock` config option, which, when set to `false` will prevent a `composer.lock` file from being created and will ignore it when one exists.

This is a useful option for packages like PHPMailer where the `lock` file has no meaning.

It also makes life more straight-forward for contributors as they don't have to remember that for this repo they should use `composer update` instead of `composer install`. Both will now work the same.

Refs:
https://getcomposer.org/doc/06-config.md#lock
2024-09-11 18:20:45 +02:00
Marcus Bointon 6acfa78df6
Merge pull request #3083 from murongshaozong/master
chore: fix some comments
2024-08-13 10:38:49 +02:00
murongshaozong 19989e4165 chore: fix some comments
Signed-off-by: murongshaozong <netease163@icloud.com>
2024-08-13 15:07:00 +08:00
Marcus Bointon 3d01e8e5ea
Merge pull request #3079 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-2.4.0
GH Actions: Bump ossf/scorecard-action from 2.3.1 to 2.4.0
2024-07-29 15:41:38 +02:00
dependabot[bot] a93c0f2eb1
GH Actions: Bump ossf/scorecard-action from 2.3.1 to 2.4.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](0864cf1902...62b2cac7ed)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-29 06:02:58 +00:00
Marcus Bointon 4a171fd017
Update changelog.md 2024-07-20 16:03:33 +02:00
Marcus Bointon e6d79a4853
Merge pull request #3074 from ProjectSoft-STUDIONIONS/patch-1
Full translation into Russian
2024-07-20 16:02:33 +02:00
ProjectSoft cad92ca7bd
Full translation into Russian 2024-07-20 16:48:39 +04:00
Marcus Bointon 47f3dbbec1
Merge pull request #3071 from decomplexity/patch-3
Additional operands for GoogleAPI for .json management
2024-07-04 19:06:38 +02:00
decomplexity e79d9f251b
Additional operands for GoogleAPI for .json management
V4.1.0 of the SendOauth2 wrapper introduces two new optional operands for the invocation of both the standard PHPMailer email application and for the complete replacement of a PHPMailer application by the wrapper SendOauth2A front-end. These operands allow the developer to specify a name for the .json credentials file and/or whether the wrapper should dynamically build this .json file or use an already-built one, created  either by Google (its standard download) or by the developer.
2024-07-04 17:18:57 +01:00
decomplexity 10f8e5a7a9
Additional operands for GoogleAPI for .json management
V4.1.0 of the SendOauth2 wrapper introduces two new optional operands for the invocation of both the standard PHPMailer email application and for the complete replacement of a PHPMailer application by the wrapper SendOauth2A front-end. These operands allow the developer to specify a name for the .json credentials file and/or whether the wrapper should dynamically build this .json file or use an already-built one, created  either by Google (its standard download) or by the developer.
2024-07-04 16:36:48 +01:00
Marcus Bointon 06e6e80713
Update UPGRADING.md 2024-05-16 10:22:19 +02:00
Marcus Bointon 829def3388
Update for Codecov token handling change 2024-04-09 11:06:30 +02:00
Marcus Bointon 7bbeaff562
Merge pull request #3013 from PHPMailer/dependabot/github_actions/codecov/codecov-action-4
GH Actions: Bump codecov/codecov-action from 3 to 4
2024-04-09 11:02:24 +02:00
Marcus Bointon e8135be763
Try to persuade postfix to install 2024-04-08 20:25:15 +02:00
Marcus Bointon bd0ac03cb2
Changelog 2024-04-08 20:11:42 +02:00
Marcus Bointon 4551149ba2
IDE help 2024-04-08 20:11:42 +02:00
Marcus Bointon fb317f2a36
Clean up 2024-04-08 20:11:41 +02:00
Marcus Bointon 41027807eb
Merge pull request #3027 from saqibsra/master
Add urdu language support
2024-04-08 20:02:15 +02:00
Marcus Bointon 3c7ed1e7c8
Merge pull request #3006 from arakim/master
Update phpmailer.lang-ja.php
2024-04-08 20:01:33 +02:00
Marcus Bointon 62ed471071
Update phpmailer.lang-ja.php
Remove breaks - this is not really PHP!
2024-04-08 20:00:47 +02:00
Marcus Bointon 400aeae82c
Merge pull request #3047 from axi/#3045
Remove potential ending line break when using edebug() with LoggerInterface
2024-04-08 19:11:49 +02:00
Alexis Urien 72df7924ae Remove potential ending line break when using edebug() with LoggerInterface 2024-04-08 10:06:16 -07:00
Alexis Urien 01db3e6b24 Remove potential ending line break when using edebug() with LoggerInterface 2024-04-08 08:52:41 -07:00
Alexis Urien df33c89c5b Remove potential ending line break when using edebug() with LoggerInterface 2024-04-08 08:40:09 -07:00
Marcus Bointon 49b4cedfec
Changelog 2024-04-01 23:04:03 +02:00
Marcus Bointon 683d3730fc
Restore trailing space 2024-04-01 22:55:32 +02:00
Marcus Bointon 8f98ddf086
Restore trailing space 2024-04-01 22:41:15 +02:00
Marcus Bointon dfa731a087
Check broken links, update for HTTPS everywhere 2024-04-01 20:48:10 +02:00
Marcus Bointon f74f3681a5
Changelog 2024-03-30 08:34:56 +01:00
Marcus Bointon 767b1cfb1f
Merge pull request #3042 from danicruz0415/danicruz0415-patch-1
Adds missing translations
2024-03-30 08:34:07 +01:00
danicruz0415 f6478428c7
Adds missing translations 2024-03-29 23:12:59 -05:00
Marcus Bointon a0dcf5f788
Changelog 2024-03-26 18:45:33 +01:00
Marcus Bointon d92d4040b4
Merge pull request #3038 from sbri/master
Update phpmailer.lang-tr.php
2024-03-26 18:42:47 +01:00
Marcus Bointon 7564ef3f41
Update phpmailer.lang-tr.php
No tabs
2024-03-26 18:40:58 +01:00
Marcus Bointon 539a94a608
Update phpmailer.lang-tr.php
Despite appearances, translation files are not actually treated as PHP code
2024-03-26 18:34:58 +01:00
Marcus Bointon 0ae9628228
Merge pull request #3041
Cleaned up OAuth example
2024-03-26 18:29:01 +01:00
Marcus Bointon 5d698fc44d
Cleanup 2024-03-26 18:26:42 +01:00
decomplexity 749e9a3a9d
OAuth2 for MSFT and Google API with authorization_code or client_credentials
Client secrets and X.509 certificates, $_SESSION 'state' and PKCE code exchanges, and creation on the fly of GoogleAPI's .json credentials files are supported.
2024-03-23 20:29:21 +00:00
sbri f526634b30
Update phpmailer.lang-tr.php 2024-03-20 16:04:18 +03:00
Mariusz Krzaczkowski da0212d7d4
Add cid default domain 2024-03-19 12:16:12 +01:00
Mariusz Krzaczkowski 6ec886b292
Add cid default domain 2024-03-15 17:27:41 +01:00
Marcus Bointon 579202e36f
Merge pull request #3028 from PHPMailer/dependabot/github_actions/ramsey/composer-install-3
GH Actions: Bump ramsey/composer-install from 2 to 3
2024-03-12 23:07:08 +01:00
Marcus Bointon 49a8caa76a
Merge pull request #3014 from PHPMailer/dependabot/github_actions/nick-invision/retry-3
GH Actions: Bump nick-invision/retry from 2 to 3
2024-03-12 23:06:55 +01:00
dependabot[bot] e6ca69847a
GH Actions: Bump ramsey/composer-install from 2 to 3
Bumps [ramsey/composer-install](https://github.com/ramsey/composer-install) from 2 to 3.
- [Release notes](https://github.com/ramsey/composer-install/releases)
- [Commits](https://github.com/ramsey/composer-install/compare/v2...v3)

---
updated-dependencies:
- dependency-name: ramsey/composer-install
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 06:56:31 +00:00
saqibsra 77515b997c Add urdu language support 2024-03-02 17:24:28 +05:00
Yurun d6bfb496c1 Fix cannot access protected method 2024-02-19 09:57:30 +08:00
dependabot[bot] 52d55bf5ab
GH Actions: Bump nick-invision/retry from 2 to 3
Bumps [nick-invision/retry](https://github.com/nick-invision/retry) from 2 to 3.
- [Release notes](https://github.com/nick-invision/retry/releases)
- [Changelog](https://github.com/nick-fields/retry/blob/master/.releaserc.js)
- [Commits](https://github.com/nick-invision/retry/compare/v2...v3)

---
updated-dependencies:
- dependency-name: nick-invision/retry
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 06:39:47 +00:00
dependabot[bot] dc4f2e3418
GH Actions: Bump codecov/codecov-action from 3 to 4
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 06:39:41 +00:00
Marcus Bointon 5251d33124
Escape refresh token 2024-01-31 23:05:36 +01:00
Marcus Bointon 6939bf9828
Changelog 2024-01-25 10:36:39 +01:00
Marcus Bointon 760bb5fd27
Add link to aboutmy.email 2024-01-25 10:36:31 +01:00
ARAKI Musashi 26f72ad6c7
Update phpmailer.lang-ja.php
Added translation of untranslated parts.
2024-01-15 00:47:54 +09:00
Marcus Bointon 0f0b5a9560
Changelog 2024-01-09 19:35:32 +01:00
Marcus Bointon 2410f43d8c
Dots need escaping 2024-01-09 19:31:07 +01:00
JeiHO 0f9159e0bf
Update of PHPDoc comment of the addOrEnqueueAnAddress function
Update of PHPDoc comment of the addOrEnqueueAnAddress function
2024-01-05 10:26:39 -06:00
Marcus Bointon 5372c1694d
Merge pull request #2996 from PHPMailer/dependabot/github_actions/actions/upload-artifact-4
GH Actions: Bump actions/upload-artifact from 3 to 4
2023-12-18 08:46:07 +01:00
Marcus Bointon e81afe7cc1
Merge pull request #2995 from PHPMailer/dependabot/github_actions/github/codeql-action-3
GH Actions: Bump github/codeql-action from 2 to 3
2023-12-18 08:45:50 +01:00
dependabot[bot] 2b95ac8a56
GH Actions: Bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 06:16:47 +00:00
dependabot[bot] 8c65fb5bae
GH Actions: Bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 06:16:42 +00:00
Marcus Bointon d69114c1eb
Merge pull request #2992 from Blue3957/master
Fixed incorrect past participle agreement in phpmailer.lang-fr.php
2023-12-06 20:15:38 +01:00
Arthur Boucher 6b48444598
Fixed incorrect past participle agreement in phpmailer.lang-fr.php 2023-12-06 14:46:24 +01:00
Marcus Bointon 039de174cd
6.9.1 2023-11-25 23:23:28 +01:00
Marcus Bointon 3190bef442
CS 2023-11-25 23:23:18 +01:00
Marcus Bointon d327514f47
Merge pull request #2985 from decomplexity/patch-1
Create sendoauth2.phps
2023-11-25 23:19:50 +01:00
Marcus Bointon 934f852bfa
PHPMailer 6.9.0 2023-11-25 23:16:39 +01:00
Marcus Bointon 1a7d9e3739
Suggest SendOauth2 package 2023-11-25 23:16:03 +01:00
Marcus Bointon bffe2907d2
Update readme for XOAUTH2 changes 2023-11-25 23:13:05 +01:00
Marcus Bointon e443047d03
Don't need this to demo xoauth 2023-11-25 23:04:59 +01:00
Marcus Bointon d5615bffb4
Merge pull request #2986 from frankforte/custom-headers
Improvements for `clearCustomHeader` and `replaceCustomerHeader`
2023-11-25 23:02:29 +01:00
Frank Forte 8a91dd64f4 Code formatting for custom header methods. 2023-11-25 13:48:53 -05:00
Frank Forte b0ffd67775 Update replaceCustomerHeader to remove duplicates. Improve clearCustomHeader and relaceCustomHeader to handle name: value. 2023-11-25 12:37:07 -05:00
decomplexity 5a52bddc48
Update sendoauth2.phps
Updated from @synchro's comments
2023-11-24 19:18:36 +00:00
decomplexity fd0e447995
Create sendoauth2.phps
OAuth2 authentication for both Microsoft 365 Exchange email and Google Gmail. Client secrets and X.509 certificates are supported for Exchange. Client secrets are supported for Gmail. Authorization_code grant flow and client_credentials grant flow for SMTP are supported for Exchange. Authorization_code grant flow is supported for Gmail.
2023-11-23 19:43:26 +00:00
Marcus Bointon 677ff5b2f9
CS 2023-11-23 12:12:10 +01:00
Marcus Bointon dd16b7d95b
Add use of replaceCustomHeader in mailing list example, see #2981 2023-11-23 11:59:21 +01:00
Marcus Bointon 718eebd676
Merge pull request #2799 from chapeupreto/add-editorconfig
Add .editorconfig file
2023-11-23 09:22:25 +01:00
Marcus Bointon 32f7a11a7b
Merge pull request #2951 from Manish4586/master
Add translations for bn and as
2023-11-23 09:21:28 +01:00
Marcus Bointon 66b6c7e97d
Merge pull request #2971 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-2.3.1
GH Actions: Bump ossf/scorecard-action from 2.2.0 to 2.3.1
2023-11-23 09:15:16 +01:00
Marcus Bointon 7071666cf4
Merge pull request #2952 from PHPMailer/dependabot/github_actions/actions/checkout-4
GH Actions: Bump actions/checkout from 3 to 4
2023-11-23 09:14:44 +01:00
Marcus Bointon 3104b10d73
Merge pull request #2852 from mta59066/xclient
XCLIENT implementation
2023-11-23 09:12:59 +01:00
Marcus Bointon b4bda44618
Merge pull request #2983 from jrfnl/feature/ghactions-minor-tweaks
GH Actions: update a few links in inline comments
2023-11-23 09:10:14 +01:00
Marcus Bointon 355acdeb61
Merge pull request #2982 from jrfnl/feature/ghactions-php-8.3-update
GH Actions: update for release of PHP 8.3
2023-11-23 09:09:20 +01:00
jrfnl e503535644
GH Actions: update a few links in inline comments
... as the old URLs are no longer valid.
2023-11-23 04:15:40 +01:00
jrfnl 23f8374f89
GH Actions: update for release of PHP 8.3
... which is expected later today.
2023-11-23 04:14:54 +01:00
Marcus Bointon f2798a387d
Merge pull request #2981 from frankforte/custom-headers
Add methods to update or clear custom headers by name.
2023-11-22 18:25:52 +01:00
Frank Forte beb87e3cf7 validate value in replaceCustomHeader 2023-11-22 12:02:49 -05:00
Frank Forte 174653aa27 Add methods to update or clear custom headers by name. 2023-11-22 11:35:33 -05:00
Marcus Bointon 9952101e44
Wrong word 2023-11-17 10:59:11 +01:00
Marcus Bointon cbe9d8d9a9
CS 2023-11-08 19:16:12 +01:00
Marcus Bointon 666af00c0d
Changelog 2023-11-08 19:15:27 +01:00
Marcus Bointon 4da71db8ce
CS 2023-11-08 19:15:08 +01:00
Marcus Bointon c87abc860c
Don't attempt to use opportunistic TLS when connecting to localhost 2023-11-08 19:11:46 +01:00
Marcus Bointon b7dd089735
CS 2023-11-08 09:47:00 +01:00
Marcus Bointon b11a4512de
Update SMTP subclass example 2023-11-08 09:44:16 +01:00
Marcus Bointon ee4090bd62
Merge pull request #2972 from Saibamen/pl_lang_update 2023-10-31 23:08:15 +01:00
Adam Stachowicz 5ac1b59b78 Update polish language 2023-10-31 20:17:58 +01:00
dependabot[bot] a26a3cb738
GH Actions: Bump ossf/scorecard-action from 2.2.0 to 2.3.1
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.2.0 to 2.3.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](08b4669551...0864cf1902)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 06:08:11 +00:00
Marcus Bointon 8dd6558620
Merge pull request #2968 from mcardle/master
Updated da language with buggy_php string identifier
2023-10-21 15:49:12 +02:00
Ulrik McArdle 9bc85a1e6a Updated da language with buggy_php string identifier 2023-10-19 23:51:27 +02:00
Marcus Bointon a1fa2714c4
Merge pull request #2921 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-2.2.0
GH Actions: Bump ossf/scorecard-action from 2.1.3 to 2.2.0
2023-10-09 13:27:29 +02:00
Marcus Bointon b915445e7c
Merge pull request #2962 from HarshitSingh96/fix/trim-null-issue
fix: null issue in trim method
2023-10-03 00:25:03 +02:00
Marcus Bointon 358be9a467
CS and early continue
If it's null or empty, we know the next test will fail too, so continue straight away
2023-10-02 11:21:51 +02:00
Harshit Singh 9c5282e2a1 Review fix 2023-10-02 14:41:26 +05:30
Harshit Singh 0a385498db fix: null issue in trim method 2023-10-02 13:18:28 +05:30
dependabot[bot] edce283afc
GH Actions: Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 06:14:09 +00:00
Manish Sarkar 19cf0608d1
Add Assamese transtaltions
Adds [Assamese](https://en.wikipedia.org/wiki/Assamese_language) (ISO 639-1 `AS`) translations.
2023-09-05 14:47:22 +05:30
Manish Sarkar 21355d73f4
Add Bengali translations
Adds [Bengali](https://en.wikipedia.org/wiki/Bengali_language) (ISO 639-1 `BN`) translations.
2023-09-05 14:46:05 +05:30
Marcus Bointon e88da8d679
Fix test 2023-08-29 10:26:30 +02:00
Marcus Bointon 8db93b5190
6.8.1 2023-08-29 10:18:50 +02:00
Marcus Bointon 397a4d4a44
Don't reflect a malformed DSN in error messages. It's not necessary, and carries a distant risk of XSS in the host app. 2023-08-29 09:44:47 +02:00
Marcus Bointon fa59bf6cb1
Don't use setAccessible in PHP >= 8.1 2023-08-23 16:04:36 +02:00
Marcus Bointon 267d4e5793
Avoid deprecation warning in PHP 8.3 2023-08-23 16:04:03 +02:00
Marcus Bointon 71abcf9ca5
Comments 2023-08-23 16:02:49 +02:00
Marcus Bointon 57f994d89e
Merge pull request #2930 from Ayesh/lang/si
Add Sinhalese translations
2023-07-12 12:16:02 +02:00
Marcus Bointon 83fdb21ade
Merge pull request #2929 from Ayesh/readme/langtest-path-update
Readme: Update `PHPMailerLangTest` references to `TranslationCompletenessTest`
2023-07-12 08:54:29 +02:00
Ayesh Karunaratne aec8acc047
Add Sinhalese translations
Adds [Sinhalese](https://en.wikipedia.org/wiki/Sinhala_language) (ISO 639-1 `SI`) translations.
2023-07-12 11:48:43 +08:00
Ayesh Karunaratne b5d6e4ea16
Readme: Update `PHPMailerLangTest` references to `TranslationCompletenessTest`
In #2377, the `PHPMailerLangTest` test was renamed to `TranslationCompletenessTest`
along some optimizations. However, the link in `README.md` file still links
to the old file name.

This updates the `README.md` file to use the new file name and URL.
2023-07-12 11:16:56 +08:00
dependabot[bot] e184d1f92c
GH Actions: Bump ossf/scorecard-action from 2.1.3 to 2.2.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.3 to 2.2.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](80e868c13c...08b4669551)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 06:58:25 +00:00
Marcus Bointon 9d739fb137
Merge pull request #2918 from Colinax/master 2023-06-20 22:40:17 +02:00
Colinax 1da34f41e5 remove double LANG entrie 2023-06-20 20:10:07 +02:00
Colinax b7a3f6585d remove double LANG entries 2023-06-20 19:39:57 +02:00
Marcus Bointon 312ed95ab0
Merge pull request #2909 from wera-as/master
Update phpmailer.lang-nb.php
2023-06-08 11:54:07 +02:00
Adrian Thomassen 7c56070baf Update phpmailer.lang-nb.php
- Adjusted current translations.
- Added missing translations.
2023-06-08 11:50:41 +02:00
Marcus Bointon f8242e6ff7
Comment 2023-05-21 13:47:32 +02:00
Marcus Bointon 0925c239c5
Merge pull request #2905 from yaoyingkeji/patch-2
Supplemental Chinese Simplified translation。 phpmailer.lang-zh_cn.php
2023-05-08 19:33:19 +02:00
Marcus Bointon 2e7044c0cf
CS 2023-05-08 19:26:32 +02:00
深圳市耀影科技有限公司 7c4d4f4cba
Supplemental Chinese Simplified translation。 phpmailer.lang-zh_cn.php
Supplemental Chinese Simplified translation。
补充简体中文翻译
2023-05-09 01:14:43 +08:00
Marcus Bointon e062820e54
Merge pull request #2890 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-2.1.3
GH Actions: Bump ossf/scorecard-action from 2.1.2 to 2.1.3
2023-04-03 10:40:14 +02:00
dependabot[bot] 4ad37c38ce
GH Actions: Bump ossf/scorecard-action from 2.1.2 to 2.1.3
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](e38b1902ae...80e868c13c)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-03 06:59:05 +00:00
Marcus Bointon 2029eb194a
Merge pull request #2879 from jrfnl/feature/composer-update-dependencies
Composer: update some CS related dependencies
2023-03-06 10:23:26 -05:00
jrfnl a43c07c7ab
Composer: update some CS related dependencies
The Composer PHPCS plugin has released its 1.0.0 version. 🎉

As minors below a 1.0 are considered as majors by Composer, this needs an update to the `composer.json` file to get access to the new version.
And as PHPCS has also released a new version, may as well update that as well.

Refs:
* https://github.com/PHPCSStandards/composer-installer/releases/tag/v1.0.0
* https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.7.2
2023-03-06 16:18:31 +01:00
Marcus Bointon 43fcc67feb
Merge pull request #2878 from jrfnl/feature/ghactions-tweaks
GH Actions: minor simplification
2023-03-06 10:12:53 -05:00
jrfnl e64259b34c
GH Actions: minor simplification
... of the bash `date` command in the earlier pulled cache busting.
2023-03-06 16:09:18 +01:00
Marcus Bointon df16b615e3
6.8.0 2023-03-06 15:43:22 +01:00
Marcus Bointon 2eb68609f2
Handle some possible issues 2023-03-06 15:42:44 +01:00
Marcus Bointon eb746e54ce
Cleanup 2023-03-06 15:42:24 +01:00
Marcus Bointon 2e1298da84
Changelog 2023-03-06 15:21:17 +01:00
Marcus Bointon e939ca1381
Merge pull request #2874 from voronkovich/support-dsn
Support instantiating from DSN string
2023-03-05 16:23:38 -05:00
Oleg Voronkovich 9880a723a2 Make DSNConfigurator::parseUrl() protected 2023-03-06 00:06:17 +03:00
Oleg Voronkovich f164395cf4 Fix URL parsing for php 5.5 2023-03-03 21:58:22 +03:00
Oleg Voronkovich 62fdf0a80b Change default secure port to 465 2023-03-03 18:43:48 +03:00
Oleg Voronkovich 8bd07461d1 Fix typo in test method name 2023-03-03 18:37:37 +03:00
Oleg Voronkovich 25269b6431 Fix typo: Mailformed -> Malformed 2023-03-03 18:34:19 +03:00
Oleg Voronkovich 7ba61cf0f0 Use DSNConfigurator::mailer() shorcut instead of PHPMailer::fromDSN() 2023-03-03 18:23:59 +03:00
Oleg Voronkovich 1e560e0afd Fix CS 2023-03-03 18:05:12 +03:00
Oleg Voronkovich b92c374b87 Fix incompatibility with PHP 7.2 2023-03-03 17:58:22 +03:00
Oleg Voronkovich ecfef2e99c Fix assigment to static variable for old PHP versions 2023-03-03 17:53:50 +03:00
Oleg Voronkovich 067ff6e7c0 Fix CS 2023-02-20 21:58:48 +03:00
Oleg Voronkovich ecc11e3bf5 Add shortcut PHPMailer::fromDSN() 2023-02-20 20:32:16 +03:00
Oleg Voronkovich 10a9c18716 Improve code 2023-02-20 20:09:11 +03:00
Oleg Voronkovich c54e14ebbe Support query string options 2023-02-20 19:51:15 +03:00
Oleg Voronkovich 4ee7bfaf96 Improve tests 2023-02-20 18:46:15 +03:00
Oleg Voronkovich 52aebc52d5 Implement SMTP(s) configuration 2023-02-20 18:28:17 +03:00
Oleg Voronkovich 53442cc3f0 Implement base configuration 2023-02-20 17:47:19 +03:00
Oleg Voronkovich 2fc807cf0c Implment DSN parsing 2023-02-20 17:22:49 +03:00
Marcus Bointon abeba566ef
Merge pull request #2869 from jayantisuthar/master
Translating some hindi language keys.
2023-02-05 12:55:20 +01:00
jayanti suthar 1d330c7ec2 hindi language improvment 2023-02-04 23:39:58 +05:30
jayanti suthar 55d3bde2be update multi line string to single line in language file 2023-02-04 23:31:12 +05:30
jay suthar 3a4cbabdfb
Revert the gitignore not needed changes 2023-02-04 23:28:42 +05:30
jayanti suthar 98a2f2c803 Translating some hindi language keys. 2023-02-04 18:07:30 +05:30
Marcus Bointon 978b96c69b
Merge pull request #2864 from detain/master
Update for my previous ZoneMTA transaction id regex fixing the regex …
2023-01-19 17:55:24 +01:00
Joe Huss 4f3151fb32 Update for my previous ZoneMTA transaction id regex fixing the regex as the id does not have parenthesis surrounding it. 2023-01-19 11:09:25 -05:00
Marcus Bointon cc1f58caf3
Merge pull request #2863 from detain/master
added SMTP Transaction ID regex for ZoneMTA mailer
2023-01-19 16:59:53 +01:00
Joe Huss ba1d2b6831 added SMTP Transaction ID regex for ZoneMTA mailer 2023-01-19 10:46:06 -05:00
Mehmet Tolga Avcioglu 00e9d3b85a fix constant array for php5 2023-01-07 22:34:29 +03:00
Mehmet Tolga Avcioglu 08d74eb04b improve xclient 2023-01-06 16:03:08 +03:00
Mehmet Tolga Avcioglu 82dd9a01fb improve xclient 2023-01-06 15:59:03 +03:00
Mehmet Tolga Avcioglu b278bc3f1b protected xclient variable and added tests 2023-01-04 14:18:40 +03:00
Mehmet Tolga Avcioglu 6384753f6e protected xclient variable and added tests 2023-01-04 14:13:07 +03:00
Mehmet Tolga Avcioglu 75991e3e46 fix cs 2023-01-03 18:03:00 +03:00
Mehmet Tolga Avcioglu 3663260209
Merge branch 'PHPMailer:master' into xclient 2023-01-03 17:46:53 +03:00
Mehmet Tolga Avcioglu a57dc65962 initial xclient implementation 2023-01-03 17:46:09 +03:00
Marcus Bointon 7c38295b17
Merge pull request #2851 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-2.1.2 2022-12-26 16:32:03 +01:00
dependabot[bot] 2e21dd3778
GH Actions: Bump ossf/scorecard-action from 2.1.0 to 2.1.2
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.0 to 2.1.2.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](937ffa90d7...e38b1902ae)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-26 06:03:39 +00:00
Marcus Bointon 05060d446b
Merge pull request #2849 from campbell-m/master
Fixes the, admittedly rare, case when the display name is '0'.
2022-12-23 07:45:52 +01:00
campbell-m d1abc8d93a Addresses comment of @jrfnl 2022-12-22 21:45:11 +00:00
campbell-m 98a1af8ec7 Adds a test for addrFormat(). 2022-12-22 20:26:23 +00:00
campbell-m ac3f59f657 Fixes the, admittedly rare, case when the display name is '0'. 2022-12-20 20:45:14 +00:00
Marcus Bointon 9c20af3fe4
Merge pull request #2846 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-2.1.0
GH Actions: Bump ossf/scorecard-action from 2.0.6 to 2.1.0
2022-12-19 16:46:37 +01:00
dependabot[bot] 1a81c80dc9
GH Actions: Bump ossf/scorecard-action from 2.0.6 to 2.1.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.0.6 to 2.1.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](99c53751e0...937ffa90d7)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 06:04:12 +00:00
Marcus Bointon 49cd7ea3d2
6.7.1 2022-12-08 14:30:06 +01:00
Marcus Bointon 28848ef589
Need older annotations for PHP 5.5 2022-12-06 15:46:09 +01:00
Marcus Bointon f1b2d3d9d2
Merge branch 'master' into php-8.2 2022-12-06 15:37:34 +01:00
Marcus Bointon a15a02369f
Bump dev deps 2022-12-06 15:37:20 +01:00
Marcus Bointon 26e7dec83d
Add ext-openssl suggestion 2022-12-06 15:36:12 +01:00
Marcus Bointon a3ae6b622f
Support final PHP 8.2, add PHP 8.3 as experimental 2022-12-06 15:35:05 +01:00
Marcus Bointon 80fc8686fc
6.7 2022-12-05 11:56:35 +01:00
Marcus Bointon ac9eed5ee6
Changelog 2022-12-05 11:55:23 +01:00
Marcus Bointon ea03f4a60d
Try to resolve PHP 5.5 libsqlite issue 2022-12-05 11:51:29 +01:00
Marcus Bointon a25a4dc3e3
Run PHP 5.5 on older OS 2022-12-05 11:33:21 +01:00
Marcus Bointon 3a3f39fa70
Skip qmail 2022-12-05 11:27:54 +01:00
Marcus Bointon d2e9d097c1
Be noisy 2022-12-05 11:25:20 +01:00
Marcus Bointon 0447bfc3ae
Use systemd to stop postfix 2022-12-05 10:55:43 +01:00
Marcus Bointon 7a6ab223d8
Ignore failures when stopping postfix 2022-12-05 10:39:42 +01:00
Marcus Bointon 5419bf1e4b
Wait longer between retries 2022-12-05 10:36:27 +01:00
Marcus Bointon 7418a75f7e
Run tests on Ubuntu 22.04 2022-12-05 10:29:29 +01:00
Marcus Bointon a269e44376
Changelog 2022-12-05 10:03:05 +01:00
Marcus Bointon f34724c468
CS 2022-12-05 10:02:50 +01:00
Marcus Bointon c033268049
Break out setting MIME boundaries into a protected method, fixes #2511 2022-12-05 10:01:24 +01:00
Marcus Bointon 12e5c0c6f6
Drop MIME preamble to match common email client behaviour, see #1352 2022-12-05 09:24:58 +01:00
Marcus Bointon 3228f11fb4
Don't strip non-break trailing whitespace during simple DKIM canonicalisation, fixes #2837 2022-12-05 08:37:57 +01:00
Marcus Bointon 0064f26786
Merge pull request #2830 from dotdash/dont_trash_error_details_in_keepalive
Don't let RSET errors overwrite the original error
2022-11-22 10:54:08 +01:00
Björn Steinbrink 4588e44e9b Don't let RSET errors overwrite the original error
On keep-alive connections, we issue an RSET command in case of errors.
But that RSET command may fail, which causes the error information from
the original error to be replaced by the error information from the
RSET error, which isn't helpful in diagnosing the actual cause. To avoid
this problem, we need to extract the error information first, and only
issue the RSET command afterwards.
2022-11-22 10:08:10 +01:00
Marcus Bointon 5f61e3dae7
Cast ini value to avoid coercion, fixes #2827 2022-11-18 10:17:08 +01:00
Marcus Bointon 1ca85b6116
Bump phpcs version to avoid dev issues on PHP 8.1 2022-11-18 10:16:31 +01:00
Marcus Bointon e7bd0d1f6d
Add return type annotation 2022-11-14 10:58:16 +01:00
Marcus Bointon 0b37477f02
Update Stack Overflow link 2022-11-08 08:48:31 +01:00
Marcus Bointon f8d9b332bf
Merge pull request #2821 from jrfnl/feature/ghactions-cache-busting
GH Actions: bust the cache semi-regularly
2022-11-04 23:33:13 +01:00
jrfnl 52f7e741ec
GH Actions: bust the cache semi-regularly
Caches used in GH Actions do not get updated, they can only be replaced by a different cache with a different cache key.

Now the predefined Composer install action this repo is using already creates a pretty comprehensive cache key:

> `ramsey/composer-install` will auto-generate a cache key which is composed of
the following elements:
> * The OS image name, like `ubuntu-latest`.
> * The exact PHP version, like `8.1.11`.
> * The options passed via `composer-options`.
> * The dependency version setting as per `dependency-versions`.
> * The working directory as per `working-directory`.
> * A hash of the `composer.json` and/or `composer.lock` files.

This means that aside from other factors, the cache will always be busted when changes are made to the (committed) `composer.json` or the `composer.lock` file (if the latter exists in the repo).

For packages running on recent versions of PHP, it also means that the cache will automatically be busted once a month when a new PHP version comes out.

### The problem

For runs on older PHP versions which don't receive updates anymore, the cache will not be busted via new PHP version releases, so effectively, the cache will only be busted when a change is made to the `composer.json`/`composer.lock` file - which may not happen that frequently on low-traffic repos.

But... packages _in use_ on those older PHP versions - especially dependencies of declared dependencies - may still release new versions and those new versions will not exist in the cache and will need to be downloaded each time the action is run and over time the cache gets less and less relevant as more and more packages will need to be downloaded for each run.

### The solution

To combat this issue, a new `custom-cache-suffix` option has been added to the Composer install action in version 2.2.0.
This new option allows for providing some extra information to add to the cache key, which allows for busting the cache based on your own additional criteria.

This commit implements the use of this `custom-cache-suffix` option for all relevant workflows in this repo.

Refs:
* https://github.com/ramsey/composer-install/#custom-cache-suffix
* https://github.com/ramsey/composer-install/releases/tag/2.2.0
2022-11-04 20:30:01 +01:00
Marcus Bointon a5bc7ddba9
Merge pull request #2814 from czirkoszoltan/avoid-error-message-when-could-not-connect
Avoid POP3 client error message when TCP connection failed
2022-10-27 22:24:18 +02:00
Czirkos Zoltan c6e066d061 Fix bugs in POP3 test
runfakepopserver.sh expects fakepopserver.sh to be in the working
directory, therefore the tests in PopBeforeSmtpTest have to chdir()
to the test directory first.

The line in fakepopserver.sh echoing Bye needed -en arguments for
echo to process character escapes.
2022-10-26 20:18:42 +02:00
Czirkos Zoltan b4b493c8f3 Avoid POP3 client error message when TCP connection failed
The disconnect() method throws a TypeError when the TCP
connection cannot be created. Error and trace:

fgets(): Argument #1 ($stream) must be of type resource, bool given

phpmailer/phpmailer/src/POP3.php(372): fgets()
phpmailer/phpmailer/src/POP3.php(345): PHPMailer\PHPMailer\POP3->getResponse()
phpmailer/phpmailer/src/POP3.php(230): PHPMailer\PHPMailer\POP3->disconnect()
PHPMailer\PHPMailer\POP3->authorise()

Reproduce with:

include __DIR__ . "/POP3.php";
\PHPMailer\PHPMailer\POP3::popBeforeSmtp('doesnotexist', 110);
2022-10-26 18:41:16 +02:00
Marcus Bointon 00b7f5162a
Merge pull request #2798 from czirkoszoltan/add-newline-after-pop3-quit
Add line ending \n after POP3 quit command
2022-10-25 16:44:55 +02:00
Marcus Bointon b18c6e4b2a
Merge pull request #2808 from glodzienski/master
Translating some spanish language keys.
2022-10-25 16:41:29 +02:00
Marcus Bointon a42b4e4906
Merge pull request #2804 from jrfnl/feature/ghactions-harden-cs-steps
GH Actions: harden the workflow against PHPCS ruleset errors
2022-10-25 16:37:41 +02:00
Marcus Bointon 31c59466bd
Merge pull request #2805 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-2.0.6
GH Actions: Bump ossf/scorecard-action from 2.0.4 to 2.0.6
2022-10-25 16:37:07 +02:00
Glodzienski a48797717d
Updating author doc 2022-10-24 23:11:15 -03:00
Glodzienski 5902472c9e
Translating some spanish language keys. 2022-10-24 23:08:18 -03:00
dependabot[bot] c7e3d7302d
GH Actions: Bump ossf/scorecard-action from 2.0.4 to 2.0.6
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.0.4 to 2.0.6.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](e363bfca00...99c53751e0)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-24 06:16:13 +00:00
jrfnl 86fe1f6403
GH Actions: harden the workflow against PHPCS ruleset errors
If there is a ruleset error, the `cs2pr` action doesn't receive an `xml` report and exits with a `0` error code, even though the PHPCS run failed (though not on CS errors, but on a ruleset error).

This changes the GH Actions workflow to allow for that situation and still fail the build in that case.
2022-10-23 11:26:12 +02:00
Marcus Bointon 3e38b34669
Merge pull request #2793 from greew/ticket_2788/azure_xoauth2
Added Azure XOAUTH2 help and examples
2022-10-16 21:24:02 +02:00
Marcus Bointon 754ea93edb
Merge pull request #2800 from jrfnl/feature/ghactions-dont-use-set-output
GH Actions: fix use of deprecated `set-output`
2022-10-14 23:16:42 +02:00
jrfnl 70cbf85efe
GH Actions: fix use of deprecated `set-output`
GitHub has deprecated the use of `set-output` (and `set-state`) in favour of new environment files.

This commit updates the test workflows to avoid `set-output`.

Refs:
* https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
* https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
2022-10-14 23:08:47 +02:00
Rod Elias 7e7a1a05e0
Add .editorconfig file
See: https://editorconfig.org/
2022-10-13 19:04:21 -03:00
Czirkos Zoltan 4283eb9720 Add line ending \n after POP3 quit command
This is required by some POP3 servers which will wait until
a newline char which is delimiting all commands. Without it,
the login works, but it waits for the full timeout.
2022-10-12 17:47:41 +02:00
Marcus Bointon 12bb746eff
Merge pull request #2796 from jrfnl/feature/ghactions-tweak-action-runner-version-tags
GH Actions: use semver branch/tag references instead of commit references
2022-10-11 13:46:45 +02:00
jrfnl 5a8c04a9d6
GH Actions: use semver branch/tag references instead of commit references
Most predefined action runners offer a long-running branch or a tag which gets moved every release to allow staying on the "latest" version of a certain major of their action, without having to update the workflow scripts on every release of the action runner.

This works well for action runners which follow semver.

I've reviewed the existing workflows and tweaked the versions used whenever possible to make optimal use of this.

* For the `ossf/scorecard-action` action runner, I have not been able to find a workable tag/branch to fix this on.
    Note: I have remove the "# v1.1.1" comment though as it doesn't get updated by Dependabot and was sorely out of date (you are currently on version `2.0.4`).

With the changes in this PR, Dependabot should become less noisy and will only send in PRs to update the action runner versions when a new major release has been tagged. (save for the one exceptions mentioned above)

I would recommend watching the following repos for new releases:
* https://github.com/actions/checkout
* https://github.com/actions/upload-artifact
* https://github.com/shivammathur/setup-php
* https://github.com/ramsey/composer-install
* https://github.com/nick-fields/retry
* https://github.com/codecov/codecov-action
* https://github.com/JamesIves/github-pages-deploy-action
* https://github.com/ossf/scorecard-action
* https://github.com/github/codeql-action

This will ensure you will get an email with the changelogs for those action runners on all releases, so you can still monitor for changes in the action runners you need to be aware of.
2022-10-10 19:23:47 +02:00
Jesper Skytte 849615e819
D'oh - forgot to add the example file 2022-10-08 08:02:06 +02:00
Jesper Skytte 405e5dd94a
Added Azure XOAUTH2 help and examples 2022-10-07 22:34:23 +02:00
Marcus Bointon cbfcd1f8b8
Merge pull request #2792 from sriram-km/sri-ram-contribution
Fixed gramatical errors in README.md
2022-10-07 15:55:40 +02:00
Sri Ram f035ad9db8 Fixed gramatical errors in README.md 2022-10-07 18:39:34 +05:30
Marcus Bointon 8b6386d741
6.6.5 2022-10-07 14:23:10 +02:00
Marcus Bointon 0ca9768e59
Merge pull request #2791 from Aeka123/master
Add missing translations to danish language file
2022-10-06 17:43:51 +02:00
Esben Christian Volsgaard 4cc71741c8 Add missing translations to danish language file 2022-10-06 17:40:49 +02:00
Marcus Bointon 3a407c6afb
Merge pull request #2790 from KaminskiDaniell/patch-1
Update phpmailer.lang-pl.php
2022-10-06 11:38:09 +02:00
Daniel Kamiński 46b8da84ab
Update phpmailer.lang-pl.php
I have made a few grammatical corrections in the translation of Polish
2022-10-06 11:21:30 +02:00
Marcus Bointon 45620a96c3
Merge pull request #2787 from dazsim/fix-overwritten-error-message-on-close
fix bug error message supressed on close()
2022-10-04 11:04:01 +02:00
Marcus Bointon b59b64d35d
Merge pull request #2786 from dazsim/fix-addAttachment-folder-bug
fix bug in addAttachment with folder's instead of filenames
2022-10-04 11:02:55 +02:00
Marcus Bointon 91c442fccd
Add failing test for #2786 2022-10-04 11:02:03 +02:00
Darren Sim fddd95c23e fix bug error message supressed on close() 2022-10-04 00:20:49 +01:00
Darren Sim c4ed6172a5 fix bug in addAttachment with folder's instead of filenames 2022-10-04 00:04:01 +01:00
Marcus Bointon 29cdd9af52
Merge pull request #2784 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-2.0.4
GH Actions: Bump ossf/scorecard-action from 2.0.3 to 2.0.4
2022-10-03 21:05:11 +02:00
Marcus Bointon b90af7177d
Merge pull request #2783 from PHPMailer/dependabot/github_actions/github/codeql-action-2.1.26
GH Actions: Bump github/codeql-action from 2.1.24 to 2.1.26
2022-10-03 21:04:58 +02:00
Marcus Bointon 858a4c8992
Merge pull request #2785 from nexxai/master
Typofixes
2022-10-03 21:03:34 +02:00
JT Smith b894719a4c
Fixing auto-formatting 2022-10-03 12:23:05 -06:00
JT Smith ef36a69e0e Typofixes 2022-10-03 12:21:21 -06:00
dependabot[bot] d579dc362a
GH Actions: Bump ossf/scorecard-action from 2.0.3 to 2.0.4
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](865b409285...e363bfca00)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 06:17:55 +00:00
dependabot[bot] 56ce2fd740
GH Actions: Bump github/codeql-action from 2.1.24 to 2.1.26
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.24 to 2.1.26.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](904260d7d9...e0e5ded33c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 06:17:51 +00:00
Marcus Bointon df88e14dba
Merge pull request #2770 from PHPMailer/dependabot/github_actions/github/codeql-action-2.1.24
GH Actions: Bump github/codeql-action from 2.1.22 to 2.1.24
2022-09-21 17:14:16 +02:00
dependabot[bot] de69dfc97f
GH Actions: Bump github/codeql-action from 2.1.22 to 2.1.24
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.22 to 2.1.24.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b398f525a5...904260d7d9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-21 13:49:27 +00:00
Marcus Bointon 165f449f4b
Merge pull request #2773 from dotdash/dont_rset_on_connection_error
Don't try to issue RSET on connection errors
2022-09-21 15:38:24 +02:00
Marcus Bointon 7557f5d9c3
Merge pull request #2771 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-2.0.3
GH Actions: Bump ossf/scorecard-action from 2.0.2 to 2.0.3
2022-09-21 15:29:27 +02:00
Marcus Bointon d783947aba
Merge pull request #2772 from sashashura/patch-1
GitHub Workflows security hardening
2022-09-21 15:27:22 +02:00
Björn Steinbrink 703ad1052c Don't try to issue RSET on connection errors
In case of errors, keep-alive SMTP connections are always reset, but
when the error happened while establishing the connection, trying to
reset the connection is pointless and just produces another error.
2022-09-21 13:52:41 +02:00
Alex 01acbb66e0 build: harden tests.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-20 16:12:44 +02:00
Alex a09a739fd1 build: harden docs.yaml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-20 16:09:01 +02:00
dependabot[bot] a47284acc9
GH Actions: Bump ossf/scorecard-action from 2.0.2 to 2.0.3
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](68bf5b3327...865b409285)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-19 06:12:05 +00:00
Marcus Bointon 410086d03e
Merge pull request #2765 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-2.0.2
GH Actions: Bump ossf/scorecard-action from 1.1.2 to 2.0.2
2022-09-12 09:11:03 +02:00
dependabot[bot] 6105356343
GH Actions: Bump ossf/scorecard-action from 1.1.2 to 2.0.2
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 1.1.2 to 2.0.2.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](ce330fde6b...68bf5b3327)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 06:24:09 +00:00
Marcus Bointon f3a9d79c6c
Explicitly add codecov token to action, see https://github.com/codecov/codecov-action/issues/557 2022-09-06 22:56:42 +02:00
Marcus Bointon 88b2d6852c
Merge pull request #2763 from PHPMailer/dependabot/github_actions/github/codeql-action-2.1.22
GH Actions: Bump github/codeql-action from 2.1.21 to 2.1.22
2022-09-05 16:16:40 +02:00
dependabot[bot] 58a18c33f8
GH Actions: Bump github/codeql-action from 2.1.21 to 2.1.22
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.21 to 2.1.22.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](c7f292ea4f...b398f525a5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-05 14:15:08 +00:00
Marcus Bointon 21768617e2
Fix possible null param to explode, fixes #2760 2022-09-02 23:39:13 +02:00
Marcus Bointon 65661bcf15
Merge pull request #2759 from PHPMailer/dependabot/github_actions/github/codeql-action-2.1.21
GH Actions: Bump github/codeql-action from 2.1.19 to 2.1.21
2022-08-29 10:35:48 +02:00
dependabot[bot] 971792a11d
GH Actions: Bump github/codeql-action from 2.1.19 to 2.1.21
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.19 to 2.1.21.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f5d217be74...c7f292ea4f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-29 06:18:36 +00:00
Marcus Bointon a94fdebaea
6.6.4 2022-08-22 11:22:00 +02:00
Marcus Bointon a1d5d96831
Changelog 2022-08-22 10:25:31 +02:00
Marcus Bointon 971686b484
Case 2022-08-22 10:23:26 +02:00
Marcus Bointon a89e9248ca
Changelog 2022-08-22 10:12:09 +02:00
Marcus Bointon a5c499b539
Add OSSF scorecard badge 2022-08-22 10:11:50 +02:00
Marcus Bointon 6a8157c086
Merge pull request #2757 from PHPMailer/dependabot/github_actions/github/codeql-action-2.1.19
GH Actions: Bump github/codeql-action from 1.0.26 to 2.1.19
2022-08-22 10:01:45 +02:00
Marcus Bointon dfe2167f34
Merge pull request #2750 from PHPMailer/dependabot/github_actions/actions/upload-artifact-3.1.0
GH Actions: Bump actions/upload-artifact from 3.0.0 to 3.1.0
2022-08-22 10:01:32 +02:00
Marcus Bointon d4b5cd5cc0
Merge pull request #2748 from PHPMailer/dependabot/github_actions/ossf/scorecard-action-1.1.2
GH Actions: Bump ossf/scorecard-action from 1.1.1 to 1.1.2
2022-08-22 10:01:22 +02:00
Marcus Bointon 47adaac1b6
Merge pull request #2754 from sverpoorten/master
Bugfix invalid DKIM-signature with zero To-addresses
2022-08-22 10:00:56 +02:00
Marcus Bointon 6b7dc4edab
CS 2022-08-22 09:55:30 +02:00
Marcus Bointon 53d91d3016
CS 2022-08-22 09:51:34 +02:00
dependabot[bot] a66b21a875
GH Actions: Bump github/codeql-action from 1.0.26 to 2.1.19
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.26 to 2.1.19.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](5f53256358...f5d217be74)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-22 06:27:25 +00:00
sverpoorten 0bddcf9141
Bugfix invalid DKIM-signature with zero To-addresses
When using PHP's mail() function, and when there are no To-addressees (e.g. only BCC), then the DKIM-signature was not correct. There was a discrepancy between how mail() was called (empty $to) versus the DKIM-signature ('undisclosed-recipients:;').
2022-08-21 21:13:01 +02:00
dependabot[bot] 7b407e0c50
GH Actions: Bump actions/upload-artifact from 3.0.0 to 3.1.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](6673cd052c...3cea537223)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-15 06:21:16 +00:00
dependabot[bot] c15ff12611
GH Actions: Bump ossf/scorecard-action from 1.1.1 to 1.1.2
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](3e15ea8318...ce330fde6b)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-15 06:21:10 +00:00
Marcus Bointon fadcb6abe1
Create scorecards.yml
Add OSSF scorecard config
2022-08-11 13:32:11 +02:00
Marcus Bointon 21c5651c70
Merge pull request #2735 from PHPMailer/dependabot/github_actions/JamesIves/github-pages-deploy-action-4.4.0
GH Actions: Bump JamesIves/github-pages-deploy-action from 4.3.4 to 4.4.0
2022-07-25 09:32:02 +02:00
dependabot[bot] 5d4233bb1b
GH Actions: Bump JamesIves/github-pages-deploy-action
Bumps [JamesIves/github-pages-deploy-action](https://github.com/JamesIves/github-pages-deploy-action) from 4.3.4 to 4.4.0.
- [Release notes](https://github.com/JamesIves/github-pages-deploy-action/releases)
- [Commits](https://github.com/JamesIves/github-pages-deploy-action/compare/v4.3.4...v4.4.0)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 06:21:06 +00:00
Marcus Bointon a04c4c2d72
Clarify SMTP auth options, fixes #2732 2022-07-19 17:12:48 +02:00
Marcus Bointon fb45a2e39b
Use higher debug level when demonstrating TLS options 2022-07-09 17:03:22 +02:00
Marcus Bointon 4d44b65893
Merge pull request #2728 from evan70/master
trim(): Passing null to parameter  ($string) of type string is deprecated
2022-07-08 00:15:12 +02:00
Marcus Bointon 10a6e3ec25
Cleanup 2022-07-08 00:12:21 +02:00
evan70 26371755e6
Update PHPMailer.php 2022-07-07 23:45:52 +02:00
Marcus Bointon 34cafe9fc9
Changelog 2022-07-07 16:57:11 +02:00
Marcus Bointon cfede8fcbb
Merge pull request #2727 from Cleptomania/csv
Automatic text/csv detection
2022-07-07 16:54:52 +02:00
Darren Eberly 1eb0816252 Automatic text/csv detection 2022-07-07 10:47:06 -04:00
Marcus Bointon 375d77cef7
CS 2022-06-29 11:10:48 +02:00
Marcus Bointon c4a787bff7
CS 2022-06-29 11:09:55 +02:00
Marcus Bointon a4d8cf15ce
Add tests for #2723 2022-06-29 11:04:13 +02:00
Marcus Bointon 95f76e7588
Merge pull request #2723 from mortalys/string-verification-for-name
Verification is required
2022-06-29 10:39:29 +02:00
mortalys e5f9e2aefc
Verification is required 2022-06-29 09:20:16 +01:00
Marcus Bointon 9175946830
Merge pull request #2720 from PHPMailer/dependabot/github_actions/JamesIves/github-pages-deploy-action-4.3.4
GH Actions: Bump JamesIves/github-pages-deploy-action from 4.3.3 to 4.3.4
2022-06-27 09:42:01 +02:00
dependabot[bot] bad18bda11
GH Actions: Bump JamesIves/github-pages-deploy-action
Bumps [JamesIves/github-pages-deploy-action](https://github.com/JamesIves/github-pages-deploy-action) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/JamesIves/github-pages-deploy-action/releases)
- [Commits](https://github.com/JamesIves/github-pages-deploy-action/compare/v4.3.3...v4.3.4)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-27 06:20:15 +00:00
Marcus Bointon b8660e71ff
Changelog 2022-06-21 11:11:16 +02:00
Marcus Bointon 5b9b137b70
Merge pull request #2717 from panos78/patch-1
Update Greek translation
2022-06-21 11:10:08 +02:00
Panos 4bced5294f
Update Greek translation
Adding missing strings.
Enhancing existing strings for better understanding.
2022-06-21 08:22:02 +03:00
Marcus Bointon 9400f305a8
6.6.3 2022-06-20 11:21:02 +02:00
Marcus Bointon e6fbc528c5
Merge pull request #2714 from ZhangChengLin/master-zcl
ISO 639-1 Language code and content do not match
2022-06-20 11:16:35 +02:00
Marcus Bointon e39958ed89
Don't put this in .gitignore 2022-06-20 11:16:07 +02:00
Marcus Bointon ef60bd95dc
Update changelog.md 2022-06-19 13:59:42 +02:00
Marcus Bointon f06453cbed
Merge pull request #2306 from wispas/patch-1
Create phpmailer.lang-mgl.php
2022-06-19 13:59:00 +02:00
Marcus Bointon 090e168fa9
Cleanup 2022-06-19 13:55:57 +02:00
ZhangChengLin 2f7852929d Add IDE configuration directory ".idea" 2022-06-18 23:19:37 +08:00
ZhangChengLin 1023717ed7 ISO 639-1 Language code and content do not match 2022-06-18 22:58:35 +08:00
Marcus Bointon 52d82dbdef
Merge pull request #2459 from rx80/patch-1
Simplify use of get_oauth_token.php
2022-06-17 00:20:22 +02:00
Marcus Bointon 7599b516d4
Changelog 2022-06-17 00:20:04 +02:00
Marcus Bointon 54afdfecb5
CS 2022-06-17 00:17:12 +02:00
Marcus Bointon ac12a9de6e
cleanup 2022-06-17 00:11:49 +02:00
Marcus Bointon 2f4b684353
Merge pull request #2707 from MathiasReker/0-simplified-if-return
simplified if return
2022-06-16 20:36:39 +02:00
Marcus Bointon 77d4559c26
Cleanup 2022-06-16 20:33:55 +02:00
Marcus Bointon 4daa547921
Remove unnecessary cast
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
2022-06-16 20:17:10 +02:00
Marcus Bointon 70fde2aee4
Merge pull request #2713 from MathiasReker/0-no-superfluous-elseif
no superfluous elseif
2022-06-16 19:50:38 +02:00
Marcus Bointon 8fe6c1296d
Merge pull request #2710 from MathiasReker/0-explicit-indirect-variable
explicit indirect variable
2022-06-16 19:46:14 +02:00
MathiasReker b9b12cfc6d no superfluous elseif
Replaces superfluous elseif with if.
2022-06-16 19:35:23 +02:00
MathiasReker 998bfddd69 explicit indirect variable
Add curly braces to indirect variables to make them clear to understand.
2022-06-16 19:34:47 +02:00
MathiasReker 0747b8ca05 simplified if return
Simplify if control structures that return the boolean result of their condition.
2022-06-16 19:33:09 +02:00
Marcus Bointon a4d87ad5bd
CS 2022-06-15 22:15:55 +02:00
Marcus Bointon d610dddcf9
CS 2022-06-15 22:15:28 +02:00
Marcus Bointon 3aaac73c6d
Improve docs on addEmbeddedImage 2022-06-15 22:05:22 +02:00
Marcus Bointon b52ed06864
6.6.2 2022-06-14 11:27:21 +02:00
Marcus Bointon 2aa2bd20db
Try alternative docs publishing action 2022-06-14 11:14:49 +02:00
Marcus Bointon 7b46afb098
Merge pull request #2700 from jrfnl/feature/composer-update-parallel-lint-restraints
Composer: update PHP Parallel Lint and Console Highlighter
2022-06-14 10:59:28 +02:00
jrfnl 29177b4766
Composer: update PHP Parallel Lint and Console Highlighter
PHP Console Highlighter has released version `1.0.0` and PHP Parallel Lint version `1.3.2` is the first PHP Parallel Lint version which supports PHP Console Highlighter `1.0.0`.

As the minimum supported PHP version is still PHP 5.3 for both, we can safely update both dependency requirements.

Refs:
* https://github.com/php-parallel-lint/PHP-Console-Highlighter/releases/tag/v1.0.0
* https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases/tag/v1.3.2
2022-06-14 10:53:57 +02:00
Marcus Bointon 8819eba844
Merge pull request #2665 from jrfnl/feature/lint-show-deprecated
Composer script: show deprecations when linting and update lint dependencies
2022-06-14 10:49:01 +02:00
Marcus Bointon a4bf414da6
6.6.1 2022-06-14 10:19:03 +02:00
Marcus Bointon 0ad3a474af
Don't clear errors on RSET, fixes #2696 2022-06-14 10:17:49 +02:00
Marcus Bointon bf99c202a9
Avoid passing null to functions, fixes #2667 2022-04-12 10:05:58 +02:00
Marcus Bointon 88a21e101f
Merge pull request #2666 from PHPMailer/dependabot/github_actions/maxheld83/ghpages-0.3.0
GH Actions: Bump maxheld83/ghpages from 0.2.1 to 0.3.0
2022-04-07 22:33:00 +02:00
dependabot[bot] 8ab58f1d16
GH Actions: Bump maxheld83/ghpages from 0.2.1 to 0.3.0
Bumps [maxheld83/ghpages](https://github.com/maxheld83/ghpages) from 0.2.1 to 0.3.0.
- [Release notes](https://github.com/maxheld83/ghpages/releases)
- [Commits](https://github.com/maxheld83/ghpages/compare/v0.2.1...v0.3.0)

---
updated-dependencies:
- dependency-name: maxheld83/ghpages
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-07 20:19:01 +00:00
Marcus Bointon 3480465914
Merge pull request #2664 from jrfnl/feature/add-dependabot-config-for-ghactions
Add dependabot configuration file
2022-04-07 22:18:30 +02:00
jrfnl 38355bb140
Composer script: show deprecations when linting
While rare, there are some deprecations which PHP can show when a file is being linted.
By default these are ignored by PHP-Parallel-Lint.

Apparently though, there is an option to show them (wasn't documented until recently), so let's turn that option on.
2022-04-07 14:05:06 +02:00
jrfnl b7ba94e0f5
Add dependabot configuration file
This commit adds an initial Dependabot configuration to:
* Submit pull requests for security updates and version updates for GH Action runner dependencies.

At a later point in time, it could be considered to enable it for Composer dependencies as well.

The configuration has been set up to:
* Run weekly.
* Submit a maximum of 5 pull requests at a time.
    If additional pull requests are needed, these will subsequently be submitted the next time Dependabot runs after one or more of the open pull requests have been merged.
* The commit messages for PRs submitted by Dependabot will be prefixed with "GH Actions:" similar to previous PRs I've submitted manually for the same.
2022-04-07 14:04:02 +02:00
Marcus Bointon 0ddee75e3a
Merge pull request #2663 from jrfnl/feature/ghactions-update-codecov
GH Actions: version update for codecov action runner
2022-04-07 11:13:36 +02:00
jrfnl ee3570ea70
GH Actions: version update for codecov action runner
Yet another predefined action has had a major release.

This is, again, mostly just a change of the Node version used by the action itself (from Node 12 to Node 16).

Refs:
* https://github.com/codecov/codecov-action/releases
2022-04-05 23:49:50 +02:00
Marcus Bointon 0912769c66
#SlavaUkraini 2022-03-11 07:35:51 +01:00
Marcus Bointon 85350ad372
#SlavaUkraini 2022-03-11 07:33:49 +01:00
Marcus Bointon 76b348ebac
Fix test order 2022-03-08 22:39:06 +01:00
Marcus Bointon a3028ab03b
This wasn't actually testing BCC-only addressing! 2022-03-08 22:37:13 +01:00
Marcus Bointon c402bb4425
Merge pull request #2641 from jrfnl/feature/ghactions-update-various-actions
GH Actions: version update for various predefined actions
2022-03-05 23:58:38 +01:00
jrfnl 21856c00e5
GH Actions: version update for various predefined actions
A number of predefined actions have had major release, which warrant an update the workflow(s).

These updates don't actually contain any changed functionality, they are mostly just a change of the Node version used by the action itself (from Node 14 to Node 16).

Refs:
* https://github.com/actions/checkout/releases
2022-03-05 15:36:07 +01:00
Marcus Bointon e43bac82ed
Changelog 2022-02-28 16:31:21 +01:00
Marcus Bointon ce32116f3b
Merge pull request #2526 from miken32/master
Provide additional error details after connection failures
2022-02-28 16:08:19 +01:00
Marcus Bointon 3525f1b6da
Give up on that test config 2022-02-28 16:03:27 +01:00
Marcus Bointon 70c20c6324
Rearrange tests to deal with version issues 2022-02-28 15:48:25 +01:00
Marcus Bointon cb53dde517
6.6.0 2022-02-28 15:26:21 +01:00
Marcus Bointon 03649a2ffb
CS 2022-02-28 15:11:05 +01:00
Marcus Bointon ec421d0680
CS 2022-02-28 15:09:27 +01:00
Marcus Bointon d8002e5482
Add simple OAuthTokenProvider tests 2022-02-28 15:06:17 +01:00
Marcus Bointon 5a4f1f3a2a
Changelog 2022-02-28 14:36:07 +01:00
Marcus Bointon 2611db096a
Merge pull request #2524 from pdscopes/feature/oauth-interface
#2523 OAuth Interface
2022-02-28 14:32:31 +01:00
Marcus Bointon a24029b108
Add corrected @covers tag 2022-02-18 18:21:21 +01:00
Marcus Bointon c0d9f7dd3c
6.5.4 2022-02-17 09:19:04 +01:00
Marcus Bointon 7421ac9186
Changelog 2022-02-17 09:18:00 +01:00
Marcus Bointon a876f998bd
Avoid PHPUnit 4.8 issue in PHP 5.5! 2022-02-16 20:03:35 +01:00
Marcus Bointon 6f6ce4f34a
Add XMailer tests 2022-02-16 19:32:38 +01:00
Marcus Bointon b930f1587f
Rejig setting XMailer to avoid PHP 8.1 issue, fixes #2635 2022-02-16 19:32:11 +01:00
Marcus Bointon 7ac1bd3ac0
Restrict shell-based mailers if we can't use them safely, fixes #966 2022-02-16 17:39:25 +01:00
Marcus Bointon 7e1da4fae3
Merge pull request #2594 from jrfnl/feature/ghactions-update-codecov-action
GH Actions: version update for `codecov/codecov-action`
2022-02-05 01:15:49 +01:00
jrfnl a4cf5b6e89 GH Actions: version update for `codecov/codecov-action`
A while back the `codecov/codecov-action` released a new major.

As per the release notes:
> On February 1, 2022, the v1 uploader will be full sunset and no longer function. This is due to the deprecation of the underlying bash uploader. This version uses the new uploader.

Considering Feb 2022 is creeping closer every day, updating seems prudent.

> Multiple fields have not been transferred from the bash uploader or have been deprecated. Notably many of the `functionalities` and `gcov_` arguments have been removed.

This repo does not seem to be affected by this.

Refs:
* https://github.com/codecov/codecov-action/releases/tag/v2.0.0
* https://github.com/codecov/codecov-action/releases/tag/v2.0.1
* https://github.com/codecov/codecov-action/releases/tag/v2.0.2
* https://github.com/codecov/codecov-action/releases/tag/v2.0.3
* https://github.com/codecov/codecov-action/releases/tag/v2.1.0
2021-12-26 19:38:16 +01:00
Marcus Bointon d4bf3504b9
Merge pull request #2595 from jrfnl/feature/ghactions-update-actions-checkout
GH Actions: version update for `actions/checkout`
2021-12-26 19:26:31 +01:00
jrfnl fbfc9f2909 GH Actions: version update for `actions/checkout`
Ref: https://github.com/actions/checkout/releases
2021-12-26 00:39:36 +01:00
Marcus Bointon 8c952fb573
Merge pull request #2590 from jrfnl/feature/ghactions-update-composer-action 2021-12-24 10:08:01 +01:00
jrfnl 7fe0ce642b GH Actions: version update for `ramsey/composer-install`
The action used to install Composer packages and handle the caching has released a new major (and some follow-up patch releases), which means, the action reference needs to be updated to benefit from it.

Refs:
* https://github.com/ramsey/composer-install/releases/tag/2.0.0
* https://github.com/ramsey/composer-install/releases/tag/2.0.1
* https://github.com/ramsey/composer-install/releases/tag/2.0.2
2021-12-24 05:09:10 +01:00
Marcus Bointon efd3262af8
Merge pull request #2589 from jrfnl/feature/composer-allow-phpcs-plugin 2021-12-23 08:19:51 +01:00
jrfnl d94fd80848 Composer: allow the PHPCS plugin
The `dealerdirect/phpcodesniffer-composer-installer` Composer plugin is used to register external PHPCS standards with PHPCS.

As of Composer 2.2.0, Composer plugins need to be explicitly allowed to run. This adds the necessary configuration for that.

Refs:
* https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution
2021-12-23 03:05:11 +01:00
Marcus Bointon 8c7fe5e688
Merge pull request #2588 from nogaruki/patch-1
Update phpmailer.lang-fr.php
2021-12-22 19:56:30 +01:00
nogaruki f62d638c0b
Update phpmailer.lang-fr.php 2021-12-22 15:39:32 +01:00
Marcus Bointon a69cfb1860
Merge pull request #2584 from jrfnl/feature/php-8.2-fix
Bug fix for typo in property name (x2)
2021-12-18 17:51:36 +01:00
jrfnl 9c88a5ca9b Bug fix for typo in property name (x2)
The `$CharSet` property name as declared in the class starts with a capital, while there were two places in the code where the property was referred to as `$this->charSet`, which is a non-existent property.

In PHP 8.2, this is regarded as access to a dynamic property and will generate deprecation notices.

In effect, this meant that the `PHPMailer::parseAddresses()` method would be called with `null` as the value for the `$charset` parameter.
This `null` value would then subsequently be passed on to the PHP native `mb_internal_encoding()` function, which now didn't get the correct encoding.

This may have led to mail sending failures due to the address encoding being incorrect. If there are any bug reports open for this, it may be a good idea to evaluate whether they could be related to this bug.

Found by dseguy via Exakat.

Note: this issue was not flagged by the tests as the tests for the `PHPMailer::parseAddresses()` method, only test the method either with a valid value for encoding òr without the `$charset` parameter set, but not with an explicit `null` value..

As the `$charset` parameter for `PHPMailer::parseAddresses()` has a sensible default value and is not explicitly nullable, adding a test for this incorrect use of the method seems over the top.

I have, however, ensured that the non-nullability of the parameter is now documented for the method.

Refs:
* https://wiki.php.net/rfc/deprecate_dynamic_properties
* https://www.php.net/manual/en/function.mb-internal-encoding.php
2021-12-18 17:42:39 +01:00
Marcus Bointon ff796f28f6
Merge pull request #2583 from jrfnl/feature/composer-update-version-constraints
Composer: update version constraints
2021-12-18 17:12:27 +01:00
jrfnl d5a5ad19cd CS: minor cleanup
PHPCS 3.6.2 added a sniff for a PSR-12 rule which was previously not strictly checked: "No blank line after the opening brace of a class".

This fixes the newly flagged issues.
2021-12-18 04:08:22 +01:00
jrfnl 17cd8a8c11 Composer: update version constraints
Follow up on c1a6339108 which enabled PHP 8.1 support, let's make sure that the version constraints of (dev) dependencies are such that PHP 8.1 compatible versions will be installed.

Refs:
* https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases
* https://github.com/squizlabs/PHP_CodeSniffer/releases
2021-12-18 04:03:22 +01:00
Marcus Bointon a127e25118
Merge pull request #2578 from Fonata/patch-1
Add smtp_transaction_id pattern for Mailjet
2021-12-08 19:02:16 +01:00
Fonata 844c1fc933
Declare object variable $Smtp for PHP 8.2 compatibility
In PHP 8.2 dynamic property are deprecated.
2021-12-08 18:53:21 +01:00
Fonata 290b2e36d1
Add smtp_transaction_id pattern for Mailjet
Responses from the Mailjet servers look like this:  
`250 OK queued as a08b7f37-ed61-423a-ba75-38ed2fd4b54c`
2021-12-08 11:46:36 +01:00
Marcus Bointon d3f566012b
Fix bug in multiple file upload example, fixes #2569 2021-11-28 14:39:03 +01:00
Marcus Bointon baeb7cde6b
PHPMailer 6.5.3 2021-11-25 17:34:11 +01:00
Marcus Bointon 40ede8cc04
PHPMailer 6.5.2 2021-11-25 17:22:48 +01:00
Marcus Bointon c1a6339108
Enable PHP 8.1 2021-11-25 17:22:48 +01:00
Marcus Bointon 2649f9d70f Changelog 2021-11-19 19:33:09 +01:00
Marcus Bointon 1abbf09a3b CS 2021-11-19 19:32:01 +01:00
Marcus Bointon eaac722adf
Merge pull request #2564 from j-bernard/fix_2563
Fix #2563: Provide the right flags to IDN methods for email addresses conversion
2021-11-19 19:31:01 +01:00
Julien BERNARD 3c81f485df Fix #2563: Provide the right flags to IDN methods for email addresses conversion 2021-11-19 13:19:50 -05:00
Marcus Bointon e84b657160
Merge pull request #2558 from Fonata/patch-1
Improve spelling and code style in SMTP.php
2021-11-12 15:23:01 +01:00
Fonata 50cc644d0e
Avoid identical line in both `if` and `else` branch 2021-11-12 14:00:42 +01:00
Fonata 61d2d02515
Improve spelling in DocBlock 2021-11-12 13:59:28 +01:00
Fonata ea31254c41
Code style: explicit return value in getServerExt 2021-11-12 13:57:38 +01:00
Marcus Bointon 72c1e32d5e
Merge branch 'BlazOrazem/master' 2021-10-22 15:37:47 +02:00
Marcus Bointon ef4081ea99
Line breaks in translations are not supported as of 6.5.0 2021-10-22 15:37:35 +02:00
Marcus Bointon 477762e7fc
Merge branch 'patch-1' 2021-10-22 15:34:50 +02:00
Marcus Bointon 35e45fd907
Cleanup 2021-10-22 15:34:38 +02:00
Marcus Bointon 22376a8669
Merge branch 'ro_lang' 2021-10-22 15:29:26 +02:00
Marcus Bointon 8536acacef
Line breaks in translations are not supported as of 6.5.0 2021-10-22 15:28:45 +02:00
Marcus Bointon b52af5002c
Merge branch 'feature/update-translation-pt-br' 2021-10-22 15:24:15 +02:00
Marcus Bointon f0798e729a
Merge pull request #2531 from geidsonc/feature/update-translation-pt-br
Update language portuguese brazilian
2021-10-22 15:23:34 +02:00
Marcus Bointon 066dde51bd
Trailing break 2021-10-22 15:22:23 +02:00
Marcus Bointon 485a2b6fea
Line breaks in translations are not supported as of 6.5.0 2021-10-22 15:22:13 +02:00
Geidson Benicio Coelho af14a5f43e Update language portuguese brasilian 2021-10-22 02:29:03 -03:00
Alex 9d278f37d2 Update romanian translation 2021-10-21 18:42:03 +01:00
Marcus Bointon 537927b550
Fix for ini_get issue in PHP 5.6, fixes #2529 2021-10-20 16:39:14 +02:00
Machou a2bfc160b1
fr_FR update
I corrected the spaces with this one: U+202F

I don't understand the problem, can you please explain?
2021-10-12 04:50:06 +02:00
Michael Newton 05e70e859c throw exception with details for connection failures 2021-10-11 11:45:39 -04:00
Michael Newton 7b4e8cdf92 add details from SMTP::getError() to STARTTLS exceptions 2021-10-11 11:43:27 -04:00
Blaž Oražem 56051ae53d Fix some more styles 2021-10-11 16:41:36 +02:00
Blaž Oražem 3b01c7675c Fix styles 2021-10-11 16:38:00 +02:00
Blaž Oražem a7acec2ae7 Slovenian language update 2021-10-11 16:07:16 +02:00
Peter Scopes 6b5b318025 #2523 updates OAuthTokenProvider usage to gmail_xoauth.phps 2021-10-11 10:26:51 +01:00
Peter Scopes 21974a05a1 #2523 adds OAuthTokenProvider interface to allow for other oauth libraries 2021-10-11 09:44:18 +01:00
Marcus Bointon cbfe93b75a
CS 2021-10-04 17:20:23 +02:00
Marcus Bointon ca09c748ea
Merge pull request #2519 from miken32/master
POP3 cleanup
2021-10-04 17:15:39 +02:00
Michael Newton c01d14b8be
don't wait for checkResponse result before failing 2021-10-04 08:44:43 -06:00
Michael Newton dc854c4671
capture server response to QUIT command
and properly set `$connected` property to false
2021-10-04 08:40:32 -06:00
Marcus Bointon be98d62e36
Merge pull request #2510 from jrfnl/feature/phpunit-update-config
PHPUnit: update configuration
2021-09-26 22:35:36 +02:00
jrfnl 8732627d40 PHPUnit: update configuration
PHPUnit just released version 9.5.10 and 8.5.21.

This contains a particular (IMO breaking) change:

> * PHPUnit no longer converts PHP deprecations to exceptions by default (configure `convertDeprecationsToExceptions="true"` to enable this)

Let's unpack this:

Previously (PHPUnit < 9.5.10/8.5.21), if PHPUnit would encounter a PHP native deprecation notice, it would:
1. Show a test which causes a deprecation notice to be thrown as **"errored"**,
2. Show the **first** deprecation notice it encountered and
3. PHPUnit would exit with a **non-0 exit code** (2), which will fail a CI build.

As of PHPUnit 9.5.10/8.5.21, if PHPUnit encounters a PHP native deprecation notice, it will no longer do so. Instead PHPUnit will:
1. Show a test which causes a PHP deprecation notice to be thrown as **"risky"**,
2. Show the **all** deprecation notices it encountered and
3. PHPUnit will exit with a **0 exit code**, which will show a CI build as passing.

This commit reverts PHPUnit to the previous behaviour by adding `convertDeprecationsToExceptions="true"` to the PHPUnit configuration.

Refs:
* https://github.com/sebastianbergmann/phpunit/blob/9.5/ChangeLog-8.5.md
* https://github.com/sebastianbergmann/phpunit/blob/9.5/ChangeLog-9.5.md
2021-09-25 19:08:59 +02:00
Marcus Bointon 40a12618ea
Garbage removal! 2021-08-29 19:41:57 +02:00
Marcus Bointon dd803df5ad
Remove invalid default from address (and name)! Fixes #2396 2021-08-18 11:14:16 +02:00
Marcus Bointon fd06e7614a
Remove wrong tests 2021-08-18 11:05:30 +02:00
Marcus Bointon c5d0f48730
Not needed 2021-08-18 11:05:17 +02:00
Marcus Bointon a99b249d42
6.5.1 2021-08-18 10:39:34 +02:00
Marcus Bointon 5d7f077daa
CS 2021-08-18 10:37:43 +02:00
Marcus Bointon 99937ed637
Fixes #2470 and #2471 2021-08-18 10:35:47 +02:00
Marcus Bointon a4548d7ebe
Merge pull request #2472 from Arisophy/master
Japanese messages
2021-08-17 15:03:33 +02:00
Arisophy 942da89fc2
Update LocalizationTest.php
Restore the leading space.
2021-08-17 20:59:17 +09:00
Arisophy 8de64a0ba1
Update phpmailer.lang-ja.php
Restore the leading space.
2021-08-17 20:56:49 +09:00
Arisophy ecb661448f
Update phpmailer.lang-ja.php
Add author
2021-08-17 11:43:22 +09:00
Arisophy 3f358ab478
Update LocalizationTest.php
Remove extra whitespace
2021-08-17 11:40:28 +09:00
Arisophy de0a1e1af6
Update phpmailer.lang-ja.php 2021-08-15 15:43:19 +09:00
rx80 eed7ef5061
Simplify use of get_oauth_token.php
Add a form the user can fill in, avoiding the need to modify clientId and clientSecret in code.
2021-07-28 12:50:34 +00:00
Marcus Bointon 620c2a66c5
Merge pull request #2451 from jrfnl/feature/tests-add-tests-html2text
Tests: introduce dedicated tests for the `PHPMailer::html2text()` method
2021-07-16 12:10:14 +02:00
Marcus Bointon 9243b4bb0e
Merge pull request #2452 from jrfnl/feature/2418-improve-and-test-localization
PHPMailer::setLanguage(): various fixes + add tests for localization
2021-07-13 19:39:51 +02:00
jrfnl 5e833628dc Tests: introduce dedicated tests for the `PHPMailer::html2text()` method
So far, this method did not have dedicated tests.

The test file this commit introduces, tests all aspects of the method as well as documents the current behaviour of the method for specific, outlier situations.
2021-07-13 19:17:45 +02:00
jrfnl 9825cacc20 PHPMailerTest: remove setLanguage() test
... which wasn't actually testing anything at all.
2021-07-13 19:04:27 +02:00
jrfnl 913fb552ab Tests: introduce dedicated tests for text localization
So far, the methods related to text localization - `PHPMailer::setLanguage()`, `PHPMailer::getTranslations()` and `PHPMailer::lang()` - did not have dedicated tests.

The test file this commit introduces, tests all aspects of these methods, including the changes introduced in response to 2418 and 2419, as well as documents the current behaviour of the methods for specific, outlier situations.
2021-07-13 19:04:27 +02:00
jrfnl 4ba13807a4 PHPMailer::setLanguage(): allow for "lang(_script)?(_country)?" codes
Language codes which were "language-script" based were not accepted by the regex used, which meant that the `sr_latn` script could never be loaded.

After discussion in 2418, it was decided to support "script" in a language code and to support it like so:
```
2-character language code [_] optional 4-character script code [_] optional 2-character country code
```

This combines the annotation forms of the following known standards:
* https://unicode-org.github.io/cldr-staging/charts/37/summary/root.html
* https://docs.oracle.com/cd/E23824_01/html/E26033/glset.html
* http://www.loc.gov/standards/iso639-2/php/code_list.php

This means that all of the below codes will now pass the language code validation:
```
sr
sr_latn
sr_rs
sr_latn_rs
```

But not:
```
sr_rs_latn
```

This commit applies the above change and also adjusts the "language code fall back" logic to take language codes with a script code into account.
Note: if the requested full "language-script-country" code is not available, "language-country" will take precedence over "language-script" for the fallback logic to find the appropriate translation file.

Related to 2418 - observation 4
2021-07-13 19:04:27 +02:00
jrfnl 3635e97510 PHPMailer::setLanguage(): fix "lang_country" codes do not fall back to "lang"
When the  `$langCode` is passed as "language code - country code" and no translation is found for the specified country variant, the localization would automatically fall back to English, even when there was a viable translation available in the "parent" language, i.e. just based on the _language code_.

This commit changes the logic in the `PHPMailer::setLanguage()` method for when a "lang-country" code is passed.
It will now try and find a "lang-country" file first, if not found, it will try to find a file for just the "lang" and only if that could also not be found, it will fall back to English.

Related to 2418 - observation 2

Includes using named subpatterns in the regex to make the regex self-documenting.

Includes removing a commented out line of code which is superseded anyway.
2021-07-13 19:04:27 +02:00
jrfnl aaf18fd5b2 PHPMailer::setLanguage(): match language codes case-insensitively
For "language code - country code" locale notations, it is common for the "country code" part to be provided in uppercase, like `pt_BR`.

The method currently did not allow for that correctly. The regex check would accept the language code, but then fail to find the file on *nix based systems as the file names are all in lowercase and non-Windows file systems are generally case-sensitive. Which means that in effect, the method, ended up falling back to the default language (English).

The change in this commit makes the handling of the provided `$langcode` case-tolerant.

Note: the language code used in the file names for the language files is still expected to always be lowercase, including for language files in custom paths!

Related to 2418 - observation 1
2021-07-13 19:04:27 +02:00
jrfnl 9182613398 PHPMailer::setLanguage(): make return value consistent
The return value of the method was inconsistent as it could return `true` even when the requested language was not loaded/set.

Previously, the method would:
* Return `false` when a `$langcode` was matched against the regex, but the file couldn't be loaded.
* Return `true` in all other cases, including when a `$langcode` other than `'en'` was passed, but it didn't match the regex, which meant that effectively the requested language was ignored and English was loaded anyway, but the function would still return `true`.

This has now been changed to:
* Return `true` when the requested language was loaded, whether `'en'` or another language.
* Return `false` when the requested language wasn't loaded and the language defaulted to English.

Related to https://github.com/PHPMailer/PHPMailer/issues/2418#issuecomment-876240778
2021-07-13 19:04:27 +02:00
Marcus Bointon 5c64f7e2d8
Merge pull request #2449 from jrfnl/feature/parseaddresses-bug-fix-2-mbstring-needs-charset
PHPMailer::parseAddresses(): bug fix [2] - Mbstring encoding
2021-07-13 09:46:07 +02:00
jrfnl 228338fe7e PHPMailer::parseAddresses(): bug fix [2] - Mbstring encoding
The `mb_decode_mimeheader()` function uses the Mbstring internal encoding to decode.

In PHP 5.5, the default internal encoding was `ISO-8859-1`.
As of PHP 5.6, the default internal encoding was changed to use the value from the `default_charset` ini setting. Additionally, in UTF-8, the value for `default_charset` was changed to `UTF-8`.

This means that when the charset is not explicitly set, the `mb_decode_mimeheader()` function may return garbled nonsense if the charset used to _encode_ does not match the charset per PHP's `default_charset` or - in PHP 5.5 - the Mbstring internal_encoding default.

So far, this wasn't making tests fail because of some hard-coded ini settings being passed in the CI.
However, changing the default ini values creates an assumption that that configuration will be used on all servers on which the PHPMailer code will be run.
This assumption is undocumented (not in the Readme or mentioned elsewhere) and will in most cases be incorrect.

The non-default ini values change the behaviour of PHP and were the cause of test failures against PHP 5.5 which I've been seeing for some of the new tests I've been creating.
Removing the changes fixes those errors, but exposes failing tests in the existing tests for `PHPMailer::parseAddresses()`.

These undocumented _changes_ to the default PHP configuration were **required** for PHPMailer to be able to parse the addresses successfully. As this library is open source and used in a wide variety of environments, those kind of assumptions can not safely be made.

So.... the hard-coded ini settings in the CI configuration ought to be removed.

This then causes the tests for the `PHPMailer::parseAddresses()` function to start failing on PHP 5.5.
> Note: the tests are only failing on PHP 5.5 as the test case causing the failure uses a UTF-8 encoded name and as of PHP 5.6, the default encoding used in PHP is UTF-8, which matches.
> If a test case would be added with a name encoded in a different charset, the tests would also start failing on PHP 5.6+.

To fix those failures and to make the code PHP cross-version compatible, including with PHP installs configured to use a different `default_encoding`:
* We need to make sure that the Mbstring "internal encoding" is set correctly based on the Charset used for PHPMailer.
* And then need to _reset_ the internal encoding after the use of the `mb_decode_mimeheader()` to prevent any impact of this change on the wider application context in which PHPMailer may be used.

As the `PHPMailer::parseAddresses()` method is `static`, it does not have access to the (non-static) `PHPMailer::$charSet` variable.
Knowing that, I've elected to add an additional, optional variable to the `PHPMailer::parseAddresses()` method to allow for passing in the charset and have set the default value for the parameter to be in line with the default value of the `PHPMailer::$charSet` variable.

I have adjusted existing method calls to this method to explicitly pass the charset.
Both of the adjusted function calls are in the "postSend" part of the PHPMailer logic when the charset will be known and final, so can be safely passed.

I've also made minimal changes to the unit test file to allow for passing the charset in the tests.

This implementation is based on the assumption that names can be encoded in different charsets.
If the name encoding only happens when the charset is UTF-8, the new function parameter can be removed and the charset can be set to UTF-8 directly.

As I'm not completely read-in on the RFC specs for the address header being parsed and when encoding happens, I'd like a second opinion on the currently chosen implementation.

If this is the correct way to go, then additional tests need to be added to safeguard that things works correctly when a different encoding is used.
If the encoding only happens for UTF-8, the implementation can be simplified.

Update: the current implementation is correct and a `@todo` note has been added to add more tests with different encodings during a next iteration on these tests.

Refs:
* https://www.php.net/manual/en/migration56.deprecated.php#migration56.deprecated.iconv-mbstring-encoding
* https://php-legacy-docs.zend.com/manual/php5/en/ini.core#ini.default-charset
2021-07-13 05:49:19 +02:00
Marcus Bointon 7cc67dd1dc
Merge pull request #2450 from jrfnl/feature/tests-reorganize-33
Tests: move (get|set|clear)ReplyTo tests to own file
2021-07-12 22:35:14 +02:00
jrfnl 2723a83d32 MailTransportTest: remove reply-to addressing testing
As noted in 2380, the addressing tests do not belong in the mail transport tests and as the `ReplyToGetSetClearTest` now covers this extensively, the assertions can be removed from the `MailTransportTest`.
2021-07-12 22:15:24 +02:00
jrfnl 4fa30cd710 ReplyToGetSetClearTest: add new test to verify clearing of reply-tos 2021-07-12 22:15:22 +02:00
jrfnl 35e76a2fa8 ReplyToGetSetClearTest: improve "extensions not available" test
The "fakefunctions" are all nice and dandy to get past the `idnSupported()` check, but if either of these functions is not _really_ available, the actual behaviour of the `PHPMailer::addReplyTo()` function is to _fail_ (on the address validation call in `PHPMailer::addAnAddress()`) and return `false`.

In other words, this test was nonsensical as it tested for something which can, and should, never happen.

With this in mind, the test has been rewritten to reflect the *real* behaviour when either Mbstring or the `idn_to_ascii` function is not available.
2021-07-12 22:15:19 +02:00
jrfnl 535f6338a9 ReplyToGetSetClearTest: improve the test with duplicate IDN addresses
This commit:
* Renames the `testDuplicateIDNRemoved()` method to `testNoDuplicateReplyToAddresses()`.
* Removes the call to `clearReplyTos()` at the start of the function as it is redundant. Each test gets a fresh instance of the PHPMailer class.
* Adds a number of additional assertions to the method to test the enqueuing and duplication removal in more depth.
* Ensures that all assertions are accompanied by a "failure" message so it can more easily be determined which assertion failed (in case of failure).

Includes adding `@covers` tags for the test.
2021-07-12 22:15:17 +02:00
jrfnl 06244ad942 ReplyToGetSetClearTest: improve the conversion and enqueuing test
This commit:
* Renames the `testConvertEncoding()` method to `testEnqueueAndAddIdnAddress()`.
* Removes the call to `clearReplyTos()` at the start of the function as it is redundant. Each test gets a fresh instance of the PHPMailer class.
* Adds a number of additional assertions to the method to test the enqueuing in more depth.

Includes adding `@covers` tags for the test.
2021-07-12 22:15:16 +02:00
jrfnl 465a067017 ReplyToGetSetClearTest::testReplyToInMessageHeader(): add additional test cases
... to test that the header gets set correctly when multiple reply-to addresses have been set, as well as when a reply-to address has been set without a name.
2021-07-12 22:15:08 +02:00
jrfnl faf8d9fadf ReplyToGetSetClearTest: test the reply-to message header gets set correctly
This commit:
* Renames the `testLowPriority()` method to `testReplyToInMessageHeader()`.
    This test method was originally basically testing two things: the priority and the reply to header being set. For this class, it now just focusses on the reply to header, so letting the name reflect that.
* Enhances the test by actually testing that the reply-to header is correctly found in the fully composed message.
* Breaks out the test case to a data provider to allow for adding additional test cases more easily.
2021-07-12 22:15:07 +02:00
jrfnl 5396226be7 ReplyToGetSetClearTest: add extra setting failure test
... to test that passing an invalid email address in combination with an instance of the `PHPMailer` class which was instantiated with `$exceptions = true` results in an exception.

Includes adding `@covers` tags for this specific method.
2021-07-12 22:15:06 +02:00
jrfnl e27f649456 ReplyToGetSetClearTest::testAddReplyToInvalidAddressNonIDN(): add additional test case
... which should be handled correctly based on the code.
2021-07-12 22:15:04 +02:00
jrfnl ce91079a56 ReplyToGetSetClearTest::testAddReplyToValidAddressNonIdn(): add additional test cases
This commit:
* Adds two extra test cases.
* Adds handling to allow the "expected" registered values (and key) being different from the original input values.
2021-07-12 22:15:02 +02:00
jrfnl 6ba19a260f ReplyToGetSetClearTest: test the setting of reply-to address in more depth
This commit:
* Splits the primary tests previously contained in the `testAddressing()` method into two distinct test methods, each using a data provider to allow for adding additional test cases more easily.
* Enhances the tests by not only testing the return value of the `addReplyTo()` method, but also verifying that the `ReplyTo property has been set correctly and contains the expected information.

Includes adding `@covers` tags for these specific methods.
2021-07-12 22:15:01 +02:00
jrfnl badac1cb8e ReplyToGetSetClearTest: replace testSkipping with `@requires` 2021-07-12 22:14:59 +02:00
jrfnl 6ab33cf975 ReplyToGetSetClearTest: switch to preSend()
The actual "dequeueing" and adding of `ReplyTo` addresses with IDNs happens within `preSend()`, so this test doesn't actually need to call `send()`.
2021-07-12 22:14:58 +02:00
jrfnl 51ce7d54b3 Tests/reorganize: move (get|set|clear)ReplyTo tests to own file
Note: this doesn't move the complete tests from the original test file, just select parts of the test methods.
2021-07-12 22:14:56 +02:00
Marcus Bointon f5f7f10e59
Merge pull request #2445 from jrfnl/feature/tests-reorganize-32
Tests: move property setting tests to own file
2021-07-12 21:27:45 +02:00
Marcus Bointon d16053c51c
Merge pull request #2440 from jrfnl/feature/parseaddresses-bug-fix-1-missing-extension-check
PHPMailer::parseAddresses(): bug fix [1] - extension availability not checked (consistently)
2021-07-12 21:26:26 +02:00
Marcus Bointon 7d57e6c078
Merge pull request #2446 from eltociear/patch-1
EncodeQTest: fix typo
2021-07-12 16:51:04 +02:00
Ikko Ashimine 4c1adf79f3
EncodeQTest: fix typo
containg -> contains
2021-07-12 23:10:59 +09:00
jrfnl 63da073183 SetTest: add `@covers` tag 2021-07-12 15:24:18 +02:00
jrfnl 8fe8b5634c SetTest::testSetValidProperty(): add additional test case
This commit:
* Adds one extra test case.
* Documents why there is no test case for a `private` property.
2021-07-12 15:24:16 +02:00
jrfnl 3d9a99802a SetTest: reorganize success test to use a data provider
* Renames the method to a more descriptive name.
* Maintains the same test case.
* Makes it easier to add additional test cases in the future.
2021-07-12 15:24:14 +02:00
jrfnl 628d56927e SetTest: split off value toggling test
This commit moves the "set a property to null and then back" test to a separate test method.

Note: based on the code in the method, this test doesn't really add any value, but I also see no reason to remove it.
2021-07-12 15:24:12 +02:00
jrfnl eef6f4e52a SetTest: split off failure test
This commit moves the "failed to set the property" test case to a separate test method.
2021-07-12 15:24:10 +02:00
jrfnl d4ff9fdd54 Tests/reorganize: move property setting tests to own file 2021-07-12 15:24:08 +02:00
jrfnl 1e874999d1 PHPMailer::parseAddresses(): replace use of extension_loaded
The `extension_loaded()` PHP function is sometimes disabled by shared hosts as a form of "security by obscurity".
This would lead to a fatal "Function not available" error.

With that in mind, replacing the `extension_loaded()` checks in the `PHPMailer::parseAddresses()` function with a check for the `MB_CASE_UPPER` constant being defined. This _should_ be reliable enough to determine whether the Mbstring extension is available, though has its own drawbacks as when the extension is not available, the constant _could_ be polyfilled by userland code (and sometimes is).

The `MB_CASE_UPPER` constant was chosen as it is one of the few Mbstring constants which is actually available cross-version in PHP 5.5-current.

Refs:
* https://www.php.net/manual/en/mbstring.constants.php
* https://php-legacy-docs.zend.com/manual/php5/en/mbstring.constants
2021-07-12 15:20:28 +02:00
Marcus Bointon 1265af38ea
Merge pull request #2444 from jrfnl/feature/tests-reorganize-31
Tests: move setFrom tests to own file
2021-07-12 15:14:08 +02:00
jrfnl 64312a5eed SetFromTest: add `@covers` tag 2021-07-12 14:56:38 +02:00
jrfnl 2410465e9c SetFromTest: add extra test for passing an unacceptable email address 2021-07-12 14:56:37 +02:00
jrfnl 74e3d8e8f4 SetFromTest::testSetFromFail(): add additional test cases
... which should be handled correctly based on the code in the method under test.
2021-07-12 14:56:35 +02:00
jrfnl c6bfd49b8b SetFromTest: add extra failure test
... to test that passing an invalid email address in combination with an instance of the `PHPMailer` class which was instantiated with `$exceptions = true` results in an exception.

Includes reworking the `testSetFromFail()` method to a data provider and letting both the `testSetFromFail()` and the new `testInvalidAddressException()` method use the same data provider.
2021-07-12 14:56:34 +02:00
jrfnl 5e912a792d SetFromTest: improve the testSetFromFail() test
Make the failure test more comprehensive by verifying that when the method fails, the values for the `From`, `FromName` and `Sender` properties, _really_ haven't changed.
2021-07-12 14:56:32 +02:00
jrfnl 76e14b34be SetFromTest: add new test for not overruling existing Sender
Based on the code in the method, any existing, previously set `Sender` should not be overruled, even when the `$auto` parameter is set to `true`.

This method tests that specific situation.
2021-07-12 14:56:31 +02:00
jrfnl baee96b604 SetFromTest::testSetFromSuccess(): add additional test cases
... which should be handled correctly based on the code in the method under test.
2021-07-12 14:56:29 +02:00
jrfnl 97f82e5993 SetFromTest: replaces the last of the `testAddressing()` method
... with a dedicated test to verify that the `Sender` is not overruled when the `$auto` parameter is set to `false`.
2021-07-12 14:56:27 +02:00
jrfnl d7cf5c6de7 SetFromTest: reorganize success tests to use data providers
* Merges the two "success" tests from the `testAddressing()` and the `testAddressing2()` methods into one `testSetFromSuccess()` method.
* Adds additional assertions to more comprehensively verify that the method did what was expected, i.e. set the `From`, `FromName` and `Sender` properties.
* Maintains the same test cases.
* Makes it easier to add additional test cases in the future.
2021-07-12 14:56:25 +02:00
jrfnl 23f0238eed SetFromTest: split off failure test
This commit moves the "invalid email address" test case to a separate test method.
2021-07-12 14:56:24 +02:00
jrfnl 4988ca1927 Tests/reorganize: move setFrom tests to own file 2021-07-12 14:56:22 +02:00
Marcus Bointon 76767b4de1
Merge pull request #2443 from jrfnl/feature/tests-reorganize-30
Tests: move error recording test to own file
2021-07-12 14:31:51 +02:00
jrfnl 214c415266 SetErrorTest: add `@covers` tags 2021-07-12 13:58:19 +02:00
jrfnl 058ded57b8 SetErrorTest: add additional tests for the `PHPMailer::setError()` and `PHPMailer::isError()` methods
So far, these methods were only tested in the most perfunctory manner.

The additional tests this commit introduces, test all aspects of the methods as well as documents the current behaviour of the methods.

Take note of the "text merging"/readability issues for the SMTP error messages. There may be room for improvement there.
2021-07-12 13:58:10 +02:00
jrfnl caa1d15eec SetErrorTest: replace the original test
... by a much simpler test which effectively tests the same thing, i.e.:
* No errors to start with.
* Trigger an error.
* Verify that `PHPMailer::isError()` returns `true`.
* Verify that the error message is as expected.
2021-07-12 13:58:08 +02:00
jrfnl 2c570af805 Tests/reorganize: move error recording test to own file 2021-07-12 13:57:56 +02:00
Marcus Bointon 56e7d2a0fd
Merge pull request #2439 from jrfnl/feature/tests-reorganize-29
Tests: move encodeQ tests to own file
2021-07-12 08:45:40 +02:00
jrfnl 5cbd8f9f62 ParseAddressesTest: add additional test for when Mbstring is not available
What with the previous commit adding a requirement for the `Mbstring` extension to the existing tests, it becomes clear that the "Mbstring extension not available" code path was not covered by the tests.

This commit fixes that by:
* Adding two new test methods which explicitly expect the Mbstring extension to **not** be available.
* Changing the data provider "expected(Imap)" keys.
    The `expected` key in the array will now be an array of arrays.
    A `default` key can be used for when the output across configurations will be the same.
    Any differences across configurations can be provided in separate sub-keys of the `expected` array, using the `native+mbstring`, `imap+mbstring`, `native--mbstring` and/or `imap--mbstring` keys, which match the four test methods which are now in place.
    Additionally, an `native` and/or `imap` key can be used for setting the output expectations for the two native implementation or the two IMAP implementation tests, if the Mbstring extension makes no difference.
2021-07-11 18:30:59 +02:00
jrfnl 8827c9b3ce PHPMailer::parseAddresses(): bug fix [1] - extension availability not checked
Follow up to #2266

Bug fix

In both "arms" (imap vs native implementation) of the `PHPMailer::parseAddresses()` method, the `mb_decode_mimeheader()` function is used to decoded a (utf-8) encoded name.

In the IMAP "arm", a check was in place for the Mbstring extension being available before using it. This check was missing from the "native implementation" "arm".

Existing Tests

This also means that both currently existing tests have a requirement for the MbString extension being available. This was previously not made explicit in the tests.
Fixed now.
2021-07-11 18:30:57 +02:00
jrfnl 8fd56f335e ParseAddressesTest: split off expectation verification 2021-07-11 18:30:56 +02:00
jrfnl e67ed991e3 ParseAddressesTest: minor correction to test case description 2021-07-11 18:30:54 +02:00
jrfnl ca1f2cfea7 EncodeQTest: add `@covers` tag 2021-07-11 11:17:15 +02:00
jrfnl 3984ac2839 EncodeQTest: add additional test cases
... which should be handled correctly based on the code in the method under test.
2021-07-11 11:17:13 +02:00
jrfnl e6af3c80b4 EncodeQTest: reorganize to use data providers
* Maintains (largely) the same test code and exactly the same test cases.
* Makes it easier to add additional test cases in the future.
2021-07-11 11:17:11 +02:00
jrfnl 167c81a2cf Tests/reorganize: move encodeQ tests to own file 2021-07-11 11:17:08 +02:00
Marcus Bointon 904dc698ea
Merge pull request #2435 from jrfnl/feature/tests-reorganize-28
Tests: move encodeString tests to own file
2021-07-11 09:09:08 +02:00
Marcus Bointon ddb89f7239
Merge pull request #2436 from jrfnl/feature/2418-gettranslations-always-available
PHPmailer::getTranslations():  translations should always be available
2021-07-11 09:07:43 +02:00
jrfnl 123c0aac84 PHPmailer::getTranslations(): translations should always be available
If the language has not been set yet, it should return the English text strings.

Fixes 2419
2021-07-09 21:14:47 +02:00
jrfnl d003985774 HasLineLongerThanMaxTest: remove a `@covers` tag
As the `PHPMailer::encodeString()` method is now fully covered by dedicated tests, this `@covers` tag can be removed.
2021-07-09 21:13:21 +02:00
jrfnl 5a29b1916b EncodeStringTest: add extra test for passing an invalid encoding
... in combination with an instance of the `PHPMailer` class which was instantiated with `$exceptions = true`.
2021-07-09 21:13:20 +02:00
jrfnl 0d071ba5c0 EncodeStringTest: improve the testInvalidEncoding() test
* Ensure that the return value of the call to `PHPMailer::encodeString()` is an empty string.
* Ensure that the error count and info is correctly set.
2021-07-09 21:13:18 +02:00
jrfnl a00826debe EncodeStringTest: add additional test cases
... which should be handled correctly based on the code in the method under test.

With these additional test cases, the method now has 100% code coverage and is fully tested.
2021-07-09 21:13:17 +02:00
jrfnl fa43806486 EncodeStringTest: reorganize to use data providers
* Maintains the same test code and test cases.
* Makes it easier to add additional test cases in the future.

Includes adding `@covers` tag.
2021-07-09 21:13:15 +02:00
jrfnl d96d944631 EncodeStringTest: split off failure test
This commit moves the "incorrect encoding" test case to a separate test method.
2021-07-09 21:13:13 +02:00
jrfnl 2380a16f5e EncodeStringTest: fix incorrect assertion
Using a regex assertion with arbitrary input data which is not regex escaped, makes this test suspect.
From the looks of it, the test _should_ be testing that the output is the _same_, so let's use that assertion.
2021-07-09 21:13:11 +02:00
jrfnl 7c8d3f21b2 Tests/reorganize: move encodeString tests to own file
Note: this doesn't move the complete test from the original test file, just select parts of the test method.
2021-07-09 21:13:08 +02:00
Marcus Bointon 687521c5ff
Merge pull request #2428 from jrfnl/feature/localization-add-missing-text-strings
Localization: allow for more text strings to be translated
2021-07-09 18:43:41 +02:00
Marcus Bointon 5106624d2a
Merge pull request #2434 from jrfnl/feature/tests-reorganize-27
Tests: move addStringEmbeddedImage tests to own file
2021-07-09 16:54:47 +02:00
jrfnl 3fc3a2c7ca AddStringEmbeddedImageTest: add `@covers` tags 2021-07-09 15:08:27 +02:00
jrfnl 996136e978 AddStringEmbeddedImageTest: add additional "fail to attach" test method
This commit:
* Adds a new `testFailToAttach()` test method to test the behaviour of the `PHPMailer::AddStringEmbeddedImageTest()` method when the `PHPMailer` class has been instantiated with `$exceptions` disabled.
* This new test method uses the same data provider - introduced in the previous commit - as the `testFailToAttachException()` method.
2021-07-09 15:08:25 +02:00
jrfnl 70828f6dca AddStringEmbeddedImageTest: refactor the "fail to attach" test case
This commit:
* Renames the `testStringEmbeddedImageEncodingException()` test to `testFailToAttachException()`.
* Reworks the test to use a data provider.
* Adds testing of the exception message to the `testFailToAttachException()` method.
2021-07-09 15:08:24 +02:00
jrfnl 3efe0352f4 AddStringEmbeddedImageTest: improve original test [2]
This expands the assertions executed in this test to cover the code under test more comprehensively.
2021-07-09 15:08:22 +02:00
jrfnl cd3416bc2d AddStringEmbeddedImageTest: improve original test [1]
This commit:
* Improves the test name and the description in the docblock.
* Replace a redundant condition and "forced" failure assertion with an assertion actually testing the result of the method call.
* Removes the redundant `return` - if an assertion fails, the rest of the code within the test method will not be executed anyway.
* Minor inline comment tweaks.
2021-07-09 15:08:20 +02:00
jrfnl e416c949d8 AddStringEmbeddedImageTest: switch to preSend()
The actual "attaching" of the string attachment happens within `createBody()` which is called from `preSend()`, so this test doesn't actually need to call `send()`.
2021-07-09 15:08:19 +02:00
jrfnl 3645ec3e87 Tests/reorganize: move addStringEmbeddedImage tests to own file 2021-07-09 15:08:17 +02:00
jrfnl 683a5039d2 Translations: update the Dutch translation 2021-07-09 15:04:18 +02:00
jrfnl a550adc872 Localization: allow for more text strings to be translated
In a number of places in the code base I came across hard-code error messages, which were not set up to be translatable.

For those I found, I've now fixed this.

Note: I've not added the labels used for logging errors via the `PHPMailer:edebug()` method. If so desired, that could be added in a future iteration.

Existing translation files have not been updated. Translators may need to be pinged before the next release to update the translation(s) they maintain.

Includes a minor tweak to the PHPCS configuration to allow lines in language files to exceed the "120 chars line max" as using concatenation for text strings in translation files will not work with the current way of loading these files and the new "buggy PHP" message is a long text which would result in nearly all translation files throwing the warning.
2021-07-09 15:01:11 +02:00
Marcus Bointon 1a2e462b9d
Merge pull request #2431 from jrfnl/feature/tests-add-tests-fileisaccessible
Tests: introduce dedicated tests for the `PHPMailer::fileIsAccessible()` method
2021-07-09 11:39:25 +02:00
Marcus Bointon fbf2eea0e9
Merge pull request #2430 from jrfnl/feature/tests-add-tests-ispermittedpath
Tests: introduce dedicated tests for the `PHPMailer::isPermittedPath()` method
2021-07-09 11:38:37 +02:00
Marcus Bointon 971af16ccf
Merge pull request #2427 from jrfnl/feature/tests-reorganize-26
Tests: move addStringAttachment tests to own file
2021-07-09 11:37:27 +02:00
jrfnl 49bcd4a035 Tests: introduce dedicated tests for the `PHPMailer::fileIsAccessible()` method
So far, this method did not have dedicated tests.

The test file this commit introduces, tests nearly all aspects of the method as well as documents the current behaviour of the method.

There is one particular test case missing. This is annotated in the class docblock.

While this method is quite simple, testing it separately means that the tests for methods _using_ this method don't have to _also_ test the functioning of this method, which means they can be more focussed on their own logic.
2021-07-09 09:36:36 +02:00
jrfnl f5b54c2bb5 Tests: introduce dedicated tests for the `PHPMailer::isPermittedPath()` method
So far, this method did not have dedicated tests.

The test file this commit introduces, tests all aspects of the method as well as documents the current behaviour of the method.

While this method is quite simple, testing it separately means that the tests for methods _using_ this method don't have to _also_ test the functioning of this method, which means they can be more focussed on their own logic.
2021-07-09 09:30:39 +02:00
jrfnl 59f82c7db5 AddStringAttachmentTest: add `@covers` tags 2021-07-08 11:37:17 +02:00
jrfnl 404ba09b64 AddStringAttachmentTest: add additional "fail to attach" test method
This commit:
* Adds a new `testFailToAttach()` test method to test the behaviour of the `PHPMailer::addStringAttachment()` method when the `PHPMailer` class has been instantiated with `$exceptions` disabled.
* This new test method uses the same data provider - introduced in the previous commit - as the `testFailToAttachException()` method.
2021-07-08 11:37:15 +02:00
jrfnl 384e291092 AddStringAttachmentTest: refactor the "fail to attach" test case
This commit:
* Renames the `testStringAttachmentEncodingException()` test to `testFailToAttachException()`.
* Reworks the test to use a data provider.
* Adds testing of the exception message to the `testFailToAttachException()` method.
2021-07-08 11:37:13 +02:00
jrfnl 40a4fa39b7 AddStringAttachmentTest: improve original test
This expands the assertions executed in this test to cover the code under test more comprehensively.
2021-07-08 11:37:12 +02:00
jrfnl 41af61ab2f AddStringAttachmentTest: switch to preSend()
The actual "attaching" of the string attachment happens within `createBody()` which is called from `preSend()`, so this test doesn't actually need to call `send()`.
2021-07-08 11:37:10 +02:00
jrfnl 0bc3dfb96b Tests/reorganize: move addStringAttachment tests to own file 2021-07-08 11:37:08 +02:00
Marcus Bointon e93f027b1f
Merge pull request #2425 from jrfnl/feature/tests-reorganize-25
Tests: move addEmbeddedImage tests to own file
2021-07-08 10:56:11 +02:00
jrfnl 73b4ec5bea AddEmbeddedImageTest: add `@covers` tags 2021-07-07 19:27:02 +02:00
jrfnl 90c98c3c1c AddEmbeddedImageTest: fully test exceptions for "fail to attach" test cases
This commit:
* Adds an `exceptionMessage` index to the `dataFailToAttach()` data provider.
* Renames the `testEmbeddedImageEncodingException()` method to `testFailToAttachException()`.
* Sets the `testFailToAttachException()` method up to use the `dataFailToAttach()` data provider.
* Adds testing of the exception message to the `testFailToAttachException()` method.

With this change, the "fail to attach" test cases are now fully tested for both a `PHPMailer` instance without exceptions enabled, as well as for an instance _with_ exceptions enabled.
2021-07-07 19:27:01 +02:00
jrfnl eb666a7e5d AddEmbeddedImageTest: add extra test case for `testFailToAttach()` method
... mirroring the same test in the `testEmbeddedImageEncodingException()` method.
2021-07-07 19:26:59 +02:00
jrfnl 028b503624 AddEmbeddedImageTest: improve original test [2]
This expands the assertions executed in this test to cover the code under test more comprehensively.
2021-07-07 19:26:58 +02:00
jrfnl cbecbc956b AddEmbeddedImageTest: improve original test [1]
The test code remaining in the `testEmbeddedImage()` constitutes one test.

This commit:
* Renames the test method and improves the description in the docblock.
* Removes the redundant call to `PHPMailer::clearAttachments()`.
    This call was previously needed as multiple situations were being tested in one test method.
    Now each test case has its own test method, the call to `PHPMailer::clearAttachments()` is no longer needed as each test method will receive a fresh, clean instance of the `PHPMailer` class.
* Replace a redundant condition and "forced" failure assertion with an assertion actually testing the result of the method call.
* Removes the redundant `return` - if an assertion fails, the rest of the code within the test method will not be executed anyway.
2021-07-07 19:26:56 +02:00
jrfnl d034bef136 AddEmbeddedImageTest: split off "missing name" test
The test case when a file was attached without explicitly adding a filename wasn't actually being tested at all as no assertion was used.

This commit:
* Moves that particular test case to a separate test method.
* Adds relevant assertions to actually test the test case.
2021-07-07 19:26:54 +02:00
jrfnl e5b07ba3c3 AddEmbeddedImageTest: split off failure test
The "failure" case when a non-existent file was being passed, wasn't actually being tested at all as no assertion was used.

This commit:
* Moves the particular failure test case to a separate test method with a data provider (to allow for more failure test cases to be added).
* Uses an assertion on the call to `addEmbeddedImage()` to actually test that the method return a failure state.
* Verifies that no attachment for an inline image was added by adding a second assertion with a call to `PHPMailer::inlineImageExists()`.
2021-07-07 19:26:53 +02:00
jrfnl a866bc9eda AddEmbeddedImageTest: switch to preSend()
The actual "attaching" of the images happens within `createBody()` which is called from `preSend()`, so this test doesn't actually need to call `send()`.
2021-07-07 19:26:51 +02:00
jrfnl 8e76e48afb Tests/reorganize: move addEmbeddedImage tests to own file
Note: this doesn't move the complete test from the original test file, just select parts of the test method.
2021-07-07 19:26:49 +02:00
Marcus Bointon 58b875bfed
Merge pull request #2424 from jrfnl/feature/tests-reorganize-24
Tests: move custom header tests to own file
2021-07-07 18:51:08 +02:00
jrfnl da01dc50e0 CustomHeaderTest: add `@covers` tags 2021-07-07 17:42:47 +02:00
jrfnl 611c58c134 CustomHeaderTest: add extra test cases for `testAddCustomHeaderInvalid()` method 2021-07-07 17:42:45 +02:00
jrfnl 07be3bc7ff CustomHeaderTest: add extra test cases for `testAddAndGetCustomHeader()` method 2021-07-07 17:42:43 +02:00
jrfnl d2a1a20097 CustomHeaderTest: reorganize rest to use data provider
* Maintains (largely) the same test cases.
* Prevent one failing assertion hiding a potential second failure.
* Makes it easier to add additional test cases in the future.

Note:
This removes the intermittent calls to `clearCustomHeaders()` from this test. This is now tested via a separate method and as each test case will receive a fresh instance of the `PHPMailer` class, there is no need to clear the set custom headers between tests.
2021-07-07 17:42:41 +02:00
jrfnl fb81ccc224 CustomHeaderTest: add dedicated test for `clearCustomHeaders()` method
Includes adding an assertion to ensure that the `PHPMailer::CustomHeader` property is still in array format after clearing it out.
2021-07-07 17:42:40 +02:00
jrfnl a7d9416e24 CustomHeaderTest: move "failure" tests to own method with data provider 2021-07-07 17:42:38 +02:00
jrfnl 22ba72fd99 CustomHeaderTest: rename exception test and improve
... by also testing that the exception message matches the expected message.
2021-07-07 17:42:36 +02:00
jrfnl ce0c31cea7 Tests/reorganize: move custom header tests to own file 2021-07-07 17:42:34 +02:00
Marcus Bointon 2aa2614e5d
Merge pull request #2423 from jrfnl/feature/tests-haslinelongerthan-switch-to-presend
HasLineLongerThanMaxTest: switch to preSend()
2021-07-07 17:26:23 +02:00
Marcus Bointon 7475270380
Merge pull request #2422 from jrfnl/feature/tests-reorganize-23
Tests: move setWordWrap tests to own file
2021-07-07 17:25:54 +02:00
jrfnl 6e0193958d HasLineLongerThanMaxTest: switch to preSend()
The line length adjustments are executed within `createBody()` which is called from `preSend()`, so this test doesn't actually need to call `send()`.

I also wonder if this test can be further improved by having more targeted tests for `PHPMailer::hasLineLongerThanMax()` and whether these more extensive tests can be included in a test class which is more targeted at the `createBody()` and/or `preSend()` methods, but that is for later.
2021-07-07 17:12:16 +02:00
jrfnl 54c0bb9fb5 SetWordWrapTest: add `@covers` tags 2021-07-07 17:11:43 +02:00
jrfnl bb8b66d0c9 SetWordWrapTest: add "no-wrapping" test
... to increase code coverage.
2021-07-07 17:11:41 +02:00
jrfnl 2c7a354857 SetWordWrapTest: actually test the wordwrapping has been applied
Previously, the test didn't actually test whether the wordwrapping had been applied, just that the message was (pre)send successfully.

Changing the assertions to actually test that the wordwrapping has been correctly applied.
2021-07-07 17:11:39 +02:00
jrfnl 42ddb107f2 SetWordWrapTest: make `$WordWrap` variable
Make the `WordWrap` setting variable and provide it via the data provider.
2021-07-07 17:11:37 +02:00
jrfnl 807a80b4a6 SetWordWrapTest: reorganize to use data providers
* Maintains the same test code and test cases.
* Removes code duplication.
* Makes it easier to add additional test cases in the future.
2021-07-07 17:11:35 +02:00
jrfnl c6ed8ad0eb SetWordWrapTest: use `preSend()` not `send()`
For this test, there is no need to actually try to _send_ the message, we just need to make sure that `setWordWrap()` is triggered, which can be done by calling `preSend()` instead of `send()`.
2021-07-07 17:11:33 +02:00
jrfnl b4ab241395 Tests/reorganize: move setWordWrap tests to own file 2021-07-07 17:11:31 +02:00
Marcus Bointon 55ad6349c9
Merge pull request #2421 from jrfnl/feature/tests-reorganize-22
Tests: move puny encoding test to own file
2021-07-07 15:35:24 +02:00
Marcus Bointon a44e3db8d9
Merge pull request #2420 from jrfnl/feature/gitattributes-ignore-codecov-config
.gitattributes: export-ignore code coverage config file
2021-07-07 15:33:33 +02:00
Marcus Bointon fbc5834fc5
Merge pull request #2417 from jrfnl/feature/utf8boundary-test-minor-improvement
Utf8CharBoundaryTest: switch base test case
2021-07-07 15:33:20 +02:00
Marcus Bointon 86aae5c547
Merge pull request #2416 from jrfnl/feature/tests-setup-vs-test-bootstrap
SendTestCase: error out when the testbootstrap file cannot be found
2021-07-07 15:32:53 +02:00
Marcus Bointon a6aa3c8e12
Merge pull request #2415 from jrfnl/feature/tests-add-tests-generateID
Tests: introduce dedicated test for the `PHPMailer::generateID()` method
2021-07-07 15:32:07 +02:00
jrfnl 89af7c5074 PunyencodeAddressTest: add `@covers` tag 2021-07-07 05:15:27 +02:00
jrfnl 09ba11ae08 PunyencodeAddressTest: add additional test method
This new test method covers a range of cases where the `PHPMailer::punyencodeAddress()` method should (and does) return the original input value unchanged.

This test does not require the `mbstring` extension or `idn_to_ascii()` function to be available, which is why it has been set up as a separate test with a separate data provider.
2021-07-07 05:15:24 +02:00
jrfnl 7f6c882395 PunyencodeAddressTest: add additional test case
... to ensure that the `PHPMailer::punyencodeAddress()` only acts on the domain.
2021-07-07 05:15:23 +02:00
jrfnl acb038dac3 PunyencodeAddressTest: reorganize to use data provider
* Maintains the same test code and test cases.
* Makes it easier to add additional test cases in the future.
2021-07-07 05:15:21 +02:00
jrfnl cd563f1e99 PunyencodeAddressTest: set proper run requirements
The "fakefunctions" are all nice and dandy to get past the `idnSupported()` check, but if either of these functions is not _really_ available and therefore doesn't behave as expected, the test would still fail as the expected output of the `PHPMailer::punyencodeAddress()` function would not match.

In other words, this test should not use the `fakefunctions`, but should have a hard requirement for the `mbstring` extension (for the `mb_check_encoding()` and the `mb_convert_encoding()` function calls) and a check for the `idn_to_ascii()` function.
2021-07-07 05:15:20 +02:00
jrfnl 3a62fe304b Tests/reorganize: move puny encoding test to own file 2021-07-07 05:15:18 +02:00
jrfnl a01cc9ba82 .gitattributes: export-ignore code coverage config file
Follow up on 2407.
2021-07-07 05:01:23 +02:00
Marcus Bointon 6dc419aead
Merge pull request #2414 from jrfnl/feature/tests-reorganize-21
Tests: move denial of service tests to own file
2021-07-06 21:49:33 +02:00
jrfnl 8e8fdbf5cb Utf8CharBoundaryTest: switch base test case
Follow up on 2389 and 2412

Now the base `TestCase` has been simplified and only presets the bare minimum of properties in the `PHPMailer` class, the `Utf8CharBoundaryTest` can actually use it.
2021-07-06 21:41:35 +02:00
jrfnl ef35c0daa5 SendTestCase: error out when the testbootstrap file cannot be found
The `PHPMailerTest` class contained a `testBootstrap()` method to verify that the `testbootstrap.php` file exists as the first test in the class.
As the order in which tests are run is not predefined, this is not reliable.

Additionally, the check for the `testbootstrap.php` file is checking a pre-requisite for tests using the `PHPMailer::send()` method, so it would be better to verify via a condition in the `set_up()`.

Now, using such a condition, there is choice: the test can either be marked as "skipped" when the `testbootstrap.php` file can not be found, or be marked as an "error".

As the tests _should_ run, skipping them would hide an error in the dev-user test setup, so showing these tests as errors seems more appropriate.

To that end, the `testBootstrap()` method has been removed and a check for the `testbootstrap.php` file has been added to the `SendTestCase::set_up()` which will now throw an appropriate `Exception` when the file is not found.

Oops... also removes a stray `parent::set_up()` at the start of the local `set_up()` which should have been removed in 218fd13c88
2021-07-06 21:39:41 +02:00
jrfnl 63e9bf5604 Tests: introduce dedicated test for the `PHPMailer::generateID()` method
Note: as the `PHPMailer::generateID()` method is `protected`, a round-about way of testing this is needed, but this test does verify the functioning of the method.

Take note of the notes in the test docblock - the GH Actions scripts running CI, should make sure that each of these scenarios is encountered/tested.
This will be addressed in a separate PR at the end of this round of test changes.
2021-07-06 21:37:29 +02:00
jrfnl eb6dca5521 SecurityDenialOfServiceVectorsTest: various test tweaks
Minor test tweaks:
* Add `@coversNothing` tag.
* Rename the first test (add a number).
* Use `@link` instead of `@see` for links.
* Minor comment punctuation.
2021-07-06 21:28:02 +02:00
jrfnl 6b95da3e65 Tests/reorganize: move denial of service tests to own file 2021-07-06 21:28:00 +02:00
Marcus Bointon e372a5e85b
Merge pull request #2412 from jrfnl/feature/tests-split-and-improve-testcase
Tests: split `TestCase` class into three base test case classes and make more flexible
2021-07-06 20:17:43 +02:00
Marcus Bointon 336b6976b6
Merge pull request #2410 from jrfnl/feature/tests-reorganize-20
Tests: move host validation tests to own file
2021-07-06 20:16:47 +02:00
jrfnl 55c54e46b0 TestCase::checkChanges(): make dynamic
The `TestCase::checkChanges()` method is a way of exposing what properties in the `PHPMailer` class have a changed value compared to their default value in a particular test situation. The method is used for debugging tests.

As things were, the `TestCase::checkChanges()` method would check against a limited set of hard-coded values to determine whether the default value of a property has been updated.

This is unstable as:
1. Default values may change in the `PHPMailer` class and the values within this method would need to be updated to match, which is easily forgotten.
2. New properties may be introduced in the `PHPMailer` class and be relevant to this debug changelog.
    Again, it would require manually adding these new properties to this method to start tracking them.
3. Property values may be changed in the `set_up()` method, which would be a "known change" for a certain test.
    In part such "expected" changes were taken into account in this method based on the previously hard-coded setting changes in `set_up()`.
    With the logic for the property setting from the `set_up()` method now being more flexible, the pre-setting of properties having been reduced to the bare minimum, but also allowing individual test clases to set their own additional changes, keeping track of what is a "known" change by checking against hard-coded values is no longer stable.

With this in mind, I propose to make the `TestCase::checkChanges()` method dynamic.

To that end, this commit:
* Retrieves the default values of all properties of the `PHPMailer` class via the PHP native `get_class_vars()` function.
* Will automatically check for changes in *all* properties, with only a limited set of _exclusions_, effectively changing the changelog from an "inclusion list" to an "exclusion list".
    A select list of properties is excluded from being listed in the changelog via the `TestCase::$changelogExclude` property.
    See the inline documentation in the property for the reasoning behind excluding certain properties from the changelog.
* The value of static properties will always be compared to their default value as registered in the `TestCase::$PHPMailerStaticProps` method and will be listed when different.
    _Note: as documented, this list has to be hard-coded due to Reflection (as well as `get_class_vars()`) not handling default values for static properties correctly._
* The value of non-static properties will be compared to both the known changes made in the `set_up()` method and if the property was not changed in `set_up()`, to their default value. The property will be listed in the changelog when the value is different from the "expected" value, i.e. not a known change from `set_up()` and not the default value.

In addition to this, the representation of the properties will now be created via `var_export()`, which allows for listing `null` and boolean values as well.
2021-07-06 20:05:35 +02:00
jrfnl 218fd13c88 SendTestCase: implement use of the `$propertyChanges` property
The `SendTestCase` gets the values of the properties to be set from the `testbootstrap.php` file.

This introduces a `private` property to map the field names used in `$_REQUEST` to the properties in the `PHPMailer` class and adds logic to the overloaded `set_up()` method to fill the `$propertyChanges` TestCase property. The actual setting of the properties in the `PHPMailer` instance is deferred to the underlying `TestCase` parent class.

Includes adding support for presetting the `bcc` value for feature completeness.

Overloading and/or adding to the `$propertyChanges` array from concrete test cases is, of course, supported, so if individual tests need additional presetting of properties, the same logic as mentioned in the previous commit can be used.
2021-07-06 20:05:35 +02:00
jrfnl f9ce138ff7 PreSendTestCase: reduce amount of properties being preset
After some investigation, it turns out that barely any of these properties are actually needed for the `PHPMailer::preSend()` method to succeed.

This commit removes all presetting of properties for the PHPMailer instance created by the `PreSendTestCase`, save for the bare minimum.

Overloading and/or adding to the `$propertyChanges` array from concrete test cases is, of course, supported, so if individual tests need additional presetting of properties, the same logic as mentioned in the previous commit can be used.
2021-07-06 20:05:35 +02:00
jrfnl f4bb4d7b63 PreSendTestCase: implement use of the `$propertyChanges` property 2021-07-06 20:05:35 +02:00
jrfnl 5620c873d9 TestCase: make the property pre-setting more flexible
This commit makes the property setting in the `TestCase::set_up()` more flexible by combining an overloadable property `$propertyChanges` and a `foreach` loop to set the actual property values.

Concrete test classes can either overload the `$propertyChanges` property with their own version or can add to the default setup using the following pattern:
```php
protected function set_up()
{
    $this->propertyChanges['additional_key'] = 'value';
    // Add more properties...

    parent::set_up();
}
```
2021-07-06 20:05:35 +02:00
jrfnl d7b048cf64 TestCase: split into three different `TestCase`s
The `TestCase::set_up()` was setting quite a number of properties in the `PHPMailer` class.

This makes testing more difficult for the following reasons:
1. The tests can no longer presume the properties in the `PHPMailer` class will have their default values
    This means that tests are not "transparent" (clearly show what is being tested), nor isolated (only target what is specifically being tested).
2. Any changes to the values set in the `set_up()` method may have a ripple effect and create a need for individual test expectations to be adjusted.
3. As the `set_up()` is changing a number of the properties using methods in the `PHPMailer()` class and methods called during the `set_up()` are included in code coverage visualizations, code coverage cannot fully be trusted and it is more difficult to verify that each piece of code has tests covering that code path.

With this in mind, I'm proposing splitting the `TestCase` into three distinct abstract `TestCase`s:
* A basic `TestCase` containing the utility methods and a minimal `set_up()` and `tear_down()`.
* A `PreSendTestCase` for use with tests using the `preSend()` method which requires a few properties to be set.
* A `SendTestCase` for use with tests actually testing the sending of mail using the `send()` method, which needs yet more properties and uses the `testbootstrap.php` file to retrieve the values of those variables.

This commit executes the initial split. Follow-on commits will streamline this further.

Includes adjusting the `TestCase` being extended for select existing unit test classes.
2021-07-06 20:05:35 +02:00
Marcus Bointon ea8bd9373a
Merge pull request #2413 from jrfnl/feature/ghactions-retry-postfix-install-on-fail
GH Actions: automatically retry postfix install on failure
2021-07-06 20:03:19 +02:00
jrfnl 5aa58f8c49 PHPMailer::isValidHost: minor regex tweak
A `]` is a special character in a regex and should be escaped when the literal is intended. While it was not problematic in this case, it is still recommended to escape it.
2021-07-06 20:02:42 +02:00
jrfnl ca11260085 IsValidHostTest: add `@covers` tags 2021-07-06 20:02:42 +02:00
jrfnl e2dec4508c IsValidHostTest: add additional test cases
... which should be handled correctly based on the code in the method under test.

With these additional test cases, the method now has 100% code coverage and is actually tested quite fully.
2021-07-06 20:02:37 +02:00
jrfnl 79d7cc0757 IsValidHostTest: minor reordering of data provider
... for easier scanning what's covered reading.
2021-07-06 19:59:49 +02:00
jrfnl 9291bf2db8 IsValidHostTest: reorganize to use data providers
* Split the test into two tests with each a dedicated data provider
* Maintains the same test code and test cases.
* Makes it easier to add additional test cases in the future.

**Note**: the data set description may need some improvement, I've described them based on my best guess of what they were testing.
2021-07-06 19:59:49 +02:00
jrfnl aa36b51cf3 Tests/reorganize: move host validation tests to own file
As this test does not actually need an instantiated PHPMailer object, this class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase`.
2021-07-06 19:59:49 +02:00
jrfnl 44d195a060 GH Actions: automatically retry postfix install on failure
The postfix installation step fails regularly, resulting in failed CI builds which have to be restarted, while the failure is not due to anything in the PR.

This commit introduces a new action runner for the postfix install, which will automatically retry the install up to 3 times.

If it works as I expect it to, this should eliminate failed CI builds due to postfix installs erroring out.

Ref: https://github.com/marketplace/actions/retry-step
2021-07-06 19:56:26 +02:00
Marcus Bointon 58282fb4ff
Merge pull request #2411 from jrfnl/feature/tests-add-tests-quotedstring
Tests: introduce dedicated tests for the `PHPMailer::quotedString()` method
2021-07-06 19:12:00 +02:00
jrfnl 641b4c2391 Tests: introduce dedicated tests for the `PHPMailer::quotedString()` method
So far, this method did not have dedicated tests, though the `PHPMailerTest::testAttachmentNaming()` test covered this partially.

The test file this commit introduces, tests all aspects of the method as well as documents the current behaviour of the method.

Test cases largely inspired by the tests in the `PHPMailerTest::testAttachmentNaming()` method.
2021-07-06 15:51:16 +02:00
Marcus Bointon 7c862d35da
Update codecov badge 2021-07-06 09:43:04 +02:00
Marcus Bointon 0374a85778
Merge pull request #2408 from jrfnl/feature/tests-reorganize-19
Tests: move mime type test(s) to own file
2021-07-06 09:36:34 +02:00
Marcus Bointon 7fe5bcad1d
Merge pull request #2407 from jrfnl/feature/enable-codecoverage-monitoring-codecov
GH Actions: set up code coverage monitoring via codecov
2021-07-06 09:28:51 +02:00
jrfnl abc401485e MimeTypesTest: add `@covers` tag 2021-07-04 15:13:23 +02:00
jrfnl 55e0813d04 MimeTypesTest: add additional test cases
Including test cases with:
* Different text case.
* An extension not in the list.
* Passing an empty string
2021-07-04 15:13:18 +02:00
jrfnl 6ee8e17c33 MimeTypesTest: reorganize to use data provider
* Maintains the same test code and test case.
* Makes it easier to add additional test cases in the future.
2021-07-04 15:09:05 +02:00
jrfnl 0a84d20565 Tests/reorganize: move mime type tests to own file
As this test does not actually need an instantiated PHPMailer object, this class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase`.

Note: this doesn't move the complete test from the original test file, just select parts of the test method.
2021-07-04 15:09:03 +02:00
jrfnl c16da1afa8 GH Actions: set up code coverage monitoring via codecov
The Codecov service is a way to monitor test vs code coverage of a project over time and allows for the code coverage % + delta to be reported in each PR.

This commits:
* Adds a Codecov configuration.
* Adds a convenience script to the `composer.json` file to run the tests with or without code coverage.
* Adds a new matrix variable to the GH Actions `test` workflow to run the tests with code coverage and send the results to the Codecov service.
    Notes:
    - This disables the code coverage reporting in the "normal" test runs, including disabling `xdebug` for those runs which should make them slightly faster.
    - This splits the test runs into two sets:
        * High/low PHP are being run with code coverage (and have been removed from the "normal" test run matrix).
        * For all other PHP versions, the tests are being run without code coverage.
* Adds a badge to the README to show the current code coverage %.
2021-07-04 15:03:01 +02:00
Marcus Bointon e0c140a127
Merge pull request #2405 from jrfnl/feature/icaltest-simplify
ICalTest: minor simplifications
2021-07-04 14:59:20 +02:00
Marcus Bointon 1988527535
Merge pull request #2404 from jrfnl/feature/tests-reorganize-18
Tests: move pathinfo tests to own file
2021-07-04 14:51:47 +02:00
Marcus Bointon f4eba3a68c
Merge pull request #2403 from jrfnl/feature/setup-php-linting
GH Actions: add PHP linting job
2021-07-04 14:50:43 +02:00
Marcus Bointon f3978c38cc
Merge pull request #2406 from jrfnl/feature/remove-PR-template
Remove PR template
2021-07-04 14:50:09 +02:00
jrfnl ee9c363160 Remove PR template
PR 2373 changed the CI in such a way that coding standards errors will now be shown inline in the code of PRs.

With that change in place, having the information about running PHPCS in the pull request template has become redundant.
2021-07-04 01:47:09 +02:00
jrfnl cdc2164361 ICalTest: minor simplifications
Follow up on 2384.

1. This test does not actually need a regular expression to test the mime message, an `assertStringContainsString()` assertion is sufficient.
2. Remove duplicate information from the `$expected` parameter. The `Content-Type: text/calendar; method=` part will always be the same. Only the method name will change.
2021-07-03 22:00:40 +02:00
jrfnl 8771d5f146 MbPathinfoTest: add `@covers` tag 2021-07-03 13:00:03 +02:00
jrfnl 78cb650429 MbPathinfoTest: add additional test cases for `testMb_pathinfoWithOptions()`
... to ensure all supported options are covered by a test.
2021-07-03 13:00:01 +02:00
jrfnl 487551ddac MbPathinfoTest: add additional test cases for `testMb_pathinfoWithoutOptions()`
Including test cases with:
* Spaces in the paths.
* Incomplete file paths.

Note: the "empty string" test may need looking at.... should this return an empty array instead ?
2021-07-03 12:59:59 +02:00
jrfnl 3a03d51399 MbPathinfoTest: reorganize to use data providers
* Replace the existing test code with two new test methods using data providers.
* Maintains the same test code and test cases.
* Makes it easier to add additional test cases in the future.
2021-07-03 12:59:57 +02:00
jrfnl 64fa2bf831 Tests/reorganize: move pathinfo tests to own file
As this test does not actually need an instantiated PHPMailer object, this class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase`.

Note: this doesn't move the complete test from the original test file, just select parts of the test method.
2021-07-03 12:59:55 +02:00
jrfnl f0cfd3f49d GH Actions: add PHP linting job
This commit:
* Add a new dependency on the PHP Parallel Lint package for fast PHP linting.
    The PHP Parallel Lint package, in combination with the PHP Console Highlighter provides the following advantages in comparison with "plain" PHP linting:
    - Higher speed due to the parallel processes.
    - Improved usability by providing color coded syntax highlighting of found errors on the command-line.
    - Integration with the `cs2pr` tool, allowing for the results of the lint command to be shown in-line in PRs.
* Adds a Composer `lint` script for easy access to the tool for devs, while making sure the correct command line parameters will be used.
    The linting command as currently set up, will also check the example files for linting errors.
* Adds a GH Actions job for linting the code on the high/low supported PHP versions, one arbitrary interim version + an experimental build against PHP 8.1.
    The `cs2pr` tool has been enabled and will show the results of the non-experimental lint runs in-line in PRs.
    **Note**: For PHP 8.1, the `cs2pr` tool is not used as there is a known issue in the Parallel Lint tool with PHP 8.1 which breaks on the checkstyle reporting. There is already a [PR open](https://github.com/php-parallel-lint/PHP-Parallel-Lint/pull/64) to fix this upstream. Once this PR has been merged and a new version of Parallel Lint has been released, the separate step for PHP 8.1 linting can be removed.
 * Makes the `test` job in the GHA workflow dependent on the `lint` job having passed...
     ... as the tests would fail anyway if there are linting errors.
    Also adjusts the name of the `test` jobs to include the word "Test" so they can be easily distinguished from the Lint jobs.

Refs:
* https://github.com/php-parallel-lint/PHP-Parallel-Lint
2021-07-03 12:55:00 +02:00
Marcus Bointon 57a1323ef3
Merge pull request #2402 from jrfnl/feature/ghactions-various-tweaks
GH Actions: various tweaks
2021-07-03 12:47:47 +02:00
Marcus Bointon 69655d247a
Merge pull request #2401 from jrfnl/feature/tests-reorganize-17
Tests: move file name to type tests to own file
2021-07-03 12:47:25 +02:00
jrfnl 15994972fa GH Actions: test matrix - fix typo
There was a stray `.` in the string.
2021-07-02 17:48:31 +02:00
jrfnl 61e8701e02 GH Actions: test run - remove redundant dependency
The `xdebug` extension is already tagged as needed via the `coverage` setting, no need to add it to the `extensions` list.
---

Note: generally speaking, I personally normally don't pass an `extensions` list and allow the `setup-php` action to run with the default extensions, which is sufficient in most cases and would be sufficient here as well.

More than anything, I use the `extensions` key to _disable_ extensions for certain test runs, rather than enable them. Just something to consider.

The below documentation should give more insight.

Refs:
* https://github.com/shivammathur/setup-php/wiki/Php-extensions-loaded-on-ubuntu-18.04
* https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support
2021-07-02 17:46:08 +02:00
jrfnl 8a0e0d09f3 GH Actions: use predefined action to run composer install with caching
It is generally speaking a good idea to cache downloaded Composer packages between runs for performance reasons.

Now, this can be set up manually and would add two more steps to the scripts, or Ben's `composer-install` action can be used which will handle it all for you. The `composer-install` action is versatile and allows for passing additional parameters, so is perfectly suitable for this.

Ref: https://github.com/marketplace/actions/install-composer-dependencies
2021-07-02 17:41:07 +02:00
jrfnl a7c19c069b GH Actions: test run - remove "dependency version" matrix key
Running against stable/lowest dependencies is relevant when a package has runtime (non-dev) dependencies.
However, PHPMailer does not have runtime dependencies.

In other words, the `dependency-version` matrix key is redundant and unused, so we may as well remove it.
2021-07-02 17:37:19 +02:00
jrfnl bc5fe4dc1f GH Actions: CS run - remove matrix
The CS run only needs to run against one PHP version, so there is no need to set up a matrix for this.
2021-07-02 17:34:58 +02:00
jrfnl decf70fa2b FilenameToTypeTest: add `@covers` tag 2021-07-02 17:25:47 +02:00
jrfnl 76aa6a06cb FilenameToTypeTest: add some additional test cases
... which should be supported based on the function docs.

Note: the "empty string" test may need looking at.... is this a bug ?
2021-07-02 17:25:45 +02:00
jrfnl 6ba68af48c FilenameToTypeTest: reorganize to use data providers
* Maintains the same test code and test cases.
* Removes code duplication.
* Makes it easier to add additional test cases in the future.
2021-07-02 17:25:44 +02:00
jrfnl 77c1d87123 Tests/reorganize: move file name to type tests to own file
As this test does not actually need an instantiated PHPMailer object, this class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase`.

Note: this doesn't move the complete test from the original test file, just select parts of the test method.
2021-07-02 17:25:42 +02:00
Marcus Bointon 35ab349e01
Merge pull request #2400 from jrfnl/feature/tests-reorganize-16
Tests: move line break normalization tests to own file
2021-07-02 16:57:52 +02:00
jrfnl 8bfb7d1e2f NormalizeBreaksTest: add `@covers` tag 2021-07-02 15:23:43 +02:00
jrfnl d6f3fea0ea NormalizeBreaksTest: add extra test
... to verify the behaviour of the `PHPMailer::normalizeBreaks()` method when the `PHPMailer::$LE` property has been customized.
2021-07-02 15:23:43 +02:00
jrfnl 14d7458826 NormalizeBreaksTest: add additional test case
... to ensure text without line breaks is returned unchanged.
2021-07-02 15:23:43 +02:00
jrfnl ade3b63428 NormalizeBreaksTest: reorganize to use data providers
* Maintains (largely) the same test code and test cases.
* Removes code duplication.
* Makes it easier to add additional test cases in the future.
2021-07-02 15:23:43 +02:00
jrfnl 0f916dd90a Tests/reorganize: move line break normalization tests to own file
As this test does not actually need an instantiated PHPMailer object, this class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase`.

Note: this doesn't move the complete tests from the original test file, just select parts of two test methods.
2021-07-02 15:23:43 +02:00
Marcus Bointon 49a2ea60ee
Merge pull request #2399 from jrfnl/feature/testcase-improve-on-static-prop-stability
TestCase: iterate on resetting of static properties
2021-07-02 12:12:46 +02:00
jrfnl f6715fd047 TestCase: iterate on resetting of static properties
The `PHPMailer::preSend()` method may alter the value of the _`protect static`_ `PHPMailer::$LE` property.

a9978d2079/src/PHPMailer.php (L1494-L1504)

This means that tests which rely on the value of the property being the default, may start to fail unexpectedly depending on the _order_ in which tests are being run.
I.e. if the test relying on the default value is run first, all will be fine, however, if that same test is run _after_ a test which calls `preSend()` on a non-Windows box with PHP < 8.0 and with `$this->Mailer` set to `mail`, the test may fail unexpectedly.

This commit fixes that by expanding the previously introduced "resetting of static properties" logic.

This commit:
* Expands the list of static properties in the `TestCase` class to include the `PHPMailer::$LE` property.
* Introduces two new methods to the `TestCase` class:
    - `resetStaticProperties()` to reset all static properties listed in the `TestCase::$PHPMailerStaticProps` property to their default values.
    - `updateStaticProperty()` to change the value of one individual static property in a class.
* The `updateStaticProperty()` method was made `public static` to allow for tests which do not need an instantiated PHPMailer object and thus extend the `Yoast\PHPUnitPolyfills\TestCases\TestCase` directly to be able to use the method as well.
    If any such tests would use the method, that particular test will be responsible for resetting the value back to the default after the test.
* The resetting of the static properties has also been moved from the `set_up()` to the `tear_down()` method.
    As mentioned above, these static properties may be used by both tests extending this `TestCase` as well as test extending the `Yoast\PHPUnitPolyfills\TestCases\TestCase`. With that in mind, resetting _after_ each test will be more stable, as long as tests which extend the `Yoast\PHPUnitPolyfills\TestCases\TestCase` and would change static properties clean up after themselves.

**Note**: I'm not including the `PHPMailer::$IcalMethods` property in this change as AFAICS, this property is not being changed anywhere in the package code and as the property is `protected`, it cannot easily be changed from within a test either (and if it would be changed by a test, that test would be responsible for resetting it).

Also note: due to limitations in the `Reflection` extension, a hard-coded list of the default values of the static properties will need to be maintained in the `TestCase`. This cannot be helped as the `Reflection` extension does not have a way to accurately retrieve the default value of static properties in a PHP cross-version compatible manner.
2021-07-02 00:17:36 +02:00
Marcus Bointon a9978d2079
Merge pull request #2398 from jrfnl/feature/testcase-minor-tweaks
TestCase: various tweaks
2021-07-01 22:50:40 +02:00
jrfnl afd0da8a20 TestCase: minor tidying up
... of the inline comments in the `TestCase` file.
2021-07-01 21:52:19 +02:00
jrfnl b97983fcf6 TestCase: add support for initializing PHPMailer with exceptions
The `PHPMailer::__construct()` method has an optional `$exceptions` property to throw exceptions on errors.

Up to now, the `PHPMailer` instance created by the `set_up()` would not pass any parameters, effectively instantiating `PHPMailer` without turning on exceptions.

In a test situation it may be useful for tests to test the behaviour of a method _with_ and _without_ the exceptions option and to test that certain exceptions are thrown and throw the correct message.

With that in mind, I'm introducing a `USE_EXCEPTIONS` class constant to the `TestCase` which can be overloaded in individual test classes and will be used by the `set_up()` method to determine whether it will be instantiated with exceptions or not.

Includes introducing an overload of the class constant in one of the test class for which it would seem appropriate at this time.
Note: this does mean that the `testDKIMSigningMail()` test will show as errored instead of failed if no SMTP connection could be made, but that IMO is the more correct status anyhow.
2021-07-01 21:50:57 +02:00
jrfnl af68fb202a TestCase::setAddress(): add support for `ReplyTo`
This allows for using the `setAddress()` method in a more consistent manner (where appropriate).

Includes introducing the use of the `setAddress()` function in a few select places.

Note: I do wonder whether this method should ever be used outside of `set_up()` and `tear_down()`, but that is for further discussion and outside the scope of this commit.
2021-07-01 19:15:07 +02:00
jrfnl 1c32844af2 TestCase: remove unused property 2021-07-01 19:03:17 +02:00
Marcus Bointon c5c35e4378
Merge pull request #2397 from jrfnl/feature/tests-ensure-static-property-starts-with-default-value
Tests: stabilize handling of static properties in PHPMailer class
2021-07-01 18:49:15 +02:00
Marcus Bointon a8967c31a2
Merge pull request #2395 from jrfnl/feature/tests-reorganize-15
Tests: move wrapText test to own file
2021-07-01 18:48:13 +02:00
jrfnl 21fd99b057 ValidateAddressTest: stabilize handling of static `$validator` property in PHPMailer class
While this class does not (currently) _change_ the `PHPMailer::$validator` property, it does rely on the default value being the expected default.

By resetting the value of the property before and after the class, this is safeguarded for the current tests.
2021-07-01 18:29:49 +02:00
jrfnl 2077a3dc31 TestCase: stabilize handling of static properties in PHPMailer class
Public static properties changed by individual tests were not being reset to their default value prior to the next test being run.
This could influence the test results of subsequent tests as static properties are not automatically reset when a new instance of a class is instantiated. See: https://3v4l.org/8s1RB

Luckily this didn't aversely affect the tests so far, but should be safeguarded for the future.

There are only three static properties in the `PHPMailer` class, with only one of these being `public`.

This commit introduces a code snippet which will reset any static properties as listed in the `$PHPMailerStaticProps` property of the `TestCase` to the default value, as also set in the `$PHPMailerStaticProps` property, at the start of the `set_up()` which is run before each test using the `TestCase`.

For now, this is only relevant for the `ValidateAddressCustomValidatorTest` test and only when the `testSetDefaultValidatorToCustom()` test would fail before resetting the property. All the same, having the reset in place by default will ensure that future tests which change this property won't introduce side-effects to other tests.
2021-07-01 18:29:30 +02:00
jrfnl b5826af2df WrapTextTest: add `@covers` tag 2021-06-30 22:45:01 +02:00
jrfnl e1bf4a0dd5 WrapTextTest: add additional test cases
... in part to document the behaviour of the function, in part to actually test it.

By the looks of it more tests are still needed though to raise the code coverage of this function to 100%.

I'd also recommend adding tests with different charset settings as the current tests are all based on the default charset (`CHARSET_ISO88591`).

Also note: the "empty string" test may need looking at.... is this a bug ?
2021-06-30 22:44:34 +02:00
jrfnl 3ed9f04ff2 WrapTextTest: reorganize to use data providers
* Maintains the existing test cases.
* Prevent one failing assertion hiding a potential second failure.
* Makes it easier to add additional test cases in the future.
2021-06-30 22:36:11 +02:00
jrfnl f9d63167df Tests/reorganize: move wrapText test to own file 2021-06-30 22:36:09 +02:00
Marcus Bointon 03edf2348c
Merge pull request #2394 from jrfnl/feature/tests-skip-pop-tests-on-windows
PopBeforeSmtpTest: skip on Windows
2021-06-30 15:31:12 +02:00
jrfnl 39426ae930 PopBeforeSmtpTest: skip on Windows
The shell commands used in the test are not available on Windows, so these tests would always fail, so we may as well skip them.
2021-06-29 12:36:07 +02:00
Juliette c717120668
Tests/reorganize: move Auth CRAM MD5 test to own file (#2392)
As this test is marked _incomplete_, no further review of the test has been done and no `@covers` tag has been added.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-29 11:22:51 +02:00
Marcus Bointon 84325b80b3
Improve simple messageid regex for default pattern 2021-06-28 10:54:41 +02:00
Marcus Bointon cb25751853
Minor tweak to MessageID regex, fixes #2388 2021-06-28 10:28:28 +02:00
Juliette 3a30a0b963
PHPMailer::createHeader: minor tweak to messageID validation (#2391)
Minor improvement to the *massive* improvement from 853afcb858.

The `$` in a regex means "match the end of a string or new line right before the end". Using the `D` modifier prevents the matching on the new line.

Ref:
* https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php
* http://web.archive.org/web/20131226183006/http://blog.php-security.org/archives/76-Holes-in-most-preg_match-filters.html

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-28 10:05:36 +02:00
Marcus Bointon 853afcb858
Stricter checking of custom Message IDs, see #2388 2021-06-28 08:51:09 +02:00
Juliette a55b8b68af
Tests: move utf8CharBoundary test to own file (#2389)
* Tests/reorganize: move utf8CharBoundary test to own file

* Utf8CharBoundaryTest: reorganize to use data providers

This:
* Renames the test method and moves the description to the docblock.
* Decouples the test from the PHPMailer `TestCase` as it doesn't need the complete `set_up()` and `tear_down()`.
* Moves the test cases to a data provider.
* Adds a `@covers` tag.

* Utf8CharBoundaryTest: add `@todo` reminder

This really could do with some more test cases to properly cover all paths and branching in the method.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-28 08:51:00 +02:00
Juliette 6477e1a6d7
Tests: move address splitting tests to own file (#2387)
* Tests/reorganize: move address splitting tests to own file

As this test does not actually need an instantiated PHPMailer object, this class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase`.

* ParseAddressesTest: reorganize the testAddressSplitting() test

This commit:
* Adds two new test methods, one for testing address splitting using the PHPMailer native implementation, one for testing address splitting using the IMAP implementation.
    Both these methods use the same data provider.
* Adds a PHPUnit `@requires` tag for the IMAP extension to the IMAP version of the test.
* Adds a type check `assertIsArray()` before doing the content checks on the method return value.
* Changes the tests to do a more detailed `assertSame()` test instead of the previous `assertCount()` and `assert[Not]Empty()` checks.
* Sets up the data provider to have the detailed output arrays for comparison.

The actual test cases in the rewritten test are the same as were previously being tested.

* ParseAddressesTest: replace remaining test by dataprovider entry

The `testImapParsedAddressList_parseAddress_returnsAddressArray()` and the `testImapParsedAddressList_parseAddress_returnsAddressArray_usingImap()` tests were largely duplicates of each other, with the only real difference being the value of the second parameter passed to the `PHPMailer::parseAddresses()` method (`$useimap`).

This commit:
* Removes these two tests in favour of adding the test case to the data provider added in the previous commit.

In effect, the same test case is still being tested just as thoroughly now, just with less (test) code.

* ParseAddressesTest: add two more (invalid) test cases to `dataAddressSplitting()`

* PHPMailer::parseAddresses(): bug fix

If invalid email addresses are passed to any of the IMAP functions - in this case to `imap_rfc822_parse_adrlist()` - IMAP may generate error notices or warnings.
If nothing is done with these, they will be displayed at PHP shutdown.

The notice will look something like this, for instance:
```
Notice: Unknown: Missing or invalid host name after @ (errflg=3) in Unknown on line 0
```

This bug was exposed by the newly added unit tests. You should be able to see the issue if you run the tests over the previous commit.

As PHPMailer is not interested in invalid addresses, we can just ignore these notices and errors, but we *do* have to _clear_ them to prevent the notices from being thrown.

Refs:
* https://www.php.net/manual/en/function.imap-rfc822-parse-adrlist.php
* https://www.php.net/manual/en/function.imap-errors.php
* https://github.com/ddeboer/imap/issues/308
* https://stackoverflow.com/questions/3378469/how-to-get-rid-of-error-messages-with-phps-imap-fetchstructure

* ParseAddressesTest: reorder the test cases in `dataAddressSplitting()`

... to a slightly more sane order for humans to follow and see at a glance what is being tested..

* ParseAddressesTest: add `@covers` tags

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-25 15:39:21 +02:00
Juliette 033e2d7586
Tests: move message ID test to own file (#2386)
* Tests/reorganize: move message ID test to own file

* GetLastMessageIDTest: use the correct parameter order

For PHPUnit assertions which expect an `$expected` and a `$result` parameter, the parameter order is always `( $expected, $result, ...).

While it may not seem important to use the correct parameter order for assertions doing a straight comparison, in actual fact, it is.
The PHPUnit output when the assertions fail expects this order and the failure message will be reversed if the parameters are passed in reversed order which leads to confusion and makes it more difficult to debug a failing test.

* GetLastMessageIDTest: split into separate tests

* GetLastMessageIDTest: reorganize to use data providers

While initially still only addressing the original test cases, using a data provider here will allow for adding additional test cases more easily.

* GetLastMessageIDTest: add additional tests

Adding additional tests based on the code this is supposed to be testing.

**Note**: I've put the test cases in the "valid"/"invalid" data providers based on the current reality.
Some of the test cases I've added to the "valid" data provider _might_ actually be **_invalid_**. If that's the case, the regex used on line 2554 needs adjusting to account for them (after which the test cases can be moved to the "invalid" data provider).

* GetLastMessageIDTest: add `@covers` tags

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-25 14:26:57 +02:00
Juliette 4ad936e3b5
Tests: move line length detection tests to own file (#2385)
* Tests/reorganize: move line length detected tests to own file

* HasLineLongerThanMaxTest: various test tweaks

Minor test tweaks:
* Add `@covers` tag.
* Inline comment punctuation.
* Minor code readability tweaks.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-25 11:28:10 +02:00
Juliette 6d613a4c8b
Tests: move ICal tests to own file (#2384)
* Tests/reorganize: move ICal tests to own file

* ICalTest: reorganize to use data providers

These three tests were 99% duplicate code. Using a data provider removes the duplication, while the actual tests being run are still 100% the same, including same test count and assertion count.

* ICalTest: add additional tests

... to ensure all valid methods are checked.

Adding these extra tests is a breeze now with the data provider setup.

* ICalTest: various test tweaks

Minor test tweaks:
* Add `@covers` tag. **_<- is this correct ?_**
* Minor comment punctuation.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 21:18:12 +02:00
Juliette a4e3c130ae
Tests: move OAuth test to own file (#2383)
* Tests/reorganize: move OAuth test to own file

This test uses the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase` base class as it doesn't need the `set_up()` or `tear_down()` methods from the PHPMailer base test class.

* OAuthTest: various test tweaks

Minor test tweaks:
* Add `@covers` tags.
* Add "failure" messages to assertions.
* Minor comment punctuation.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 19:19:36 +02:00
Juliette 8317ed0bb5
Tests: move POP before SMTP tests to separate file (#2382)
* Tests/reorganize: move POP before SMTP tests to own file

This also removed the `$pids` property and handling from the PHPMailer base `TestCase` and moves this to the POP test class.

As this test now does not actually need an instantiated PHPMailer object, this class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase`.

* PopBeforeSmtpTest: move `@group` tags

... to the class level and remove them from the individual test functions.

* PopBeforeSmtpTest: various test tweaks

Minor test tweaks:
* Add `@covers` tag at class level.
* Inline comment punctuation.
* Minor code readability tweaks.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 15:22:24 +02:00
Juliette d2780d4125
Tests: move tests related to DKIM to separate file (#2381)
* Tests/reorganize: move DKIM related tests to own file

* DKIMTest: stabilize removal of private key file

When an assertion in a test fails, the rest of the code within the test method is no longer executed.
This means that for a test which - like three out of the five DKIM test - creates a file, the test "clean up" via `unlink()` is also no longer executed.
It also means that one test may - unintentionally - interfere with the results of another test due to the file still existing, while it is expected to have been removed.

Aside from that, the `$privatekeyfile` variable used in the various test is the same everywhere, but not consistently used in the tests, as the `'dkim_private.pem'` is hard-coded in multiple places, which decreases maintainability.

This commit fixes both these issues by:
* Declaring a class constant with the target private key file name for use in the test method.
* Implements use of this constant throughout the tests.
* Removes the `unlink()` call from the individual tests, in favour of executing it via the test `tear_down()`, which should still be executed, even when a test has failed.
    Note: as the file also contains two tests which do not create the private key file, but for which the `tear_down()` would also be executed, the `unlink()` call is wrapped in a `file_exists()`.

* DKIMTest: move `@group` tags

... to the class level and remove them from the individual test functions.

* DKIMTest: add missing `@requires` tags

Three out of the five tests actually require the `openssl` extension. Only one was so marked.

* DKIMTest: various test tweaks

Minor test tweaks:
* Rename a test to a more specific name to allow for easier test filtering via PHPUnit.
* Add `@covers` tags (Needs review!)
* The `@see` tag is indented for code elements. For external links, the `@link` tag should be used.
* Inline comment punctuation.
* Minor code readability tweaks.

* DKIMTest: add two additional tests

... to cover the "open SSL" not available case.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 13:20:27 +02:00
Juliette b7910e3978
Tests: move tests for the various mail transports to separate file (#2380)
* Tests/reorganize: move email transport tests to own file

* MailTransportTest: various test tweaks

Minor test tweaks:
* Add `@covers` tags (Needs review! - especially the `testMailSend()` method seems to do more than it should)
* Check if test skipping is necessary at the start of a test method.
* Add "failure message" for each assertion in tests with multiple assertions.
* Tidy up inline comments.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 10:30:20 +02:00
Marcus Bointon 3991967c80
Only need these validator functions to be loaded for this test 2021-06-23 23:50:26 +02:00
Marcus Bointon ff1abf608c
Don't need this noise; a failing test is enough 2021-06-23 23:42:09 +02:00
Marcus Bointon 723455d1b7
Comment 2021-06-23 23:42:09 +02:00
Marcus Bointon c773286b98
Readme 2021-06-23 23:42:09 +02:00
Marcus Bointon 8de8425712
Security note 2021-06-23 23:42:09 +02:00
Marcus Bointon 482e18ee05
Gmail notes 2021-06-23 23:42:08 +02:00
Marcus Bointon e0975c2c86
Prefer SMTPS over SMTP+STARTTLS in examples 2021-06-23 23:42:08 +02:00
Juliette ee70f2265e
Tests: move tests for PHPMailer::validateAddress with custom validator to separate file (#2379)
* Tests/reorganize: move email validation using custom validator test to own file

* ValidateAddressCustomValidatorTest: reorganize test

Split the test into three tests, each testing a specific situation and use a data provider for one of the tests.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 23:42:01 +02:00
Juliette e6445ac201
Tests: move tests for `PHPMailer::validateAddress` to separate file (#2378)
* Tests/reorganize: move email validation test to own file

As this test does not actually need an instantiated PHPMailer object, this class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase`.

* ValidateAddressTest: reorganize to use data providers

The original test as was, would run through a number of arrays and keep track of fails/passes, only to use an assertion at the end to check that the list of "fails" was empty.
In addition to this, the original test also contained some additional assertions which would never be run if the earlier assertion would fail. (failing assertion possibly hiding more failing (or passing) assertions).

Using data providers for these kind of data array based tests, has a couple of advantages:
1. Each data set is counted as an individual test.
2. Each test can be set up to have only one assertion.
3. When a test for a data set fails, PHPUnit just moves on to the next data set, instead of failing the test and not examining the rest of the test cases.

With that in mind, this test has now been reorganized into multiple test functions, each with one or more data providers.

In addition to that:
* Each data set in a test provider is named after the email address it provides, with optionally a prefix to show which data provider it came from.
    This has two advantages:
    1. When using the `--testdox` runner, the output will list each test case by name.
    2. When a test fails, instead of getting a "failed with data set 65" message, you now get a "failed with data set _data set name_" message, and as the data set name is the same as the email address value, it's easy to see which test case failed.
* Each assertion now has a "failure message" attached, as the default "true does not match false" message from PHPUnit is not very descriptive.

* ValidateAddressTest: enable two out of three of the unused data sets

The original test contained three additional data sets which were *not* being tested:
* `$invalidphp`
* `$validqandc`
* `$validipv6`

The `$invalidphp` data set has now been set up as a data provider and has been added to the `testInvalidAddresses()` test.
The `$validipv6` data set has now been set up as a data provider and has been added to the `testValidAddresses()` test.

And the `$validqandc` data set has been removed after consultation with synchro.

Note: there are six test in the `$validipv6` array which are currently failing. Those have been commented out to be addressed later.

* ValidateAddressTest: add `@todo`

While the tests in this class will show that the `PHPMailer::validateAddress()` is 100% covered by tests, the tests do **not** in actual fact test all functionality properly.

To that end, I've added a recommendation in a `@todo` at the top of the class to document how these tests could be further improved in a future iteration.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 23:09:07 +02:00
Juliette c576a531b1
PHPMailerLangTest: rename and minor tweaks (#2377)
* PHPMailerLangTest: rename test class to `TranslationCompletenessTest`

As the test class has been moved to a separate directory, we may as well make the class name more descriptive of what the test class actually does.

* TranslationCompletenessTest: various test tweaks

Minor test tweaks:
* Move `@group` tag up to class level.
* Add a `@coversNothing` tag as this test is more a maintainer utility/package test than a test to cover functionality in code.
* Tidy up inline comments.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 23:04:15 +02:00
Juliette 6372ff87c1
Tests: introduce base testcase and move test classes to subdirectories (#2376)
* Tests/reorganize: add an abstract base testcase

As a first step towards reorganizing the tests, this commit:
* Creates an abstract base `TestCase` class which can be extended by concrete child test classes and holds the generic properties and helper methods for use throughout the tests.
    Based on their use, the visibility of properties and methods have been adjusted for the new setup.
* Removes the generic property and helper method declarations from the concrete test class.
* Moves the `require` statement for the `validators.php` file to a `set_up_before_class()` method in the base `TestCase`.

* Tests/reorganize: define base directory in set_up_before_class

The `$this->INCLUDE_DIR` property which points to the project root directory does not change at any time during the test run, but was being redefined for every test in the `set_up()` method.

As this is in effect a _constant_ value, let's define it as a constant in the TestCase `set_up_before_class()` method instead.

Notes:
Both actions executed in the `set_up_before_class()` method are typically things for a test bootstrap file.
However, to allow for PHPUnit to be able to run from both a Composer install as well as a Phar file, without having to create custom autoloaders, it is simpler to have the `vendor/autoload.php` file as the bootstrap file as, in that case, PHPUnit will handle the loading order and prevent loading conflicting PHPUnit files from a Composer install when running via the Phar.
With this in mind, putting these actions in a `set_up_before_class()` method is a valid compromise.

* Tests/reorganize: move actual test files to subdirectories

... leaving the test root directory to only contain test utility files.

Note: I've added a second entry for the test generated files to the `.gitignore`. Adding this entry instead of replacing the entry allows for any existing generated files in contributor clones to continue to be ignored.
At a later point in time, it could be elected to remove the original entry, once all active contributors have updated their installs and removed any stray generated files from their `test` root directories.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 22:43:46 +02:00
Juliette 711de8bf70
GH Actions: run tests on PRs and show CS violations (#2373)
* GH Actions: run on PRs and allow for manually triggering

Currently the workflow only ran on `push` events, which - as forks have to enable the workflows - means that PRs could be submitted without CI having been run and you'd only see the CI results on merge.

By adding the `pull_request` event, it is ensured that CI is always run within the main repo for pull requests. This also allows for branch protection to be enabled with "required statuses".

Additionally, triggering a workflow for a branch manually is not supported by default in GH Actions, but has to be explicitly allowed.

This is useful if, for instance, an external action script or composer dependency has broken.
Once a fix is available, failing builds for `master` or open PRs can be retriggered manually instead of having to be re-pushed to retrigger the workflow.

Ref: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/

* GH Actions: report CS violations in the PR

Currently the PR template asks for people to run the CS tooling.

As the PHPCS tool is also run in the test workflow and this workflow - per the previous commit - will now also be run on pull requests, we can make life easier on contributors.

The cs2pr tool allows to display the results from an action run in checkstyle format in-line in the PR code view.
This commit enables this for PHPCS, which means that the code view will now show CS violations in the PR.

Ref: https://github.com/staabm/annotate-pull-request-from-checkstyle

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 11:03:18 +02:00
Juliette c33a304650
Tests: various improvements (#2372)
* Tests: remove unused test bootstrap file

The PHPUnit config file requires the `vendor/autoload.php` file as the test bootstrap and this file is not referenced anywhere in the code base, so this is dead code.

* Tests: apply test method naming conventions

For tests to be picked up by PHPUnit automatically, the method should start with the prefix `test`.
For differently named tests, the `@test` annotation can be used to still mark a method as a test and get PHPUnit to run it.

As the vast majority of tests use the "prefix the method with `test`" convention, this changes the names of the few tests which did not comply with that convention and removes the `@test` annotations.

* Tests: use test skipping where appropriate

In this case, the condition being tested should never be `false`, so could possibly be removed.

All the same, if the condition _would_ result in a `false`, the test would be marked as "risky" as no assertions would be run by it.

This can be avoided by using the condition to set a test skip annotation, instead of wrapping the actual test code in the condition.

* Tests: use strict assertions

PHPUnit contains a variety of assertions and the ones available has been extended hugely over the years.
To have the most reliable tests, the most specific assertion should be used.

Most notably, this changes calls to `assertEquals()` to `assertSame()`, where `assertEquals()` does a loose type comparison `==` and `assertSame()` does a strict type `===` comparison.

The only real exception to this is when comparing two objects, as in that case, the objectID will not be the same, so those should still use `assertEquals()` - or the PHPUnit 9.4.0 `assertObjectEquals()` method for comparing value objects using a callback method in the ValueObject class.

* Tests: use the correct parameter order

For PHPUnit assertions which expect an `$expected` and a `$result` parameter, the parameter order is always `( $expected, $result, ...).

While it may not seem important to use the correct parameter order for assertions doing a straight comparison, in actual fact, it is.
The PHPUnit output when the assertions fail expects this order and the failure message will be reversed if the parameters are passed in reversed order which leads to confusion and makes it more difficult to debug a failing test.

* Tests: use static closures

... when the closure doesn't use `$this`.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 11:01:19 +02:00
Juliette 8eacfe7925
GH Actions: don't run the docs workflow on forks (#2371)
The `docs` workflow to deploy the GH Pages website is run on pushes to `master`, but that includes pushes to `master` in forks, which obviously can't deploy to the GH Pages site.

This means that in forks (and there are nearly 9000 of them), this workflow will always fail, while in reality, it shouldn't be run in the first place.

So, I'd like to propose making this small change, which _should_ prevent the `docs` workflow from being run on forks.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 11:00:21 +02:00
Juliette 702502aca2
.gitattributes: sync with reality (#2374)
The `.gitattributes` file was no longer in line with the files in the repo. Fixed now.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 10:59:47 +02:00
Juliette 4ba9531372
PHP 8.1: ensure consistent exception messages (#2365)
From the PHP 8.1 changelog:
> `htmlspecialchars()`, `htmlentities()`, `htmlspecialchars_decode()`,
>` html_entity_decode()` and `get_html_translation_table()` now use
> `ENT_QUOTES | ENT_SUBSTITUTE` rather than `ENT_COMPAT` by default. This means
> that `'` is escaped to `&#039;` while previously it was left alone.
> Additionally, malformed UTF-8 will be replaced by a Unicode substitution
> character, instead of resulting in an empty string.

Ref: 28a1a6be08/UPGRADING (L149-L154)

If effect this means that the output of the above mentioned functions may be different depending on the PHP version and the passed text string, unless the `$flags` parameter is explicitly passed.

This patch proposes to add the old default to the one affected function call in PHPMailer, though most other flag combination choices would be just as valid, as long as a `$flags` parameter is passed.

Ref: https://www.php.net/manual/en/function.htmlspecialchars.php

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-22 19:00:42 +02:00
Juliette 9093c84614
Composer: update version constraints for PHPUnit Polyfills (#2366)
PHPUnit Polyfills 1.0.0 has been released.

Ref: https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/1.0.0

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
Co-authored-by: Marcus Bointon <marcus@synchromedia.co.uk>
2021-06-22 18:59:27 +02:00
Juliette c000d1eaac
PHP 8.1: fix deprecation warning in PHPMailer::addCustomHeader() (#2370)
On PHP 8.1, passing `null` to `trim()` generates a `trim(): Passing null to parameter #1 ($string) of type string is deprecated` notice.

As the `$value` is optional and may not even get set via the `name:value` parsing, the code as was, was causing this notice to be thrown.

This fix is covered by the existing unit tests and was exposed when running the tests on PHP 8.1 with `error_reporting` set to `E_ALL`.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-22 18:52:43 +02:00
Juliette b2df807028
Composer: use a version of PHPCS compatible with PHP 8 (#2364)
While working on 2363, I noticed that the code sniffer run was using PHP 8.0, but Composer still allowed for a PHP_CodeSniffer version to be installed which is not fully compatible with PHP 8.0.

Note: there are still two known incompatibilities with PHP 8.0 in PHPCS 3.6.0, but everything else has been fixed.

Ref: https://github.com/squizlabs/php_codesniffer/releases

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-22 18:52:00 +02:00
Juliette 02eadcc95f
GH Actions: start testing against PHP 8.1 (#2363)
* GH Actions: start testing against PHP 8.1

The first alpha of PHP 8.1 has been released, so now seems like a good time to start running the tests against PHP 8.1.

For now, I've configured it to allow builds against PHP 8.1 to fail, while PHP 8.1 is still unstable.

Also: PHPUnit doesn't officially support PHP 8.1 yet, so to install PHPUnit 9.x on PHP 8.1, we need to use `--ignore-platform-reqs`, as otherwise PHPUnit 4.8 would be installed (last PHPUnit version without strict PHP version constraints).

* GH Actions: set error reporting to E_ALL

Turns out the default setting for `error_reporting` used by the SetupPHP action is `error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT` and `display_errors` is set to `Off`.

For the purposes of CI, I'd recommend running with `E_ALL` and `display_errors=On` to ensure **all** PHP notices are shown.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-22 18:51:01 +02:00
Marcus Bointon a5b5c43e50
Changelog 2021-06-16 16:33:43 +02:00
Marcus Bointon e121da364f
Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2021-06-16 16:31:07 +02:00
Marcus Bointon 74e512aa75
Security update 2021-06-16 16:29:16 +02:00
Marcus Bointon acd264bf17
Merge branch 'CVE-2021-34551'
# Conflicts:
#	SECURITY.md
#	changelog.md
2021-06-16 16:02:29 +02:00
Marcus Bointon 0063f83e8c
Changelog 2021-06-15 20:12:22 +02:00
Marcus Bointon 707205f255
Changelog 2021-06-15 20:04:30 +02:00
Marcus Bointon 1047838e84
Changelog 2021-06-15 20:03:50 +02:00
Marcus Bointon c2f191be6b
Changelog 2021-06-15 19:53:27 +02:00
Marcus Bointon 45f3c18dc6
Deny string-based callables altogether 2021-06-15 17:37:24 +02:00
Marcus Bointon 6334bab2af
CVE docs 2021-06-15 14:54:52 +02:00
Marcus Bointon de90099080
Add tests for injected validators 2021-06-15 14:54:40 +02:00
Marcus Bointon ce14f76dc6
More effective check 2021-06-15 14:49:48 +02:00
Marcus Bointon c40964df54
Filter callables with deny-list of built-in names 2021-06-15 11:02:33 +02:00
Marcus Bointon c718164ad3
WIP 2021-06-15 10:41:56 +02:00
Marcus Bointon 8107a91852
WIP 2021-06-10 22:31:30 +02:00
Léon Melis 453159e95b
Add detection support for Haraka transaction ID (#2347)
A typical SMTP transaction ID for Haraka looks like this:

```
250 Message Queued (14490C56-76FB-4932-A59B-A8299DB2B693.1)
```

This regex will detect and extract this transaction ID
2021-05-28 17:22:01 +02:00
Marcus Bointon 4839207650
Clarify comment 2021-05-10 23:22:22 +02:00
Marcus Bointon 9256f12d8f
6.4.1 2021-04-29 14:25:04 +02:00
Marcus Bointon fd7ec67a7c
Add more tests for bad paths 2021-04-29 10:53:19 +02:00
Marcus Bointon 26f2848d3b
Reorder path checks, fixes CVE-2020-36326 2021-04-29 10:52:38 +02:00
Marcus Bointon bc51d1f607
Add not-strictly-necessary backslash to avoid ambiguity 2021-04-29 10:51:05 +02:00
Marcus Bointon 7f267fb4aa
Match all RFC3986 scheme patterns 2021-04-29 10:50:09 +02:00
Marcus Bointon b1038ee356
Add composer scripts for syntax check and tests 2021-04-29 10:49:27 +02:00
taras-budzyn 0acc57db14
make text compliance with Ukrainian orthography (#2317) 2021-04-22 20:08:21 +02:00
wispas c3a51b1e93
Create phpmailer.lang-mgl.php
Translated to Mongolian language
2021-04-10 00:24:23 +08:00
Marcus Bointon 08cf13b39e
Make use of $to in doCallback consistent, see #2305 2021-04-08 12:11:57 +02:00
Marcus Bointon be427db8e5
Make use of $to in doCallback consistent 2021-04-08 11:30:41 +02:00
Marcus Bointon 050d430203
6.4.0 2021-03-31 22:06:42 +02:00
Robert L Mathews 95438b776d
Revert change that made the `mail()` and sendmail transports set the envelope sender if one isn't explicitly provided, as it causes problems described at <https://github.com/PHPMailer/PHPMailer/issues/2298> (#2300)
Co-authored-by: Robert L Mathews <rob@tigertech.net>
2021-03-31 21:48:35 +02:00
Marcus Bointon e8db1cd5da
Tidelift enterprise 2021-03-22 18:15:45 +01:00
Marcus Bointon 3843c6b401
Tidelift funding 2021-03-22 17:59:04 +01:00
Marcus Bointon a792de883b
Tidelift security 2021-03-22 17:55:59 +01:00
Marcus Bointon 59173eb2bf
Speed 2021-03-20 01:00:04 +01:00
Marcus Bointon 5f93907aa5
CS 2021-03-20 00:59:13 +01:00
Marcus Bointon 4c2197250d
Changelog 2021-03-19 22:25:48 +01:00
Marcus Bointon a9a634274e
Change locale filename as Serbian Latin is apparently `sr_latn` as per https://unicode-org.github.io/cldr-staging/charts/37/summary/sr_Latn.html 2021-03-19 22:25:39 +01:00
Marcus Bointon 48a91d2723
Drop unstable badge 2021-03-19 22:18:21 +01:00
Marcus Bointon f037388959
Comment about AUTH PLAIN format 2021-03-19 22:18:08 +01:00
Marcus Bointon 6b6badad3f
Check for mbstring before trying to use it in parseAddresses 2021-03-19 22:17:22 +01:00
Nemanja Jeremić c626b9e165
Add Serbian(Latin) translation (#2288) 2021-03-19 20:31:54 +01:00
Puneet Gopinath d13d6006a4
Fix links (#2285) 2021-03-17 09:38:27 +01:00
Steve 33fc96f877
correct invalid br (#2280) 2021-03-14 13:02:44 +01:00
Marcus Bointon 4a08cf4cdd
6.3.0 2021-02-19 16:28:08 +01:00
Marcus Bointon e86e4e3f2a
CS 2021-02-19 16:04:57 +01:00
Marcus Bointon 85b4c9cd2d
Remove dead code 2021-02-19 16:04:47 +01:00
Marcus Bointon 09bc306529
Handle envelope sender the same way in sendmail as in mail() 2021-02-19 16:04:33 +01:00
Marcus Bointon 79ead3b070
More debug info for sendmail & qmail 2021-02-19 16:01:19 +01:00
Marcus Bointon 2a8e3a2fc9
Improve debug output from mail() 2021-02-19 13:43:34 +01:00
Marcus Bointon 0f24617b0c
Consistent comment style 2021-02-19 13:42:01 +01:00
Marcus Bointon e28e3552a5
Remove test env diagnostic 2021-02-19 09:37:25 +01:00
Marcus Bointon 0a191cc7ec
More IDN twiddling 2021-02-18 23:46:33 +01:00
Marcus Bointon 7f22287bdb
More IDN twiddling 2021-02-18 23:14:13 +01:00
Marcus Bointon f9cc642d6d
CS 2021-02-18 14:44:15 +01:00
Marcus Bointon 34e1c900be
Charset woes 2021-02-18 14:35:27 +01:00
Marcus Bointon 60126a1b90
Back to xdebug we go... 2021-02-18 13:18:58 +01:00
Marcus Bointon 9ff9932ca7
Require pcov 2021-02-18 12:39:35 +01:00
Marcus Bointon f4910c8b0d
Only use clobber on old PHP versions 2021-02-18 12:36:19 +01:00
Marcus Bointon 19b7f3175d
Test env tweaks 2021-02-18 12:23:06 +01:00
Marcus Bointon d11f2e4731
Docs links 2021-02-18 12:10:26 +01:00
Marcus Bointon 7aa80026cb
CS 2021-02-18 11:48:59 +01:00
Marcus Bointon e2eb2304fe
Decode encoded names in the address parser, see #2266 2021-02-18 11:46:07 +01:00
Marcus Bointon c2c5a3b9af
Fix 2021-02-05 10:19:51 +01:00
Marcus Bointon b1582e23d9
CS 2021-02-05 10:16:39 +01:00
Marcus Bointon 43c7ff5644
Changelog 2021-02-05 10:08:04 +01:00
Marcus Bointon f9f5b8d21e
Make envelope sender config work the same way for `mail()`` as it does for SMTP, preferring `Sender` over `sendmail_from` ini setting. 2021-02-05 09:59:54 +01:00
Marcus Bointon 2eaa82698d
Update reference 2021-02-05 09:49:19 +01:00
Marcus Bointon d8630b9e2c
Add debug output for mail and sendmail transports 2021-02-05 09:49:02 +01:00
Marcus Bointon 640e68d332
Readme 2020-12-10 10:29:01 +01:00
Marcus Bointon 2999b16180
Handle 421 during EHLO/HELO, fixes #2189 2020-12-09 22:50:54 +01:00
Marcus Bointon 81319de7f1
Scrutinizer doesn't work with PHP 8 so remove it, update badges 2020-12-09 22:23:40 +01:00
codedge e78f71aa67
Migrate from TravisCI to GitHub Actions (#2218)
* Remove TravisCI, add Github actions

* Fix missing steps

* Fix composer command

* Fix composer command 2nd :(

* Install postfix

* Postfix set up

* Fix missing sudos

* More sudos

* Fix permissions

* Sendmail path

* Debug

* Debug

* Debug

* Sendmail path

* Code coverage path

* Fix clover.xml path

* Install qmail

* Github Actions CI

* Add more PHP versions

* Add more PHP versions

* Use Ubuntu 18.04

Co-authored-by: Marcus Bointon <marcus@synchromedia.co.uk>
2020-12-09 17:54:59 +01:00
Marcus Bointon 4ddf42b5c4
Readme 2020-12-04 15:15:53 +01:00
Marcus Bointon 5050b6012f
Handle early connection errors, see #2211 2020-12-04 15:15:20 +01:00
Manish Kumar 338b5597ac
Add travis jobs on ppc64le (#2196)
* Add travis jobs on ppc64le

* Make the tests PHPUnit cross version compatible + test on PHP 8 (#2202)

* .gitignore: ignore files created during a test run

* Tests: make config cross-version compatible

PHPUnit config file:

* Add `backupGlobals="true"`.
    The default value for this setting changed in PHPUnit 6 from `true` to `false`. By explicitly setting it to `true`, the existing behaviour is maintained.
* Remove the `logIncompleteSkipped` directive which is no longer supported.
* Remove a number of directives which use the default values and for which the defaults have not changed across PHPUnit versions.
* Remove the space in the testsuite name to make it more easily usable on the command line.
* Make sure that all src files are taken into consideration when calculating code coverage.
* Add XSD schema reference.
    Note: the config as-is will now validate for PHPUnit 4.4-9.2. For PHPUnit 9.3, the code coverage terminology has changed, though the "old" configuration is still supported.
    If needs be (PHPUnit 10), the config can be updated on the fly by using `--migrate-configuration`.

Other:
* Ignore a locally overloaded PHPUnit config file using the standard `phpunit.xml` file name.

Question: why does the config file not use the standard `phpunit.xml.dist` file name ? That would allow for running the tests without command line arguments.
That file can still be overloaded locally by a `phpunit.xml` file.

* Composer: add dependency on the PHPUnit Polyfills package

* Adds a dev dependency to the `yoast/phpunit-polyfills` package.
* As that package already requires and manages the installable versions for PHPUnit, remove this as an explicit requirement from `require-dev` in favour of letting the PHPUnit Polyfills package manage the versions.
    This will update the supported PHPUnit versions from `^4.8 || ^5.7` to `^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0`.
    Note: the supported versions for PHPUnit 4.x and 5.x are very specific and restrictive as it specifically targets the versions in which the "forward compatible" alias files for the namespaced classes are available.

This new package adds the following features:
* Polyfills for various PHPUnit cross-version changes.
* Basic test case and test listener.

Refs:
* https://github.com/Yoast/PHPUnit-Polyfills/

Includes adding the PHPUnit cache file, which is automatically created in PHPUnit 8 and 9, to the `.gitignore` file.

* Tests: switch over to use the Yoast\PHPUnitPolyfills\TestCases\TestCase

This switches the parent class of the test classes over `TestCase` from the PHPUnit native TestCase to the `Yoast\PHPUnitPolyfills\TestCases\TestCase`.

The Yoast `TestCase`:
* Provides cross-version compatibility using snake case fixture method names instead of the PHPUnit native camelCase names.

This switch over includes:
* Renaming the `setUp()` and `tearDown()` methods to, respectively, `set_up()` and `tear_down()` in various test classes for PHPUnit cross-version compatibility.

* Tests: switch over to use the Yoast Polyfill TestListenerDefaultImplementation

This switches `DebugLogTestListener` class over to using the PHPUnit 9 default implementation pattern in combination with using the `TestListenerDefaultImplementation` from the PHPUnit Polyfill library for the cross-version compatibility layer for the TestListener.

The Yoast `TestListenerDefaultImplementation`:
* Provides cross-version compatibility using snake case method names instead of the PHPUnit native camelCase names.

This switch over includes:
* Renaming the template methods used in the `DebugLogTestListener` to use their snake_case variant and removes the type declarations.

* Tests: switch out `assertInternalType()`

... in favour of the more specific assertion(s) as introduced in PHPUnit 7.5.0.

The new assertions are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `assert[Not]Contains()` with string haystacks

... in favour of the string specific `assertString[Not]ContainsString() assertion(s) as introduced in PHPUnit 7.5.0.

The new assertions are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `@expectException` annotations

... in favour of method calls to the `TestCase::expectException()` method as introduced in PHPUnit 5.2.0.

The new method and its variants are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `assertRegExp()`

... in favour of the renamed `Assert::assertMatchesRegularExpression() as introduced in PHPUnit 9.1.0.

The new assertion is automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: mark a test as incomplete

As per the comment in the docblock:
> Needs a connection to a server that supports this auth mechanism, so commented out by default.

As the test cannot currently be executed succesfully, we may as well skip it with a meaningful message.

* Tests: mark a test as not performing assertions

... to prevent it from being marked as risky.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>

* CS

* 6.2.0

* Use fully-qualified constant names for PHP versions (#2203)

This is a micro performance improvement. When PHP opcode generates opcodes, it can remove PHP version-specific `if` blocks if it sees `PHP_MAJOR_VERSION` or `PHP_VERSION_ID`. However, if the code belongs to a namespace, it cannot make that optimization because the code under namespace can declare the same constants.
This PR updates such PHP constants to be fully-qualified (with back-slash), which enables PHP to make the improvement.

To compare, this is the VLD opcode without fully-qualified constant names:

```php
namespace X;

if (\PHP_VERSION_ID < 80000) {
    echo "hi";
}
```

-->

```
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E >   FETCH_CONSTANT                                   ~0      'X%5CPHP_MAJOR_VERSION'
         1        IS_SMALLER_OR_EQUAL                              ~1      ~0, 8
         2      > JMPZ                                                     ~1, ->4
   6     3    >   ECHO                                                     'hi'
   7     4    > > RETURN                                                   1
```

The same snippet, with the fully-qualified constants, PHP can simply eliminate and optimize the `if` block:

```
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E > > JMPZ                                                     <true>, ->2
   6     1    >   ECHO                                                     'hi'
   7     2    > > RETURN                                                   1
```

* Update Slovak translations (#2204)

* Update phpmailer.lang-sk.php

* Update phpmailer.lang-sk.php

* Update phpmailer.lang-cs.php (#2205)

Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
Co-authored-by: Marcus Bointon <marcus@synchromedia.co.uk>
Co-authored-by: Ayesh Karunaratne <Ayesh@users.noreply.github.com>
Co-authored-by: Róbert Kelčák <RobiNN1@users.noreply.github.com>
2020-11-27 00:55:57 +01:00
Róbert Kelčák 28e43da7af
Update phpmailer.lang-cs.php (#2205) 2020-11-26 23:45:56 +01:00
Róbert Kelčák 4933794b1f
Update Slovak translations (#2204)
* Update phpmailer.lang-sk.php

* Update phpmailer.lang-sk.php
2020-11-26 23:45:19 +01:00
Ayesh Karunaratne fa9c13cefd
Use fully-qualified constant names for PHP versions (#2203)
This is a micro performance improvement. When PHP opcode generates opcodes, it can remove PHP version-specific `if` blocks if it sees `PHP_MAJOR_VERSION` or `PHP_VERSION_ID`. However, if the code belongs to a namespace, it cannot make that optimization because the code under namespace can declare the same constants.
This PR updates such PHP constants to be fully-qualified (with back-slash), which enables PHP to make the improvement.

To compare, this is the VLD opcode without fully-qualified constant names:

```php
namespace X;

if (\PHP_VERSION_ID < 80000) {
    echo "hi";
}
```

-->

```
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E >   FETCH_CONSTANT                                   ~0      'X%5CPHP_MAJOR_VERSION'
         1        IS_SMALLER_OR_EQUAL                              ~1      ~0, 8
         2      > JMPZ                                                     ~1, ->4
   6     3    >   ECHO                                                     'hi'
   7     4    > > RETURN                                                   1
```

The same snippet, with the fully-qualified constants, PHP can simply eliminate and optimize the `if` block:

```
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E > > JMPZ                                                     <true>, ->2
   6     1    >   ECHO                                                     'hi'
   7     2    > > RETURN                                                   1
```
2020-11-25 19:27:52 +01:00
Marcus Bointon e38888a75c
6.2.0 2020-11-25 16:24:57 +01:00
Marcus Bointon 25ad471dea
CS 2020-11-25 15:46:22 +01:00
Juliette 78bda9997d
Make the tests PHPUnit cross version compatible + test on PHP 8 (#2202)
* .gitignore: ignore files created during a test run

* Tests: make config cross-version compatible

PHPUnit config file:

* Add `backupGlobals="true"`.
    The default value for this setting changed in PHPUnit 6 from `true` to `false`. By explicitly setting it to `true`, the existing behaviour is maintained.
* Remove the `logIncompleteSkipped` directive which is no longer supported.
* Remove a number of directives which use the default values and for which the defaults have not changed across PHPUnit versions.
* Remove the space in the testsuite name to make it more easily usable on the command line.
* Make sure that all src files are taken into consideration when calculating code coverage.
* Add XSD schema reference.
    Note: the config as-is will now validate for PHPUnit 4.4-9.2. For PHPUnit 9.3, the code coverage terminology has changed, though the "old" configuration is still supported.
    If needs be (PHPUnit 10), the config can be updated on the fly by using `--migrate-configuration`.

Other:
* Ignore a locally overloaded PHPUnit config file using the standard `phpunit.xml` file name.

Question: why does the config file not use the standard `phpunit.xml.dist` file name ? That would allow for running the tests without command line arguments.
That file can still be overloaded locally by a `phpunit.xml` file.

* Composer: add dependency on the PHPUnit Polyfills package

* Adds a dev dependency to the `yoast/phpunit-polyfills` package.
* As that package already requires and manages the installable versions for PHPUnit, remove this as an explicit requirement from `require-dev` in favour of letting the PHPUnit Polyfills package manage the versions.
    This will update the supported PHPUnit versions from `^4.8 || ^5.7` to `^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0`.
    Note: the supported versions for PHPUnit 4.x and 5.x are very specific and restrictive as it specifically targets the versions in which the "forward compatible" alias files for the namespaced classes are available.

This new package adds the following features:
* Polyfills for various PHPUnit cross-version changes.
* Basic test case and test listener.

Refs:
* https://github.com/Yoast/PHPUnit-Polyfills/

Includes adding the PHPUnit cache file, which is automatically created in PHPUnit 8 and 9, to the `.gitignore` file.

* Tests: switch over to use the Yoast\PHPUnitPolyfills\TestCases\TestCase

This switches the parent class of the test classes over `TestCase` from the PHPUnit native TestCase to the `Yoast\PHPUnitPolyfills\TestCases\TestCase`.

The Yoast `TestCase`:
* Provides cross-version compatibility using snake case fixture method names instead of the PHPUnit native camelCase names.

This switch over includes:
* Renaming the `setUp()` and `tearDown()` methods to, respectively, `set_up()` and `tear_down()` in various test classes for PHPUnit cross-version compatibility.

* Tests: switch over to use the Yoast Polyfill TestListenerDefaultImplementation

This switches `DebugLogTestListener` class over to using the PHPUnit 9 default implementation pattern in combination with using the `TestListenerDefaultImplementation` from the PHPUnit Polyfill library for the cross-version compatibility layer for the TestListener.

The Yoast `TestListenerDefaultImplementation`:
* Provides cross-version compatibility using snake case method names instead of the PHPUnit native camelCase names.

This switch over includes:
* Renaming the template methods used in the `DebugLogTestListener` to use their snake_case variant and removes the type declarations.

* Tests: switch out `assertInternalType()`

... in favour of the more specific assertion(s) as introduced in PHPUnit 7.5.0.

The new assertions are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `assert[Not]Contains()` with string haystacks

... in favour of the string specific `assertString[Not]ContainsString() assertion(s) as introduced in PHPUnit 7.5.0.

The new assertions are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `@expectException` annotations

... in favour of method calls to the `TestCase::expectException()` method as introduced in PHPUnit 5.2.0.

The new method and its variants are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `assertRegExp()`

... in favour of the renamed `Assert::assertMatchesRegularExpression() as introduced in PHPUnit 9.1.0.

The new assertion is automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: mark a test as incomplete

As per the comment in the docblock:
> Needs a connection to a server that supports this auth mechanism, so commented out by default.

As the test cannot currently be executed succesfully, we may as well skip it with a meaningful message.

* Tests: mark a test as not performing assertions

... to prevent it from being marked as risky.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2020-11-25 15:35:50 +01:00
Jérémy VIGNELLES a2e5e89925
Removed missing example link (#2190)
The code_generator.phps example seems to have been removed. Remove the associated link in the README
2020-11-07 15:57:24 +01:00
Marcus Bointon 4e9e676c26
Changelog 2020-11-06 23:33:00 +01:00
Yaacov Akiba Slama 5c559ad43d
Always use CRLF if php version is 8.0 or newer. (#2188)
Since https://git.php.net/?p=php-src.git;a=commit;h=6983ae751cd301886c966b84367fc7aaa1273b2d
which solved the bug https://bugs.php.net/bug.php?id=47983, the headers
have to always be CRLF separated.
Without this fix, a space is prepended to the header names.
2020-11-06 12:11:34 +01:00
Marcus Bointon 3dffb3e4ee
Load classes earlier 2020-10-29 15:33:52 +01:00
Marcus Bointon 9a85f499b2
Simplify security section in readme 2020-10-28 21:20:37 +01:00
Marcus Bointon f6321480c5
Retain uploaded extension in the attachment examples so that the MIME type is more easily obtained 2020-10-28 19:06:04 +01:00
Juliette 600bcde8a8
Travis: simplify and improve setup and run tests on php 5.5 (#2183)
* Travis: reorder the config

No functional changes.

* Travis: remove redundant env variable

The "CS check" is being run in its own stage with its own script, so there is no need for this environment variable anymore.

* Travis: disable Xdebug before running Composer

Composer can be slower when Xdebug is enabled, so when Xdebug isn't needed, let's disable it _before_ running Composer.

* Travis: remove duplicate build definitions

The default stage is the `test` stage and all builds defined in the `php` key, possibly combined with an `env` key, will automatically be build in the `test` stage.

No need to define them twice.

The only builds to declare explicitly in `jobs` are those which need custom `env`, `dist`, `script`s etc.

So:
* Remove those builds which don't need anything "custom" from the `jobs` key.
* Remove the one build which _does_ need something "custom" from the `php` key.

* Travis: re-enable testing against PHP 5.5

PHP 5.5 is not available on the default `xenial` distro, but by explicitly telling Travis to use the `trusty` distro, we can still  run the tests against PHP 5.5.

* Travis: run code coverage in a separate stage

Code coverage builds are "expensive" builds and if any of the tests would be failing, we are wasting time and resources by running them.

So, let's move the coverage build(s) to a separate stage, which will only run once the `test` stage has passed.

As this is now a separate stage, we don't need to set an environment variable to toggle code coverage on/off anymore. We can base conditions on the Travis stage name.

Let's also run code coverage for PHP 5.5, so both high and low PHP code coverage output can be combined for the most realistic results, taking PHP version specific conditions into account.

To make this work, we do need to tell Scrutinizer to expect reports from two separate code coverage runs.

And if I'm editing that file anyway, let's remove the redundant `filter` setting for a Scrutinizer native code coverage run which is turned off anyway.

* Tests: fix test failing on PHP 5.5

... due to the use of a PHPUnit method which is not available on PHPUnit 4.x.

These kind of things will be addressed better in a future PR, but this will get the build passing for now.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2020-10-26 18:39:29 +01:00
Juliette 3cb2162859
Improve PHPCS config (#2182)
* PHPCS: rename config file

... to `phpcs.xml.dist` to allow devs to locally overload the file by using a `.phpcs.xml` or `phpcs.xml` file, to, for instance, test out some new rules.

Includes:
* Adding the local overload files to `.gitignore`.
* Adding the standard config file to `.gitattributes`.

* PHPCS: scan missing file

The `get_oauth_token.php` file in the project root seems to have been overlooked when configuring the PHPCS ruleset.

Fixed now by adding it to the file to be scanned.

Includes minor fixes to make the file comply with the configured standard.

* CS: fix two files

Two minor CS fixes.

* PHPCS: miscellaneous changes

* Don't fix the PHPCS/external standards version restraints.
* Add the PHPCS cache file to `.gitignore`.
* Removing the no longer existent `.php_cs` file from `.gitattributes`.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2020-10-26 17:25:46 +01:00
Marcus Bointon ba88479850
Remove version note for phpcs on PR template 2020-10-26 17:24:29 +01:00
Marcus Bointon cde7d82391
Wrap calls to openssl_pkey_free in version checks, fixes #2178 2020-10-22 14:25:59 +02:00
Marcus Bointon 5ba587f4ac
Changelog 2020-10-18 20:05:47 +02:00
Marcus Bointon 482bdd697a
Cleanup 2020-10-18 20:03:58 +02:00
Mikhail Fesenko 0234e7e462
[POP3.php] small refactor: add constants DEBUG* like in SMTP class (#2175)
* [POP3.php] small refactor: add constants DEBUG* like in SMTP class

* [POP3] removed 'debug' field getter/setter
2020-10-18 20:03:17 +02:00
Tom Spencer f2fcf54d3a
Fix Travis CI config (#2172)
* Fix Travis CI configuration

`matrix` is an alias of `jobs` so have merged the keys

* Set missing root config `dist` and `os`
2020-10-15 14:18:47 +02:00
Marcus Bointon ca87a78b6f
Clean up travis build stages 2020-10-13 22:37:39 +02:00
Marcus Bointon ea49a5f03a
Clean up travis build stages 2020-10-13 22:33:35 +02:00
Marcus Bointon 1f96aef41e
Clean up travis build stages 2020-10-13 22:26:57 +02:00
Marcus Bointon 7fde25ae3e
Clean up travis build stages 2020-10-13 22:19:34 +02:00
Marcus Bointon d5e6f7d2b1
Clean up travis build stages 2020-10-13 15:31:02 +02:00
Marcus Bointon e5353e3c83
Switch from PHP CS fixer to phpcs and apply PSR12 reformatting 2020-10-13 15:12:00 +02:00
Marcus Bointon 22e81749ae
Switch from PHP CS fixer to phpcs and apply PSR12 reformatting 2020-10-13 15:08:42 +02:00
Marcus Bointon 282f0fc0ce
array_key_exists is clearer here 2020-10-13 12:25:21 +02:00
Marcus Bointon 9209642ca6
Oops - refix Ukrainian language code which was right before! 2020-10-13 12:24:50 +02:00
Petro-Ivvysoft 9aa8dd3bcb
Rename phpmailer.lang-uk.php to phpmailer.lang-ua.php (#2167) 2020-10-13 12:11:39 +02:00
Laurent Clouet fcd0af2910
Add missing french translations (#2166)
Fix sl translation file

Co-authored-by: Laurent Clouet <laurent.clouet@westwing.pl>
2020-10-11 22:08:32 +02:00
Blaž Oražem 9b8e1825ff
Add missing translations for Slovenian language (#2165) 2020-10-10 15:29:36 +02:00
Marcus Bointon 917ab212fa
6.1.8 2020-10-09 16:55:58 +02:00
Marcus Bointon f9373db9a5
Fix tests 2020-10-07 14:45:06 +02:00
Marcus Bointon 46fa62268e
Fix tests 2020-10-07 14:42:17 +02:00
Marcus Bointon a0dffb8876
Changelog 2020-10-07 12:36:38 +02:00
Suhayb Alghutaymil ec81d13717
Add ajax contact form (#2160)
* Add ajax contact form

* Allow ajax contact form to work if javascript is disabled.

Co-authored-by: Suhayb Alghutaymil <s@sgh.sa>
Co-authored-by: Sohib AlGotimel <sgotimel@citc.gov.sa>
2020-10-07 12:18:31 +02:00
Andreas Erhard 201aca3ff9
Add missing translations for German (#2159) 2020-10-06 15:48:50 +02:00
Ian Mustafa 625d93570e
Improve Bahasa Indonesia translation (#2158) 2020-10-06 09:35:39 +02:00
Adriane Justine Tan 80724ec8c2
Improved Filipino language (#2152) 2020-10-02 18:25:47 +02:00
Jérémy PASTOURET a4bf66a1d1
Add MailHog in the code example as a tool for testing email sending (#2151)
* Add MailHog - Testing email sending

* Add MailHog - Testing email sending
2020-10-02 11:47:38 +02:00
criri99 86d5cb060b
(-)remove branch #85-improvement/TestImprovement (+) add branch increase_code_coverage (+) add changes from old branch (#2119)
Co-authored-by: chriri99 <au000171>
2020-09-30 22:29:24 +02:00
Marcus Bointon e2e07a355e
Proposed fix for #2069 2020-09-30 19:29:00 +02:00
Marcus Bointon 59dea8ca78
Comment 2020-09-30 19:01:22 +02:00
Marcus Bointon 35c2cfa9ea
Add destination selector to contact form example 2020-09-30 19:01:03 +02:00
Marcus Bointon e78d99fb89
Changelog 2020-09-21 10:33:15 +02:00
mscdex 7851021d3e
Reset SMTP session after error with keepalive (#2138)
Fixes: https://github.com/PHPMailer/PHPMailer/issues/2137
2020-09-21 10:24:33 +02:00
Marcus Bointon 17ab94e469
Proposed fix for #2128 2020-09-07 17:04:19 +02:00
Ayesh Karunaratne 4091addf9f
Add AVIF file extension to mime list (#2130) 2020-09-03 09:27:53 +02:00
Marcus Bointon 13e9224c1e
Update copyright year 2020-09-02 08:41:14 +02:00
Marcus Bointon e7acd3d92f
CS 2020-08-05 10:34:30 +02:00
Marcus Bointon e8a7364733
Update link 2020-08-05 10:34:03 +02:00
Marcus Bointon 82f1d17511
Changelog 2020-08-04 09:47:23 +02:00
Marcus Bointon ecdf374c74
Allow local override of SMTP auth settings in tests; allows easy use of HELO (which requires a username) for local testing 2020-08-04 09:46:12 +02:00
Marcus Bointon efb0c4dcb8
Typo 2020-08-04 09:20:40 +02:00
Marcus Bointon 4bf91e98b3
Changelog 2020-08-04 09:20:09 +02:00
Marcus Bointon 4af0120eda
Note that the hash extension is required (and always has been!) or file attachments won't work 2020-08-04 09:03:04 +02:00
Marcus Bointon db03bb6c1a
Escape output on file upload messages 2020-08-04 08:51:55 +02:00
Marcus Bointon 79b5d815d6
Better error checking & reporting on file uploads 2020-08-04 08:51:48 +02:00
Marcus Bointon 90871378de
Don't set a time limit if set_time_limit is disabled, fixes #2088 2020-07-20 11:31:22 +02:00
Marcus Bointon 9ce50675c8
Add HELO link 2020-07-15 20:31:23 +02:00
elizabeth m 806531145a
Remove old links from SMTP test server suggestions (#2085)
FakeSMTP's repo is read-only and hasn't been updated since 2016, so I removed it. The link to FakeEmail's repo was pointing at a fork that also hasn't been updated since 2016, so i changed the link to one that has more activity. Also smtp4dev has been moved to Github and works on Linux, so I updated its entry to reflect that.
2020-07-15 20:27:29 +02:00
Marcus Bointon 2c2370ba3d
6.1.7 2020-07-14 20:50:27 +02:00
Marcus Bointon 8b4ee589bd
CS, minor tweaks from EA plugin 2020-07-14 20:15:45 +02:00
Marcus Bointon b07638a562
Fix assertions: they should be static calls 2020-07-14 20:15:45 +02:00
Marcus Bointon 5bb37af70d
CS 2020-07-14 20:15:45 +02:00
Marcus Bointon e12407cbe9
Undo BC break introduced in 6.1.2 2020-07-14 20:15:44 +02:00
Marcus Bointon 716f6d6a00
CS 2020-07-14 20:15:44 +02:00
Steen Schütt 37a5e0cd11
Write server banner to SMTP::$last_reply (#2083) 2020-07-13 11:36:10 +02:00
Bart Butler 8d50b49c2d
Retry stream_select if interrupted by signal (#2074)
Co-authored-by: Bart Butler <bartbutler@protonmail.com>
2020-06-29 21:50:04 +02:00
John Blackbourn 21a6071ac3
Correct a malformed `@return` tag. (#2072) 2020-06-20 12:39:58 +02:00
Marcus Bointon b3650f9f72
Fix null connection issue introduced in #2060 2020-06-11 17:12:50 +02:00
Marcus Bointon b52fd6e8ad
Add deprecated tag for SingleTo - deprecation happened in 6.0.0 2020-06-11 16:43:42 +02:00
Fabien Salathe 95a54cc986
Split SMTP::connect in 2 functions to have more flexibility (#2060) 2020-06-10 16:23:39 +02:00
Anton 2cf7123cb1
Update phpmailer.lang-sv.php (#2064)
* Korrigerat särskrivning
2020-06-09 09:31:05 +02:00
Marcus Bointon c2796cb1cb
Merge pull request from GHSA-f7hx-fqxw-rvvj
* Initial fixes, tests, and bump to 6.1.6

* Add CVE number
2020-05-27 14:24:03 +02:00
Marcus Bointon a7f1b23aae
Add funding info 2020-05-06 16:42:46 +02:00
Pierre Grimaud 5b63b3955c
Fix typos (#2037) 2020-04-26 10:31:39 +02:00
Marcus Bointon c1c38e3268
Correct Armenian language code 2020-04-17 09:25:34 +02:00
Marcus Bointon a12c95eb53
Use correct timeout property in debug output, clarify debug output, see #2018 2020-03-26 08:23:06 +01:00
Marcus Bointon a8bf068f64
6.1.5 2020-03-14 15:23:48 +01:00
Johse 2e727253d6
Rewrite and extension of translation (#1989) 2020-03-14 15:19:14 +01:00
lubosdz 55e0b34dea
Fix issue #2008 - MS Outlook corrupts formatting multipart EML files (#2009) 2020-03-09 11:21:06 +01:00
Marcus Bointon a55152fb5a
Typo fix for #2007 2020-03-05 19:24:33 +01:00
Marcus Bointon e9710eece7
Update README.md (#2004)
encouraging implicit TLS on port 465 according to RFC8314
2020-03-04 22:23:17 +01:00
Markus Staab 8666152d9f
Fix phpdoc type (#1993) 2020-02-26 20:10:35 -05:00
Marcus Bointon 26d77e0783
Changelog 2020-02-24 15:53:01 +01:00
Marcus Bointon a559852f2d
More thorough checks that attachment files are accessible, return error or throw exception if file has been deleted since adding it, fixes #1960 2020-02-24 15:49:49 +01:00
Marcus Bointon 589ec7d8f3
Access the `$smtp` instance the right way, fixes #1990 2020-02-24 15:01:57 +01:00
Marcus Bointon b8f4e4e9c2
Allow empty header values after all, rearrange tests. See #1984 2020-02-20 12:30:47 +01:00
Marcus Bointon af4c0ad322
CS 2020-02-20 12:05:01 +01:00
Marcus Bointon 416651e950
CS 2020-02-20 12:02:19 +01:00
Marcus Bointon 594fbb4182
Don't allow headers to contain breaks, fixes #1984 2020-02-20 12:01:48 +01:00
Marcus Bointon f7858d61a5
Make DKIM header list check case-insensitive, see #1975 2020-02-19 09:48:05 +01:00
Marcus Bointon 2b6fcc4036
Changelog 2020-02-17 13:51:51 +01:00
Marcus Bointon b294b44f20
DKIM tweaks (#1969)
* DKIM tweaks, see #1962, #1964, #1965

* Don't use the `l` tag in DKIM signature, fixes #1964

* CS

* CS

* Fix order of operations, see #1962

* Remove trailing line break from output of `DKIM_Add()`, see #1962
2020-02-17 12:26:58 +01:00
Marcus Bointon 6ae518109e
Ensure that even vars passed by reference are declared, fixes #1968 2020-02-17 09:26:43 +01:00
John Jago cc8da73fa2 Fix link to unit tests (#1926) 2019-12-28 11:09:55 +01:00
Marcus Bointon c5e61d0729
6.1.4 2019-12-10 12:17:38 +01:00
Marcus Bointon 30cecf76e4
Changelog 2019-12-10 12:16:20 +01:00
Patrick Kuijvenhoven 7eff728136 Feature improve host check (#1909)
* Let isValidHost() determine validness of host

- PHP way of doing so (https://github.com/php/php-src/pull/826)
- Improved and shortened regexp a bit

* Give more specific debug message in case host(entry) is invalid

* Rewrite filter_var checks

* Host [[<ipv6>]] is not valid
2019-12-10 11:48:50 +01:00
Marcus Bointon 05853dbd44
Changelog 2019-12-09 15:09:56 +01:00
Marien Fressinaud 078a5ad4d3 Add fallback to INTL_IDNA_VARIANT_2003 if needed (#1912)
INTL_IDNA_VARIANT_UTS46 exists from ICU 4.6, which has been released in
March 2011. However, some recent installations might have older ICU
versions (even with PHP 7+). In this situation `INTL_IDNA_VARIANT_UTS46`
will not exist and PHP will transform the constant into a string,
resulting in the following error:

    Warning: idn_to_ascii() expects parameter 3 to be integer, string
    given in /some/path/to/a/file.php on line XX

This commit allows to fallback to INTL_IDNA_VARIANT_2003 if it's needed
and possible. This variable is deprecated from PHP 7.2 and will be
removed in PHP 8, so we take care to test its existence as well.

References:

- https://github.com/FreshRSS/FreshRSS/pull/2680
- https://github.com/PrestaShop/PrestaShop/pull/11995
- https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003
2019-12-09 09:20:05 +01:00
Marcus Bointon ae99006c51
Avoid excessive folding unless it's really needed. 2019-12-06 11:49:16 +01:00
Marcus Bointon 3ea7a8c3e8
Enable 7.4 now it's released, shift code coverage to it 2019-12-05 10:23:17 +01:00
Marcus Bointon a25ae38e03
6.1.3 2019-11-21 10:37:46 +01:00
Marcus Bointon 2f2233b568
Changelog 2019-11-21 10:36:21 +01:00
Marcus Bointon 6244cf917f
Fix for #1683 2019-11-21 10:33:45 +01:00
Marcus Bointon c0b63f19c8
Remove stray phpdoc ref, see #1898 2019-11-20 19:58:58 +01:00
Marcus Bointon 506eff4a59
Changelog 2019-11-19 16:08:31 +01:00
Marcus Bointon dd6cf2eb51
Remove some unneeded dev dependencies, resolves conflict in #1898
Phpdocs now build using a github action
2019-11-19 16:07:01 +01:00
Marcus Bointon 4c5597c733
CS 2019-11-18 16:31:08 +01:00
Marcus Bointon 5f4fefe008
Changelog 2019-11-18 16:22:41 +01:00
Marcus Bointon 5c0af00d2c
Correct comment 2019-11-18 16:21:32 +01:00
Marcus Bointon 188cc38e2e
Use a constant to make it clear where this value comes from 2019-11-18 16:21:07 +01:00
Kirill Voronov b468ff8b4a FIX int type (#1895)
* FIX int type

* Update SMTP.php

* damn it! :)

* Update SMTP.php
2019-11-15 11:41:25 +01:00
mhdalvin 4fd3c57b2d wrong location of is_callable()'s closing parenthesis (#1890) 2019-11-14 08:50:24 +01:00
Marcus Bointon 0ae8505d26 CS 2019-11-13 21:09:28 +01:00
Marcus Bointon 526b1836c9 6.1.2 2019-11-13 20:51:46 +01:00
Marcus Bointon f39d72ba54 Changelog 2019-10-31 09:33:24 +01:00
Marcus Bointon 0d780d5091 Don't capture if attr match has hyphen prefix, see #1877 2019-10-30 22:40:36 +01:00
Marcus Bointon a7c75c6328 Make background attribute pattern match more precise, see #1877 2019-10-30 18:21:19 +01:00
Marcus Bointon 4e9a7614ce Ensure header and body are separated by 2 line breaks 2019-10-23 15:15:15 +02:00
Marcus Bointon 3d800d7e54 Revert previous incorrect change 2019-10-23 15:14:18 +02:00
Marcus Bointon ee7c65c781 Changelog 2019-10-23 14:45:48 +02:00
Marcus Bointon ae5e6fa488 Ensure there's a line break after headers, fixes #1872, #1871 2019-10-23 14:42:32 +02:00
Marcus Bointon 564f139ca6 Fix wrong var name 2019-10-20 21:24:14 +02:00
Marcus Bointon 9638812426 Changelog 2019-10-20 20:57:10 +02:00
Marcus Bointon 11e8d23927 Merge branch 'dkimrevision' 2019-10-20 20:52:30 +02:00
Marcus Bointon a038b50362 Change content-id header formatting, see #1691, #1864 2019-10-20 20:51:58 +02:00
Marcus Bointon 9282a06c8e Use shorter hashes for CID values, see #1691 2019-10-20 20:49:36 +02:00
Marcus Bointon e4123e66b4 Merge branch 'master' into dkimrevision 2019-10-20 19:37:17 +02:00
Ali Ahmad a0adbb2a7a makes slights changes to README.md (#1866) 2019-10-16 22:05:37 +02:00
Marcus Bointon 8087171624 Alter test to check UTF-8 in content-IDs, see #1691 2019-10-16 10:38:55 +02:00
Marcus Bointon 1a7387057a Only add a Content-ID header on inline attachments, see #1691 2019-10-16 10:37:19 +02:00
Marcus Bointon 3649f0697e Use HTML5 doctype and set lang attr everywhere 2019-10-16 10:09:01 +02:00
Marcus Bointon 694b911c9c
Merge remote-tracking branch 'remotes/origin/master' into dkimrevision 2019-10-14 12:18:57 +02:00
Marcus Bointon b8c44fca4e
Add test for content-id header formatting 2019-10-14 12:17:28 +02:00
Marcus Bointon 0dccabd950
Do content-id header value encoding & formatting in correct order, fixes #1864 2019-10-14 12:16:45 +02:00
Marcus Bointon 809394fee3
Don't need such long hashes for content IDs 2019-10-14 12:13:12 +02:00
Marcus Bointon 1c24788c17
Fix incorrect unfolding 2019-10-14 11:31:31 +02:00
Marcus Bointon 961e782634
Test was wrong before, even though it results in an unexpected space 2019-10-11 12:54:15 +02:00
Marcus Bointon 7320d99ee9
Fix duplicate subject, bad unfolding, excess line break, see #1860 2019-10-11 12:45:23 +02:00
Marcus Bointon 47a31a2f7f
Test fixes 2019-10-11 10:24:15 +02:00
Marcus Bointon 7153482b3c
Standards 2019-10-10 16:03:03 +02:00
Marcus Bointon aa07c8f7c7
DKIM_add rewrite, see #1860 2019-10-10 15:57:08 +02:00
Marcus Bointon f20885a9d3
Standards cleanup 2019-10-09 09:13:21 +02:00
Marcus Bointon 63344e6baa
Standards cleanup 2019-10-09 09:11:23 +02:00
Marcus Bointon 2b0a3df2a6
Standards cleanup
(cherry picked from commit 05df5e5758)
2019-10-09 08:56:44 +02:00
Marcus Bointon 05df5e5758
Standards cleanup 2019-10-09 08:54:03 +02:00
Marcus Bointon c9e4d921d4
Standards cleanup 2019-10-08 13:35:03 +02:00
Mikhail Fesenko 7480e75c70 Small refactor #hacktoberfest (#1859) 2019-10-08 07:56:10 +02:00
Marcus Bointon 8fceec772a
Remove chmod - wrong path
Also may no longer be needed with action changes.
2019-10-03 13:29:13 +02:00
freezy f2e2153a13 merge two jobs into one (#1857) 2019-10-03 13:03:58 +02:00
Marcus Bointon fb3b27b506
Try a different path 2019-10-03 13:02:02 +02:00
Marcus Bointon 4a9f7b2906
Ensure runner user can read phpdoc output 2019-10-03 12:58:33 +02:00
Marcus Bointon 3563788a86
Fix job name 2019-10-02 13:38:00 +02:00
Marcus Bointon d4daffdb55
Try to fix artifact path 2019-10-02 13:37:01 +02:00
Marcus Bointon 3651595a93
Make publishing docs depend on build succeeding 2019-10-02 13:36:05 +02:00
Marcus Bointon a56b12630b
Fix API docs link badge 2019-10-02 12:44:21 +02:00
Marcus Bointon 8be303c390
Add API docs link badge 2019-10-02 12:21:48 +02:00
Marcus Bointon 4b93ad523b
Only build docs on push to master 2019-10-02 11:20:04 +02:00
freezy c1fbe8fe50 [Fixes #1847] Building docs with GitHub Actions (#1855)
* Try building docs with GitHub Actions

* fix GH_PAT secret
2019-10-02 11:09:22 +02:00
Marcus Bointon 26bd96350b
6.1.1 2019-09-27 23:33:43 +02:00
Marcus Bointon 69892e4e06
PHPMailer 6.1.0 2019-09-27 19:42:59 +02:00
Marcus Bointon 689d243f94
CS 2019-09-27 19:15:39 +02:00
Marcus Bointon 5c7af569b4
CS 2019-09-27 19:04:00 +02:00
Marcus Bointon 268681b7e1
Update copyright 2019-09-27 18:33:36 +02:00
Marcus Bointon c0d49ac049
Consistent use of debug constants, CS 2019-09-27 18:33:36 +02:00
Marcus Bointon 698e352fe6
Readme 2019-09-27 18:33:36 +02:00
江不知 3cd175abaf Fix the problem about travis-ci. (#1848) 2019-09-27 18:14:06 +02:00
Marcus Bointon f48d768d4a
Update logo image 2019-09-26 10:57:33 +02:00
Marcus Bointon 108d6d3c9f
Changelog 2019-09-26 10:57:14 +02:00
puhr-mde de53537ba3 Cancel ICS file corrupted on Office 365 #1780 (#1842)
* Cancel ICS file corrupted on Office 365 #1780
2019-09-26 10:52:14 +02:00
Marcus Bointon 69a5403d48
Add logos 2019-09-25 14:48:26 +02:00
Marcus Bointon d51baeb98a
Remove old issue template 2019-09-25 12:42:47 +02:00
Marcus Bointon 0a5adbc40b
Comments 2019-09-25 12:40:23 +02:00
Marcus Bointon 7017d3b71e Update issue templates 2019-09-25 11:33:43 +02:00
Marcus Bointon 6106c0f29a
Changelog 2019-09-25 09:48:03 +02:00
Claas Augner 21b35dc49b Use Q-encode to wrap too long headers (#1840)
* Always Q-encode headers exceeding maximum length

Previously, headers exceeding the maximum line length without
any special characters were only folded. This lead to problems
with long filenames (#1469) and long headers in general (#1525).

Now, long headers are always Q-encoded (and still folded).

* Use ASCII as Q-encoding charset if applicable

Previously, headers were Q-encoded using the message
charset, e.g. UTF-8. This is excessive for ASCII
values, as it requires a unicode engine.

Now, we use ASCII if we only find 7-bit characters.

* Separate header encoding from encoding selection

* Use ASCII for B-encoding as well

* Refactor max line length calculation

Previously, we calculated the maximum
line length for header encoding both
for B- and Q-encoding, even though
they share the same limits.

Now, we calculate these once for both.
2019-09-25 08:58:44 +02:00
Marcus Bointon a4f6fe3879
Changelog 2019-09-24 12:39:14 +02:00
Marcus Bointon 8414097b86
Use constants more consistently 2019-09-24 12:38:51 +02:00
Marcus Bointon ed901561d5
Add encryption constants 2019-09-24 12:14:53 +02:00
Marcus Bointon 18272f02df
Changelog 2019-09-24 10:32:58 +02:00
christiandavilakoobin 3c1c6e0360 Fixed signing emails with pck7. (#1837) 2019-09-20 17:44:07 +02:00
Mohammad Hossein Mojtahedi dbaf95c781 Update the translation for Persian/Farsi (#1832)
Include the last string (`extension_missing`) in Persian translation.
2019-09-13 23:12:46 +02:00
Marcus Bointon 2d1ab8e07c
Standards 2019-09-02 19:58:06 +02:00
Marcus Bointon a0ab65d0dc
Revise DKIM header canonicalisation, see #1525 2019-09-02 19:44:12 +02:00
Marcus Bointon 7c28398ccc
More for #1801 2019-09-01 14:56:45 +02:00
Marcus Bointon bb1fe07b28
Typo. 2019-09-01 13:52:47 +02:00
Marcus Bointon bebd718f4d
Try to help #1801 2019-09-01 13:35:09 +02:00
Marcus Bointon b8e6a92d41
Drop PHP 5.5 from CI config as it's no longer supported by Travis-CI 2019-08-02 22:30:58 +02:00
Marcus Bointon 516e073dd6
Changelog 2019-07-30 18:29:02 +02:00
Marcus Bointon 12c4f0a85a
Add more error checking to mailing list example 2019-07-30 18:26:19 +02:00
Marcus Bointon e67f1e6d91
Clarify readme change 2019-07-24 16:35:42 +02:00
dturner123 db4de4eb00 Update README.md (#1790)
Add guidance specifically regarding the use of Clear* functions when re-using the instance e.g. in a mailing list.
2019-07-24 15:29:06 +01:00
Andrey Bolonin 82a578e942 add php 7.4snapshot (#1779) 2019-07-14 14:08:12 +01:00
Przemysław Dąbek 6c74e4b33f Strict check XMailer with empty string (#1764) 2019-07-02 20:51:00 +02:00
Marcus Bointon 511413a6ea Fix for #1753. This bug was introduced in 7932f2de8c, so was never in a tagged release. 2019-06-05 15:16:33 +02:00
Marcus Bointon 8ea801b479
Update changelog.md
Changelog
2019-06-05 09:32:12 +02:00
Donovan Renato Fourie 4c34786b71 Create phpmailer.lang-af.php (#1752)
* Create phpmailer.lang-af.php

Afrikaans PHPMailer language file this can be easily verified using google translate except 'connect_host' => 'SMTP-fout: kon nie aan SMTP-gasheer koppel nie.', which is better said like 'SMTP-fout: kon nie aan SMTP-verbind nie.'

* Update phpmailer.lang-af.php
2019-06-05 09:30:30 +02:00
Marcus Bointon a990e832c0
Create FUNDING.yml 2019-05-30 01:06:24 +02:00
Marcus Bointon 92da4ab334
Don't need case insensitivity, don't need to escape . in char classes 2019-05-27 21:34:34 +02:00
Marcus Bointon cb2179828a
Use locale-safe basename function everywhere, fixes #1736 2019-05-27 21:33:40 +02:00
Marcus Bointon 463ccbbf16
Standards 2019-05-27 21:26:41 +02:00
Marcus Bointon 7932f2de8c
Standards 2019-05-27 21:23:21 +02:00
Marcus Bointon e86a4274a5
More consistent use of exceptions for encoding errors
Test coverage for the same
See #1733
Coding standards
2019-05-27 17:09:48 +02:00
Aleksey Kuznetsov 1009fd6feb Update phpmailer.lang-ru.php (#1739) 2019-05-27 09:11:21 +02:00
Aleksey Kuznetsov 573b644dfd Update phpmailer.lang-uk.php (#1738) 2019-05-27 08:39:34 +02:00
Marcus Bointon abaee17daa
Add encoding validator
Add exceptions and make return values consistent when requesting an invalid encoding in any attachment method
2019-05-24 22:47:25 +02:00
Marcus Bointon b70b6eec07
Changelog 2019-05-24 10:49:48 +02:00
Marcus Bointon 2617dfabd9
Throw an exception on invalid encoding, see #1733 2019-05-24 10:48:50 +02:00
Damien Regad 75e0a5ce3f Update composer license to `LGPL-2.1-only` (#1719)
As per SPDX License List, previously used `LGPL-2.1` is deprecated[1].

[1]: https://spdx.org/licenses/LGPL-2.1.html
2019-05-05 20:14:21 +02:00
Marcus Bointon 3d71323416
Use ; to separate multiple params in MIME headers, see #1714 & #1705 2019-04-27 18:43:00 +02:00
Marcus Bointon c614717a7e
Test for double quotes in from name 2019-04-26 18:40:54 +02:00
Marcus Bointon 6b36cba90b
Adjust tests for previous commit 2019-04-26 18:38:11 +02:00
Marcus Bointon 12e13f5edd
Use spaces instead of tabs for header folding - some clients don't handle tabs properly 2019-04-26 18:31:05 +02:00
Marcus Bointon 0dc4706dc7
Standards 2019-04-25 18:25:53 +02:00
Marcus Bointon 7cfef991e5
Changelog 2019-04-25 17:32:26 +02:00
Marcus Bointon 50992bf084
Add support for [RFC2387 child element content-type hint](https://tools.ietf.org/html/rfc2387#section-3.1) in multipart/related structures 2019-04-17 10:42:28 +02:00
Km.Van fc8c727f38 Adjust the format for better readability (#1687)
Adjust the format for better readability
2019-03-18 13:07:30 -04:00
fabriciohd ba148d590e Alteração apenas para motivo de estudo rs (#1688) 2019-03-18 08:29:44 -04:00
Damien Regad 76c6b4c0a7 PHPDoc: add missing @throws tags (#1680)
addOrEnqueueAnAddress() throws a PHPMailer\Exception, but addAddress(),
addCC(), addBCC() and addReplyTo() are neither catching it nor
indicating that they are throwing it.

This causes IDE inspections to flag a warning.
2019-03-05 13:45:40 +01:00
tajrij kawakibi a55c3281a1 fixed catching detail enhanced error code (#1668) 2019-02-21 08:51:58 +01:00
Carlos Marin Ugalde 258931af90 DSN suppot added (#1554)
* DSN suppot added

* Added test for code coverage of dsn support
Added link for RFC3461 for property $dsn documentation

* Updated coding style
2019-02-15 10:08:43 +01:00
Marcus Bointon 522e4c14eb
Use current PHP for code coverage 2019-02-15 09:47:15 +01:00
Marcus Bointon 9a5e333b24
Allow nightly and hhvm failures 2019-02-15 09:45:57 +01:00
Marcus Bointon d364545e8f
Standards 2019-02-15 09:28:12 +01:00
Gratusfr 032b8162db php://temp streams instead of temp files (#1585)
* php://temp streams instead of temp files

@TODO would be nice to use php://temp streams here > done

* remove space

* Update PHPMailer.php

remove space
2019-02-15 09:22:50 +01:00
Oliver Smith 06a74eeea9 corrected 'imap_getmailboxes' comment to include third parameter (#1663) 2019-02-15 09:11:12 +01:00
Marcus Bointon 0c41a36d45
6.0.7 2019-02-01 16:04:28 +01:00
Richard Fontana cb62fd762f Add GPL Cooperation Commitment (#1644) 2019-02-01 15:59:20 +01:00
Shoko Ishigaki 7582514b36 Update the language directory path (#1639) 2019-02-01 15:38:17 +01:00
Nawawi Jamili e134a4060b Updated: malaysian translation (#1617) 2019-02-01 15:37:10 +01:00
Marcus Bointon d065cd74b6
Don't exclude composer.json from exports 2019-01-20 15:49:55 +01:00
Pascal 481715d711 Fixed typo (#1621) 2018-12-17 15:48:41 +01:00
Jim Jagielski 028aceea3d Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-11-16 08:18:48 -05:00
Marcus Bointon 8190d73eb5
Standards 2018-11-16 01:41:32 +01:00
Marcus Bointon dec25e8b6e
Standards 2018-11-16 01:35:56 +01:00
Marcus Bointon 76e08791ba
6.0.6 2018-11-15 23:37:37 +01:00
Marcus Bointon 77c26cdf18
Use debug level constants 2018-11-15 23:37:32 +01:00
Marcus Bointon 8e653bb796
Mitigations for CVE-2018-19296 2018-11-15 23:37:18 +01:00
Marcus Bointon 0ed33daab6
Merge Serbian translation changes, fix incorrect ISO639 code and mapping, see #1598 2018-11-14 16:06:01 +01:00
Jim Jagielski 3544703cc4 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-11-14 07:48:14 -05:00
Miloš Milanović cd15e050a4 Add Serbian translation (#1598) 2018-11-14 13:16:31 +01:00
Jim Jagielski 2e1a669d70 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-11-12 08:12:15 -05:00
Gabriel Caruso 04723d0a14 Remove unecessary cast (#1595) 2018-11-11 16:36:34 +01:00
Gabriel Caruso 43b774272b Use dedicated assertContains assertion (#1594) 2018-11-11 16:34:54 +01:00
Jim Jagielski cf58579543 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-11-05 08:15:17 -05:00
miyama c482b20724 Improve tests (#1575)
* [fix] fix test cas

fix test case

- testBCCAddressing

* [fix] fix test case testSmtpConnect

* [fix] improve test case about coverage

* [fix] invalid address

* [add] test case for setSMTPInstance

* [add] Add OAuth test case

* [add] createbody test case added

* [add] add case validateaddress test

* [add] attachmentExists test case

* [add] add test case getMailMIME

* [fix] remove not need line

* [fix] fix codes for github comment

* [fix] fix code style for travis.

* [fix] fix code style for travis.

* [fix] fix code style for travis.

* [fix] fix code style for travis.

* [fix] fix code style for travis.

* [fix] fix miss type.

* [fix] fix test case of testMailSend

* [fix] fix test case of testSmtpConnect

* [fix] remove not needed line.

* [fix] remove not need space.

* [fix] fix test case of sendMail

* [fix] fix test case

* [fix] fix test case smtpconnect

* [fix] fix test case of smtpconnect

* [fix] fix test case of smtpconnect

* [fix] fix test case of smtpconnect
2018-11-04 18:20:06 +01:00
Jim Jagielski cb4e2ae675 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-10-30 06:28:22 -04:00
Zdeněk Večeřa 3c90248c01 Update DKIM_sign.phps (#1521) 2018-10-30 08:40:02 +01:00
Dima Hereha f61707c9e7 Update phpmailer.lang-uk.php (#1553)
Fix translation
2018-10-30 08:37:51 +01:00
Andrey Bolonin b94193c039 add php 7.3 to travis (#1589) 2018-10-30 08:36:21 +01:00
Jim Jagielski 0fda1bff77 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-10-16 07:16:57 -04:00
Yousef Sultan bded7e325b Fix missing Arabic translations (#1577)
* Translate extension_missing in Arabic locale

Signed-off-by: Yousef Sultan <yousef.su.2000@gmail.com>

* uhh

Signed-off-by: Yousef Sultan <yousef.su.2000@gmail.com>
2018-10-16 08:54:01 +02:00
Jim Jagielski c65a8ed1ca Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-10-10 07:51:33 -04:00
Dmitriy Olshevskiy f8f90ae6bb PHPMailer.php: replace string 'utf-8' with constant CHARSET_UTF8 (#1567) 2018-10-06 21:23:04 +02:00
Jim Jagielski 90aed0bab5 Merge branch 'master' of https://github.com/jimjag/PHPMailer 2018-10-04 14:02:33 -04:00
Jim Jagielski c3e36abf34 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-10-04 14:02:32 -04:00
Jim Jagielski 0aee61ed70 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-10-03 10:13:16 -04:00
Marcus Bointon a8dce4721d
Changelog 2018-10-02 19:09:29 +02:00
Peter Orlický e56c88f80a Update Slovak translation (#1560) 2018-10-02 19:08:30 +02:00
Jim Jagielski 73ba77ef8b Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-10-01 09:42:14 -04:00
Marcus Bointon 110f577ec4
Changelog 2018-09-30 23:04:41 +02:00
Piyush Jha 0007a6159a Create phpmailer.lang-mg.php (#1555) 2018-09-30 22:29:45 +02:00
Jim Jagielski 197032d211 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-09-29 08:44:43 -04:00
Marcus Bointon 18dbc75792
Changelog 2018-09-26 19:40:58 +02:00
Marcus Bointon 9e81b00c2f
Add BC fix for renamed Tagalog language 2018-09-26 19:39:29 +02:00
Wyatt O'Day 8f558ec053 Fix warning under PHP 7.3.x+: filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated. (#1551)
FILTER_VALIDATE_URL already checks the host, thus no need to explicitly pass FILTER_FLAG_HOST_REQUIRED (hence the warning).
2018-09-26 18:46:46 +02:00
Jim Jagielski 5bb60e2af4 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-09-21 08:35:55 -04:00
Filip Š 6ba5bc519b Update Slovenian translation (#1546) 2018-09-20 15:14:35 +02:00
Jim Jagielski 9ffde9e547 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-09-12 10:03:18 -04:00
Stefano 9752980555 Update phpmailer.lang-it.php (#1543) 2018-09-11 20:32:29 +02:00
Jim Jagielski d75a1c3807 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-08-27 12:05:06 -04:00
aleskr 83faa53556 More understandable message. (#1499) 2018-08-24 17:35:38 +02:00
Marcus Bointon 21d6d61231
Revert "Avoid using deprecated ini value in PHP >= 7.2, fixes #1527"
This reverts commit 8b35fb9147.
2018-08-24 16:56:22 +02:00
Marcus Bointon 8b35fb9147
Avoid using deprecated ini value in PHP >= 7.2, fixes #1527 2018-08-24 16:46:57 +02:00
Marcus Bointon ebd510037b
Changelog 2018-08-24 16:46:57 +02:00
Jim Jagielski 6f169cf36b Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-08-03 15:33:17 -04:00
Briggs Elsperger 59495db0b1 Fixes Typo (#1514) 2018-08-02 22:46:56 +02:00
Jim Jagielski 33e6da8443 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-07-01 09:34:22 -04:00
Toto Prayogo 8324bf8816 Update phpmailer.lang-id.php (#1215)
* Update phpmailer.lang-id.php

* Consistent caps
2018-06-27 11:14:57 +02:00
Marco Muths 5c9d3c5484 Add flag for using copiedHeaderFields and config for using extra headers in DKIM signature (#1468)
* Changed in DKIM signature

- Add flag for using copiedHeaderFields
- config for using extra headers in DKIM signature

* Cleanups after Review

- Don't use masked ampersands in url
- Remove test related artifacts after run

* Complete docs
2018-06-26 17:04:38 +02:00
Marcus Bointon 46869d46b9
Add missing Hungarian translation, thanks to Fábián Gábor 2018-06-25 11:22:50 +02:00
Jim Jagielski 141e1e9c7d Merge branch 'master' of https://github.com/jimjag/PHPMailer 2018-06-20 11:15:40 -04:00
Jim Jagielski 34cb106597 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-06-20 11:15:39 -04:00
Jim Jagielski 52be836f78 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-06-16 10:23:16 -04:00
Marcus Bointon 7f7baf5436
Update ISSUE_TEMPLATE.md 2018-06-11 16:32:06 +02:00
Jim Jagielski 743cba5d07 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-05-29 08:02:57 -04:00
Adriane Justine Tan ef62353d07 New language ang updated README.md (#1464)
* Create new language file: Tagalog (Philippines)

* Rename phpmailer.lang-tg.php to phpmailer.lang-tl.php

* Update README.md

Change 47 to 48 languages
2018-05-28 18:11:23 +02:00
Jim Jagielski 7ae22574f8 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-05-18 08:33:56 -04:00
Marcus Bointon d145514f10
Add Campaign Monitor transaction ID pattern
Prefer \d to 0-9 in regexes
2018-05-17 09:37:33 +02:00
Jim Jagielski 2c86083b7b Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-04-27 09:15:59 -04:00
Maximilian Beckers bbdfa96b95 Add mail header constants, fixes #1428 (#1429)
* add mail header constants, fixes #1428
2018-04-27 10:25:28 +02:00
Jim Jagielski 262705fd90 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-04-04 08:18:24 -04:00
Victualia // Loquere ce9b49b825 Added extension_missing (#1403) 2018-04-04 03:35:59 -04:00
Jim Jagielski 81572b12d0 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-03-27 11:48:51 -04:00
Marcus Bointon cb3ea134d4
6.0.5 2018-03-27 15:49:45 +02:00
Jim Jagielski 4e32baff78 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-03-27 08:57:15 -04:00
Marcus Bointon 3050a4ae75
6.0.4 2018-03-27 11:55:57 +02:00
Marcus Bointon 54ab7a754d
Changelog 2018-03-27 11:54:12 +02:00
Marcus Bointon ddb8eebf1e
Clarify auth method debug output 2018-03-27 11:51:56 +02:00
notian 58fa10db27 Updated default language path (#1390)
* Updated default language path

* Calculated path instead of building string version

* Removed whitespace in function call
2018-03-26 13:03:10 -04:00
Jim Jagielski eded594d18 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-03-21 12:39:03 -04:00
Marcus Bointon 4fd6207768
Fix for #1361 2018-03-21 14:39:59 +01:00
Jim Jagielski 6da6d40a80 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-03-19 08:13:00 -04:00
Niklas d7a4babcfd Readme composer (#1378)
* Link to Composer's site and capitalise the Composer name

* Removes odd line break
2018-03-16 07:26:12 -04:00
Jim Jagielski 9f1fac5a9c Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-01-16 07:45:46 -05:00
Marcus Bointon 63e2c71ea1
Changelog 2018-01-15 15:04:43 +01:00
Yash Karanke 8ec3dc9876 Hindi translations for php mailer (#1331)
* Hindi translations for php mailer

I directly uploaded to GitHub, because my fork is a legacy version now and I am having merge conflicts now

* updated hindi language

updated last missing translation and removed comment
2018-01-15 15:01:54 +01:00
Marcus Bointon 2834867b0f
Minor output cleanup, implements same as #1290 2018-01-15 14:26:53 +01:00
Jim Jagielski dbd67bfd7c Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-01-15 07:54:22 -05:00
dknacht 2a1dc5ce2e Update README.md (#1292)
* Update README.md

Added links to the recommended optional libraries.
Changed order of "Upgrading from 5.2" and "Legacy versions", i think this way is more logical to read.
Updated language quantity in the "Localization" section.

* Update README.md

Corrected review

* Update README.md

* Update phpmailer.lang-es.php

Added missing point to make grammatically correct and consistent with the other translations.
2018-01-15 11:42:49 +01:00
Jim Jagielski 784d5e23f8 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-01-11 09:21:20 -05:00
Marcus Bointon da9fede584
Changelog 2018-01-11 00:29:45 +01:00
Marcus Bointon 978d97e370
Add some modern MIME types 2018-01-11 00:24:40 +01:00
Jim Jagielski dea95a4e60 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2018-01-05 10:22:29 -05:00
Marcus Bointon 44d49bab5a
6.0.3 2018-01-05 14:19:58 +01:00
Gaith f06d08f6a6 fix code redundancy. (#1317) 2018-01-05 10:37:19 +01:00
Jim Jagielski 7168b0a361 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-12-22 11:03:38 -05:00
Michael Orlitzky c8613a447b composer.json: add dependency on the PHP "filter" extension. (#1301)
Many of the PHP extensions used by PHPMailer are optional, in one of
two senses. Either there is a fallback if the extension is not
present, or the use of the extension is avoidable entirely. For
example, there is a fallback parser if "imap_rfc822_parse_adrlist" is
not available, and OpenSSL is not needed unless encryption is used;
therefore neither are hard dependencies.

The filter extension, on the other hand, is unavoidable. It is used
unconditionally, with no fallbacks, in (for example) the "isValidHost"
function. This commit adds "ext-filter" to composer.json, to document
the dependency and to help out composer users.

Closes: https://github.com/PHPMailer/PHPMailer/issues/1298
2017-12-22 11:40:15 +01:00
Jim Jagielski 4f62497920 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-12-12 13:50:56 -05:00
Marcus Bointon 9d9021ebc3
Changelog 2017-12-12 13:58:39 +01:00
Marcus Bointon ce68ba5f44
Correct canonicalization of header & body for DKIM, fixes #1285 2017-12-12 13:56:21 +01:00
Jim Jagielski 508e3ffa15 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-12-01 09:48:39 -05:00
François B b0c7223f65 Keep lines sorted: easier to read and maintain (#1262) 2017-12-01 11:02:33 +01:00
Marcus Bointon 7a4459cff6
6.0.2 2017-11-30 18:20:24 +01:00
Jim Jagielski 68f7d5570d Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-11-30 11:54:28 -05:00
dknacht 2b82166547 Update phpmailer.lang-eo.php (#1259)
Adding the missing translation.
Due to the flexibility of Esperanto, there is actually many ways of saying "Extension missing". I selected this one, even tho it's not the literal translation (what would rather be more like "Manki etendo" as the "missing" is used as an adjective, not as a verb), because I think this way is much more understandable.
2017-11-30 09:44:03 +01:00
Jim Jagielski 42f6b65c55 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-11-17 12:30:44 -05:00
Marcus Bointon dd2b4bc5fb
Code style 2017-11-17 12:24:17 +01:00
Marcus Bointon 8a0914cfc2
Changelog 2017-11-17 12:00:51 +01:00
Marcus Bointon 57f5d8e6cc
Hide SMTP credentials in all but lowest level debug output, fixes #1223 2017-11-17 12:00:42 +01:00
Marcus Bointon f88dc863f6
Add donations pointers, fixes #1246 2017-11-17 11:19:04 +01:00
Elan Ruusamäe 10999bcb22 update git export ignore with new files (#1240) 2017-11-17 01:14:02 +01:00
Elan Ruusamäe 0d5cb18b8d general code style fixes (#1241)
* use instanceof instead of is_a

is_a is deprecated since 5.0.0 in favour of instanceof operator
http://php.net/is_a

this allows using class aliases instead of strings

* do not assign null to class properties

that is default behaviour of php engine

* use stripos instead of stristr

* use faster $array[]= $value instead of array_push

* add SuspiciousAssignmentsInspection noinspection to shut up ide

* use call_user_func with defined args

* avoid overwriting $error parameter

* apply more yoda-style
2017-11-17 01:10:25 +01:00
Jim Jagielski 51c2ec5e49 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-11-15 16:42:49 -05:00
Marcus Bointon 2f874e6b43
Update license file, fixes #1243 2017-11-15 19:39:22 +01:00
Marcus Bointon 788e4cc80a
Update upgrading doc, see #1242 2017-11-15 11:04:18 +01:00
Marcus Bointon 97c1a0e0ec
Clarify params 2017-11-13 09:41:28 +01:00
Jim Jagielski 241497f141 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-11-06 07:01:31 -05:00
Marcus Bointon 95a68b6ca7
Remove duplicate require in SMTP example 2017-11-06 12:53:20 +01:00
Jim Jagielski e03ba97962 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-10-30 18:54:06 -04:00
François B a73d52dbc8 Improve error message for invalid address (#1213)
Adds the address kind (From, Sender, ConfirmReadingTo) instead of word punyEncode which is internal to PHPMailer and not so helpful.
Similarly, removes word addAnAddress (internal) but keeps only address kind (to, cc, bcc, Reply-To).
2017-10-27 22:06:24 +02:00
Jim Jagielski 03734f9ae3 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-10-19 09:06:52 -04:00
Marcus Bointon 5af110e3e1
Changelog 2017-10-19 09:20:19 +02:00
Januri D. P 8858381db4 Improved Indonesian localization (#1205)
* Improved Indonesian localization

* uncomment extension_missing and translate it
2017-10-19 09:16:19 +02:00
Jim Jagielski 565e65a5d6 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-10-16 08:11:09 -04:00
Marcus Bointon 8b935b2d24
Changelog 2017-10-14 08:25:44 +02:00
François B 10341cc310 Make idnSupported() static (#1203)
Upgrade guide and changelog say that idnSupported() is now static, but it actually isn't.

Probably this PR should wait v6.1 or other version where breaking changes are OK.
2017-10-14 08:22:54 +02:00
Jim Jagielski 19fd4af8a0 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-10-10 09:58:08 -04:00
Marcus Bointon 916d68cf17
Tweak PR template to be less potentially destructive 2017-10-10 09:10:40 +02:00
Marcus Bointon c13513418d
Bah, undo that as it's not supported in the old version of fixer we have to run 2017-10-09 23:12:37 +02:00
Marcus Bointon fadf99b65f
Disable yoda enforcement until it allows hybrid config 2017-10-09 23:07:04 +02:00
Marcus Bointon 9345cd5e38
Add missing regex delimiters 2017-10-09 16:03:51 +02:00
Jim Jagielski 00387eeaaf Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-10-09 09:53:11 -04:00
Marcus Bointon c944cc830e
Match SendGrid transaction IDs, trim all IDs, fixes #1193 2017-10-09 15:39:17 +02:00
Jim Jagielski 98b4ee6676 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-10-06 15:42:10 -04:00
Marcus Bointon 0605a0e96e
Changelog 2017-10-05 15:44:36 +02:00
Jim Jagielski 6c6651d0a1 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-09-30 14:20:59 -04:00
Marcus Bointon d47a148ebc
Add missing POP3 name import 2017-09-29 16:10:11 +02:00
Marcus Bointon f47cfbdd75
Switch to using max line length *without* including line break length. See #1181 2017-09-29 16:09:25 +02:00
Marcus Bointon cff938462d
Can use __DIR__ now 2017-09-29 16:07:42 +02:00
Marcus Bointon 2c06e68d22
Can use __DIR__ now 2017-09-29 16:04:52 +02:00
Jim Jagielski 9c30c65c59 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-09-18 05:48:39 -04:00
Marcus Bointon 61d18c4430
Update readme to address recent SO questions 2017-09-18 08:35:45 +02:00
Filippo Tessarotto d5ef7a2b5e Create PULL_REQUEST_TEMPLATE.md (#1165) 2017-09-15 15:38:30 +02:00
Jim Jagielski dd548ca002 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-09-15 07:41:51 -04:00
Filippo Tessarotto 54943068be Travis: fix cache dir (#1164)
* Travis: fix cache detection

* On Travis be verbose about tests
2017-09-15 11:33:27 +02:00
Marcus Bointon 727bc7151d
Correct link to test file, fixes #1163 2017-09-14 22:30:23 +02:00
Filippo Tessarotto 992392437c Tests improvements (#1162)
* Move tests to proper namespace; enforce signatures

* Travis stages, check coding-standard before tests

* Test against PHP 7.2

* CS Fix

* Remove php-cs-fixer on test builds

* Travis: remove phpdocumentor/phpdocumentor from builds

* Allow PHPUnit 5
2017-09-14 18:47:12 +02:00
Filippo Tessarotto dc54e2b93c Show debug log only when tests fail (#1161) 2017-09-14 15:56:04 +02:00
Marcus Bointon 18a34ad6ed
Whitespace 2017-09-14 15:30:44 +02:00
Marcus Bointon 1106585603
Trailing , 2017-09-14 14:58:30 +02:00
Marcus Bointon 617df94ffb
6.0.1 2017-09-14 14:50:11 +02:00
Marcus Bointon 1bc0d46017
Clean up after #1155 2017-09-14 14:49:01 +02:00
Marcus Bointon a120d9792f
Don't add content-ID if cid is not set 2017-09-14 14:43:09 +02:00
William McDonald Buck 9227c37ec5 Provide SMTP Transaction Id in Callback (#1155)
* SMTP Callback

Add an additional parameter to doCallback, to allow providing additional
data to caller. 
Use this feature in the case of smtp send to return the
smtp_transaction_id in the callback.

* Add a case in smtp_transaction_id_patterns for Amazon SES

* textual adjustment
2017-09-14 14:42:57 +02:00
Anderson Luiz Silvério 9b6fe596cd Add Content-ID for all disposition types (#1151) 2017-09-14 13:08:50 +02:00
Filippo Tessarotto 9e05e796d0 Enforce PSR-4 (#1159) 2017-09-14 12:55:50 +02:00
Filippo Tessarotto 8550acd0e4 Add PHP-CS-Fixer integration (#1148)
* Add PHP-CS-Fixer checks

* Remove composer.lock to early catch FC break on CI

* Travis: cache dependencies

* Enable code-coverage only for latest build

* Remove Symfony-specific PHP-Doc rules

* Apply coding-standards fix
2017-09-14 12:29:03 +02:00
Marcus Bointon add60c3e54
Generate shorter IDs (with more entropy) to work around iCloud RFC non-compliance, fixes #1140 2017-09-14 08:40:42 +02:00
Marcus Bointon 28a306bfbd
Reset to SMTP mailer for line break tests 2017-09-12 09:49:15 +02:00
Marcus Bointon 819f540c77
Reset to SMTP mailer for line break tests 2017-09-12 09:17:58 +02:00
Marcus Bointon 2feb461f04
Add test for sending DKIM-signed message via mail() 2017-09-12 09:00:40 +02:00
Marcus Bointon 50581754f7
Code style fixes 2017-09-12 09:00:08 +02:00
Jim Jagielski 542d32a15e Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-09-08 17:48:28 -04:00
Marcus Bointon 7201c4f7c0
Code style fixes 2017-09-08 19:31:28 +02:00
Marcus Bointon 700ea0983d
Code style fixes 2017-09-08 16:19:20 +02:00
Marcus Bointon efd7561b56
Revert composer changes to avoid PR clash 2017-09-08 16:18:50 +02:00
Jim Jagielski 09f154b95d Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-09-08 09:45:37 -04:00
Marcus Bointon 31493b6732
Big cleanup for Symfony coding style and php-cs-fixer, see #1148 2017-09-07 18:21:09 +02:00
Marcus Bointon eb9e7f5f0c
Quoting style 2017-09-07 11:25:58 +02:00
Marcus Bointon 46dec714fb
Remove trailing . from phpdoc params 2017-09-07 11:24:08 +02:00
Marcus Bointon de3db41419
Casts & PHPDoc boolean -> bool, see http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration 2017-09-07 11:17:37 +02:00
Marcus Bointon 9550898c1c
PHPDoc integer -> int 2017-09-07 11:11:17 +02:00
Marcus Bointon 0fb61f4656
is_null() -> null === 2017-09-07 10:17:38 +02:00
Jim Jagielski eb20c69485 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-09-05 07:36:46 -04:00
Marcus Bointon 3be7a195cb
Don't analyse dependency tests 2017-09-02 22:58:27 +02:00
Jim Jagielski 3481253cb7 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-08-29 10:15:54 -04:00
Marcus Bointon 22f5272074
Add phan config 2017-08-29 11:31:15 +02:00
Marcus Bointon 9d4008b2a0
Annotation fixes courtesy of phan 2017-08-29 11:29:44 +02:00
Ermin Islamagić bbacda8ccc Improved Bosnian localization (#1139)
* Added Bosnian localization

* Improved Bosnian localization
2017-08-28 19:50:57 +02:00
Marcus Bointon f4a8efadfd
Merge remote-tracking branch 'remotes/origin/5.2-stable' 2017-08-28 18:07:42 +02:00
Remi Collet 31f18d8633 Fix date (#1138) 2017-08-28 17:45:27 +02:00
Marcus Bointon ea25dc122d
Re-add issue template 2017-08-28 13:42:41 +02:00
Marcus Bointon 53d0375d0c
Case sensitivity juggle 2017-08-28 13:42:05 +02:00
Marcus Bointon 81062fa300
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	VERSION
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
2017-08-28 13:39:01 +02:00
Marcus Bointon b91bf9267e
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	VERSION
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
2017-08-28 13:36:44 +02:00
Jim Jagielski e061d4c3b3 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-08-28 06:42:25 -04:00
Marcus Bointon 7a037c1eaa
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	README.md
#	examples/gmail.phps
#	src/SMTP.php
2017-08-28 12:15:27 +02:00
Marcus Bointon 1c43605340
Remove obsolete comments, fixes #79 2017-08-28 12:09:07 +02:00
Marcus Bointon 2579038ad7
Merge remote-tracking branch 'origin/6.0' into 6.0 2017-08-24 13:54:11 +02:00
Marcus Bointon f4d37028af
Merge branch '6.0' into 6.0-ical
# Conflicts:
#	changelog.md
2017-08-24 13:51:06 +02:00
Marcus Bointon a3c4191626 Fix regex 2017-08-16 10:57:35 +02:00
Marcus Bointon a314ab7a89 Add MS ESMTP message id capture 2017-08-16 10:40:55 +02:00
Jim Jagielski 46cdb4bccb Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-08-14 07:33:09 -04:00
Jim Jagielski 6ec3ffb83e Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-08-11 09:44:16 -04:00
Marcus Bointon b296b18656
Changelog 2017-08-11 14:53:57 +02:00
Marcus Bointon c205d94136
Changelog 2017-08-11 14:52:39 +02:00
Marcus Bointon 3f80e2dc92
Fix obtaining transaction ID when keepalive is active, fixes #1123 2017-08-11 13:55:51 +02:00
Jim Jagielski 417083da0b Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-08-02 13:23:08 -04:00
Marcus Bointon 18263000c5
Support Ical in alt_attach MIME structure, see #175 2017-08-01 18:01:32 +02:00
Jim Jagielski b44c3f91be Merge branch 'master' of https://github.com/jimjag/PHPMailer 2017-07-30 10:16:19 -04:00
Jim Jagielski 44966f6148 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-07-30 10:16:18 -04:00
Marcus Bointon c6e65069ad
Prefer pre-decrement 2017-07-28 10:55:10 +02:00
Marcus Bointon a8728150fd
Don't echo & concat, use `,` 2017-07-28 10:54:10 +02:00
Marcus Bointon a4fdea1590
Combine echo & exit 2017-07-28 10:48:35 +02:00
Marcus Bointon 01264ebf31
Take function call out of loop 2017-07-28 10:46:56 +02:00
Marcus Bointon 3eb9e8b47a
Don't try to output possibly non-existent elements 2017-07-27 00:00:46 +02:00
Jim Jagielski 13e14f183c Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-07-26 17:54:37 -04:00
Marcus Bointon ca9f6c2d57
Avoid XSS in error message output 2017-07-26 23:16:08 +02:00
Marcus Bointon 1e3f4e4062
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	VERSION
#	changelog.md
#	examples/code_generator.phps
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
#	test/phpmailerTest.php
2017-07-26 23:10:42 +02:00
Marcus Bointon c899ba203f
Remove code generator example - too messy! 2017-07-26 19:54:31 +02:00
Marcus Bointon 6bf4b5a187
Consistent alternative regex delimiter 2017-07-26 11:05:43 +02:00
Marcus Bointon c64609ad07
Comment cleanup 2017-07-26 11:05:10 +02:00
Marcus Bointon 84717cdd4e
Don't need this doc 2017-07-26 11:04:20 +02:00
Marcus Bointon 9e4f68b6b0 Restrict zend_i18n to PHP 5.5 compat version 2017-06-29 21:55:28 +02:00
Marcus Bointon d8880934f5 No empty parens on new 2017-06-29 21:54:47 +02:00
Marcus Bointon 589b09fce5 Remove trailing commas 2017-06-29 21:54:09 +02:00
Marcus Bointon 1f6c876d5e Avoid old aliases
Use short array syntax
2017-06-29 20:52:54 +02:00
Marcus Bointon 6d7c66df9e Return value directly 2017-06-29 20:42:22 +02:00
Marcus Bointon 97e95ab154 Avoid embedded assignment 2017-06-29 20:21:35 +02:00
Marcus Bointon 6121caf09a Remove common alternatives 2017-06-29 20:14:11 +02:00
Marcus Bointon 9ed764ecbf Prefer pre-increment 2017-06-29 19:57:38 +02:00
Marcus Bointon 618f998286 Prefer short operators 2017-06-29 19:56:19 +02:00
Marcus Bointon 48dd88a70e Remove unnecessary parens 2017-06-29 19:49:19 +02:00
Marcus Bointon 9111e36438 Avoid embedded assignment 2017-06-29 19:39:06 +02:00
Marcus Bointon 94e1d25572 Avoid embedded assignment 2017-06-29 19:36:06 +02:00
Marcus Bointon 4125778dd9 Call validate statically 2017-06-29 19:15:53 +02:00
Marcus Bointon f12f42009a
Merge remote-tracking branch 'origin/6.0' into 6.0 2017-06-23 10:29:14 +02:00
Marcus Bointon cf868cd588
Upgrade dev deps 2017-06-22 18:50:04 +02:00
Marcus Bointon 424398579d
Merge changes from master 2017-06-22 18:36:56 +02:00
Jim Jagielski d450d93cc1 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-06-21 11:41:07 -04:00
Marcus Bointon f26ca5279e Remove v5 issue_template 2017-06-14 14:53:33 +02:00
Marcus Bointon b60c8df85e Merge remote-tracking branch 'remotes/upstream/master' into 6.0 2017-06-14 14:49:06 +02:00
Marcus Bointon 7ee66b9b39 Move issue_template to .github folder 2017-06-14 14:48:50 +02:00
Marcus Bointon 45fee1c2b4 Tweak issue_template 2017-06-14 14:46:09 +02:00
Jim Jagielski d3643892cd Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-06-13 12:04:47 -04:00
Jim Jagielski 3e796acee4 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-05-31 18:04:35 -04:00
Marcus Bointon b3febb7df4
typo 2017-05-29 16:25:41 +02:00
Marcus Bointon 9e548ffaf7
Merge remote-tracking branch 'remotes/origin/master' into 6.0 2017-05-29 14:07:35 +02:00
Marcus Bointon cd2f977899
Allow injecting an SMTP instance 2017-05-29 14:07:11 +02:00
Marcus Bointon 262dc4997a
Merge remote-tracking branch 'remotes/origin/master' into 6.0 2017-05-26 12:09:15 +02:00
Marcus Bointon b25f93eb2d
More reliable folding of message headers 2017-05-22 18:53:00 +02:00
Marcus Bointon d95ef498e2
Trim subject consistently 2017-05-22 10:13:28 +02:00
Marcus Bointon eb96b30775
Speak Yoda 2017-05-22 10:08:37 +02:00
Marcus Bointon 799a156ea7
Speak Yoda 2017-05-22 09:48:23 +02:00
Marcus Bointon 7c6ce49757
Remove duplicate mbstring check 2017-05-22 09:38:56 +02:00
Marcus Bointon cee3af5c29
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	changelog.md
2017-05-20 23:45:01 +02:00
Marcus Bointon e194b97409
Changelog 2017-05-15 10:01:49 +02:00
Marcus Bointon 82cbbc2ab2
Merge remote-tracking branch 'remotes/origin/master' into 6.0 2017-05-15 10:00:12 +02:00
Marcus Bointon 192c84a87e
Better detection & reporting of bad SMTP host strings 2017-05-15 09:35:15 +02:00
Marcus Bointon 57c9951a47
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	.travis.yml
2017-05-14 22:00:06 +02:00
Marcus Bointon 1003010d93
Workaround for broken default HHVM config on Travis-CI (https://github.com/travis-ci/travis-ci/issues/7712) 2017-05-14 21:38:40 +02:00
Marcus Bointon 70e35cc9da
Rewrite host checks to be more predictable, add more test cases 2017-05-12 15:13:08 +02:00
Marcus Bointon 5175bdabe9
Allow HHVM build failures until Travis fixes it 2017-05-12 13:47:27 +02:00
Marcus Bointon 9f08355ed3
Add host validation tests
Improve host validator
2017-05-12 09:43:46 +02:00
Marcus Bointon 7481f418f2
Add hostname validation function
Improve serverHostname, mainly to combat IDEs that set $_SERVER['SERVER_NAME'] to invalid hostnames
2017-05-11 19:00:01 +02:00
Marcus Bointon 1f9a66492a
Replace all uses of MD5 and SHA1 with SHA256
Use more secure method of generating IDs
2017-05-11 18:41:34 +02:00
Marcus Bointon 5807c1fcbe
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	composer.json
#	src/PHPMailer.php
2017-05-11 16:09:52 +02:00
Marcus Bointon b6598a155f
Merge remote-tracking branch 'origin/6.0' into 6.0 2017-05-11 01:57:45 +02:00
Marcus Bointon d798b197ed
Incorporate file-reading changes from #500
Update changelog
2017-05-11 01:56:57 +02:00
Marcus Bointon 819beca5ab Name issue template correctly 2017-04-18 17:45:29 +02:00
Marcus Bointon c33a3a7824
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	examples/gmail_xoauth.phps
#	src/PHPMailer.php
2017-04-13 12:31:40 +02:00
Marcus Bointon 799ff351ca
Trap low-level SMTP errors, see #1012 2017-03-23 12:37:23 +01:00
Marcus Bointon 863e531de8
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	.travis.yml
#	VERSION
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
2017-03-16 15:35:18 +01:00
Marcus Bointon 936eaa7770
Downgrade packages for BC with PHP 5.5 tests 2017-03-15 19:49:11 +01:00
Marcus Bointon 8f58d8d494
Travis tweaks, don't update packages on test 2017-03-15 19:06:51 +01:00
Marcus Bointon f52d3759ba
Changelog 2017-03-13 12:19:56 +01:00
Marcus Bointon 290c5c1aa4
Merge remote-tracking branch 'remotes/origin/master' into 6.0 2017-03-13 12:15:26 +01:00
Jim Jagielski fcab9a98a3 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-03-06 18:17:16 -05:00
Marcus Bointon 9f99f8aec1
Merge branch 'master' into 6.0
# Conflicts:
#	src/SMTP.php
2017-03-06 19:16:11 +01:00
Jim Jagielski 30a7d46348 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-03-06 11:57:14 -05:00
Jim Jagielski c6ab11904a Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-03-02 16:14:36 -05:00
Marcus Bointon c3aba6d974
Test suite now works on HHVM on Travis-CI 2017-03-02 16:09:45 +01:00
Jim Jagielski dac80f2368 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-03-02 06:25:09 -05:00
Marcus Bointon 86af82ceb9
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	extras/htmlfilter.php
2017-03-01 17:54:21 +01:00
Marcus Bointon 9c3ba23563
Generate a warning when using a buggy PHP version, see #953 2017-02-28 11:46:22 +01:00
Marcus Bointon 24b4351a7b
Add `ics` MIME type mapping, see #175 2017-02-21 14:54:19 +01:00
Marcus Bointon bb5ca4329b
Clean up 2017-02-14 19:24:45 +01:00
Marcus Bointon 1e267b66a6
Avoid possibility of line length being too short to trigger test if LE is 1 char 2017-02-14 13:46:50 +01:00
Marcus Bointon ec5661e699
More test feedback 2017-02-14 12:14:19 +01:00
Marcus Bointon 16a060be1a
More test feedback 2017-02-14 01:32:41 +01:00
Marcus Bointon 8e8da27e3d
Fix tests 2017-02-14 00:16:25 +01:00
Marcus Bointon 02332a843f
Attempt solution to line break issue, see #953 2017-02-13 23:55:05 +01:00
Marcus Bointon d5d811570b
Update deps 2017-02-13 23:54:22 +01:00
Jim Jagielski 4b15adf6fc Merge branch 'master' of https://github.com/jimjag/PHPMailer 2017-02-06 06:53:32 -05:00
Jim Jagielski d7e2b19de2 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-02-06 06:53:31 -05:00
Jim Jagielski d170e6f1aa Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-02-02 08:29:40 -05:00
Jim Jagielski 65532b827b Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-01-26 13:03:11 -05:00
Marcus Bointon 7d42f12f1b
Improve upgrade docs, see #959 2017-01-12 19:51:55 +01:00
Jim Jagielski 9153759178 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-01-09 09:11:54 -05:00
Marcus Bointon 016cb3395c
Fix INCLUDE_DIR 2017-01-09 12:19:12 +01:00
Marcus Bointon 2963f2b294
Merge branch 'master' into 6.0
# Conflicts:
#	examples/scripts/XRegExp.js
#	extras/htmlfilter.php
2017-01-09 11:18:14 +01:00
Marcus Bointon 96c5d32386
Extend line break tests 2017-01-09 10:19:14 +01:00
Marcus Bointon 8914ec7a4b
Merge branch 'master' into 6.0
# Conflicts:
#	VERSION
#	examples/contentsutf8.html
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
#	test/bootstrap.php
2017-01-06 23:34:57 +01:00
Marcus Bointon e9705c17fa
Remove LE property - if you need to change it, override the LE constant instead 2017-01-06 22:50:12 +01:00
Jim Jagielski d3f6fbe67f Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2017-01-03 07:59:31 -05:00
Jim Jagielski bdce67344c Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-12-29 09:45:42 -05:00
Marcus Bointon 789e0846ab
Merge branch 'master' into 6.0
# Conflicts:
#	VERSION
#	extras/htmlfilter.php
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
#	test/phpmailerTest.php
2016-12-29 14:01:45 +01:00
Jim Jagielski a483f46352 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-12-28 11:01:12 -05:00
Jim Jagielski e4b690d4e1 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-12-28 09:37:31 -05:00
Jim Jagielski 08d5acfb67 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-12-28 08:35:45 -05:00
Jim Jagielski e0e5ff52d0 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-12-27 15:33:07 -05:00
Jim Jagielski 4273de78d3 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-12-26 16:47:03 -05:00
Jim Jagielski 81606215f0 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-12-25 10:17:24 -05:00
Jim Jagielski 65eafd3b95 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-12-19 09:33:13 -05:00
Jim Jagielski e7bdd92d19 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-12-09 08:13:44 -05:00
Marcus Bointon 9727777f27
Name constants consistently
Remove unnecessary POP3 properties
Merge branch 'master' into 6.0

# Conflicts:
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
2016-12-09 13:05:38 +01:00
Marcus Bointon e52f61a070
Name constants consistently
Remove unnecessary POP3 properties
Merge branch 'master' into 6.0

# Conflicts:
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
2016-12-09 13:04:56 +01:00
Marcus Bointon ca33e337a2
Merge remote-tracking branch 'origin/master' into 6.0 2016-12-09 08:55:30 +01:00
Jim Jagielski 9e3dc15331 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-11-20 08:15:58 -05:00
Marcus Bointon b9f8b688d2
Merge branch 'master' into 6.0
# Conflicts:
#	src/PHPMailer.php
2016-11-11 22:15:47 +01:00
Marcus Bointon dcf053679e
Merge branch 'master' of https://github.com/e7o-de/PHPMailer into e7o-de-master
# Conflicts:
#	language/phpmailer.lang-de.php
2016-11-10 23:11:14 +01:00
Jim Jagielski ff28b4ff1a Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-11-09 10:34:42 -05:00
Jim Jagielski 698ed1ca43 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-10-28 15:56:31 -04:00
Marcus Bointon 281170a26a
Merge remote-tracking branch 'origin/6.0' into 6.0 2016-10-26 22:11:23 +02:00
Marcus Bointon 33f658cdb3
Merge branch 'master' into 6.0 2016-10-26 22:10:54 +02:00
aduh95 6f90caae19 Add mbstring suggestions to the composer file (#795) 2016-10-26 21:57:53 +02:00
Marcus Bointon a910ebabac
Merge branch 'master' into 6.0
# Conflicts:
#	src/PHPMailer.php
2016-10-24 12:46:07 +02:00
Jim Jagielski a160567177 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-10-20 16:27:58 -04:00
Jim Jagielski e611b7c343 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-10-17 13:38:21 -04:00
Marcus Bointon dbee6c266f
Don't include examples in deployments or zip downloads 2016-10-17 19:01:34 +02:00
Marcus Bointon 83f306634d
Merge branch 'master' into 6.0 2016-10-17 19:00:36 +02:00
Marcus Bointon da1b2fc389
Document dropping examples folder in zip 2016-10-17 19:00:18 +02:00
Marcus Bointon 46f3177cf1
Note about example inclusion 2016-10-17 18:55:23 +02:00
Marcus Bointon 9875dc1faa
Merge branch 'master' into 6.0
# Conflicts:
#	class.phpmaileroauth.php
#	examples/scripts/shLegacy.js
#	extras/htmlfilter.php
#	extras/ntlm_sasl_client.php
#	src/SMTP.php
2016-10-17 18:37:28 +02:00
Marcus Bointon 90532789b6
Merge branch 'master' into 6.0
# Conflicts:
#	src/PHPMailer.php
2016-10-05 18:36:21 +02:00
Jim Jagielski a44277709d Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-10-04 14:32:51 -04:00
Jim Jagielski f9368982aa Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-10-03 13:10:43 -04:00
Marcus Bointon 24e018020b
Update deps 2016-09-30 17:50:13 +02:00
Marcus Bointon 5e7ea2a6d1
Add PSR-3 compatible debug logging 2016-09-30 17:46:39 +02:00
Jim Jagielski 454338d892 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-09-21 12:18:12 -04:00
Marcus Bointon c7650fbdff
Merge branch 'master' into 6.0 2016-09-21 17:29:37 +02:00
Jim Jagielski 2f34b99ab6 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-09-19 09:06:12 -04:00
Jim Jagielski fd9501ce66 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-09-17 10:48:35 -04:00
Marcus Bointon 0d0a62681a
Merge branch 'master' into 6.0
# Conflicts:
#	src/PHPMailer.php
2016-09-10 23:02:41 +02:00
Marcus Bointon eeb4be408a
Comments 2016-09-10 22:47:12 +02:00
Jim Jagielski cd899c7696 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-09-07 07:38:58 -04:00
Marcus Bointon 6931f31028 Simplify validation options, default to filter_var, see #804 2016-09-03 01:02:38 +02:00
Marcus Bointon 1e53c07286 Minor fixes, code style 2016-08-31 10:26:06 +02:00
Marcus Bointon abd34cb809 WS 2016-08-31 09:50:12 +02:00
Marcus Bointon b67f5491f4 Ignore all .pem files 2016-08-31 09:48:30 +02:00
Marcus Bointon 71f42aac45 Merge remote-tracking branch 'origin/6.0' into 6.0 2016-08-31 09:40:17 +02:00
Marcus Bointon 11522f877f Update docblock (#815) 2016-08-31 09:38:49 +02:00
Marcus Bointon 109826c898 Merge remote-tracking branch 'origin/6.0' into 6.0 2016-08-31 09:34:35 +02:00
Jim Jagielski 20387bb3c3 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-08-30 07:32:59 -04:00
Adeniyi Ibraheem 5faa708103 Update docblock 2016-08-30 00:21:08 +01:00
Marcus Bointon a2300734d7 Merge branch 'master' into 6.0 2016-08-29 15:23:27 +02:00
Marcus Bointon 66fd2b89ea Don't need to check for SHA256 algo in PHP 5.5 2016-08-29 15:16:46 +02:00
Marcus Bointon 0bc8fd383e Merge branch 'master' into 6.0
Don't need to check for SHA256 algo in PHP 5.5
2016-08-29 14:57:45 +02:00
Marcus Bointon eadcf14b3f PHPCBF phpdoc cleanup 2016-08-29 11:05:47 +02:00
Marcus Bointon 51e8e91c20 PHPCBF phpdoc cleanup 2016-08-29 11:04:27 +02:00
Marcus Bointon 63e0a2c1db PHPCBF phpdoc cleanup 2016-08-29 10:29:13 +02:00
Marcus Bointon 593a0c586a Remove unneeded PHPDoc tags: @static, @access, @return void, @private
@link -> @see (PSR-5)
Always use `boolean`
2016-08-29 10:21:39 +02:00
Jim Jagielski af7655c4a3 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-08-10 16:59:59 -04:00
Jim Jagielski da7dc8b99d Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-07-31 14:20:20 -04:00
Marcus Bointon dec8422c6c Merge branch 'master' into 6.0 2016-07-26 08:52:26 +02:00
Marcus Bointon ac23dd971a Update deps 2016-07-22 16:38:46 +02:00
Marcus Bointon 6c81a27688 Merge remote-tracking branch 'remotes/origin/master' into 6.0 2016-07-22 15:15:54 +02:00
Jim Jagielski 2b231cf8cf Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-07-22 07:36:16 -04:00
Marcus Bointon 909c6283e3 Merge branch 'master' into 6.0 2016-07-22 12:49:33 +02:00
Jim Jagielski a5df55de53 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-07-08 09:18:22 -04:00
Jim Jagielski e10fc204db Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-07-07 07:01:44 -04:00
Marcus Bointon d188cdc2e3 Merge branch 'master' into 6.0 2016-07-06 09:31:40 +02:00
Marcus Bointon 3a503d34aa Make idnSupported() static 2016-06-30 16:18:56 +02:00
Marcus Bointon 415873c6c8 Use less patronising default message in plain text body 2016-06-30 16:17:38 +02:00
Marcus Bointon 51be6c7ee2 Remove excess line breaks in message structure 2016-06-30 16:16:14 +02:00
Marcus Bointon 49b8d7e271 Docs cleanup 2016-06-30 16:12:51 +02:00
Marcus Bointon b8ee3d52e3 Import class names, avoid FQCNs 2016-06-30 16:11:25 +02:00
Marcus Bointon 2acd2eff9c Update examples, add contact form example 2016-06-29 18:26:55 +02:00
Marcus Bointon 11b2dd5198 Merge branch 'master' into 6.0 2016-06-29 16:01:06 +02:00
Jim Jagielski c528743279 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-06-29 07:30:45 -04:00
Marcus Bointon 7fdb51369b Update deps 2016-06-29 11:49:27 +02:00
Marcus Bointon 20314a574c Fix merge error 2016-06-06 14:35:15 +02:00
Marcus Bointon f5cea12dbd Improve DKIM examples 2016-06-06 14:33:29 +02:00
Marcus Bointon 78ef24e9f6 Merge branch 'master' into 6.0
# Conflicts:
#	.gitignore
#	VERSION
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
2016-06-06 14:23:33 +02:00
Jim Jagielski 44a71e4659 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-06-06 07:38:09 -04:00
Jim Jagielski e99618701c Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-06-03 07:42:27 -04:00
Marcus Bointon e4bc252320 Add issue template 2016-06-02 11:15:05 +02:00
Marcus Bointon b79d34e97d Add notes on sendmail `-f` option 2016-05-31 18:43:03 +02:00
Jim Jagielski 0bad16ece5 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-05-23 11:14:51 -04:00
Marcus Bointon ec4c2ee867 Standardise on CRLF line breaks
Better auth mechanism selection
2016-05-23 10:30:31 +02:00
Marcus Bointon e61b522f2d Merge branch 'master' into 6.0
# Conflicts:
#	src/PHPMailer.php
#	src/SMTP.php
2016-05-22 21:11:00 +02:00
Jim Jagielski 74db8a202a Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-05-15 09:45:38 -04:00
Marcus Bointon 352dd7622f Merge branch 'master' into 6.0
# Conflicts:
#	src/PHPMailer.php
2016-05-13 09:33:12 +02:00
Marcus Bointon 5b34f25e31 Docs tweaks 2016-05-11 00:00:21 +02:00
Marcus Bointon f2d4156b65 Merge branch 'master' into 6.0
# Conflicts:
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
2016-05-10 23:09:01 +02:00
Jim Jagielski 33fdd0bb46 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-05-09 11:54:15 -04:00
Marcus Bointon 86d2b069d8 Merge branch 'master' into 6.0
# Conflicts:
#	changelog.md
#	test/phpmailerTest.php
2016-05-09 11:34:42 +02:00
Marcus Bointon 384609cc83 Coding standards 2016-05-03 10:06:48 +02:00
Marcus Bointon c2816d47cb Add DNS entry generator, fixes #644 2016-05-03 10:06:15 +02:00
Marcus Bointon f77a91ede7 Coding standards 2016-05-03 08:58:13 +02:00
Marcus Bointon db25db78e4 Don't talk about old versions 2016-05-03 08:55:10 +02:00
Marcus Bointon 51bbe8f7a2 Use late static calls on things that should be overridable 2016-05-03 08:49:57 +02:00
Marcus Bointon f7033d68b6 Remove obsolete QP-encode function
Improve & fix data URL handling
Remove old class loader from phpunit bootstrap
Improve test coverage
Remove some unnecessary trailing line breaks from attachment MIME structure
2016-05-02 18:27:44 +02:00
Marcus Bointon a46689bed8 Make DKIM canonicalization stricter, add unit tests 2016-05-02 15:18:22 +02:00
Marcus Bointon 2f63fcd3da Defensive comparisons 2016-05-02 12:01:25 +02:00
Marcus Bointon 10d1a2ea3f Don't ignore docs folder, just its contents 2016-05-01 18:01:10 +02:00
Marcus Bointon 7a67a33181 Cleanup 2016-05-01 17:45:39 +02:00
Marcus Bointon 9b784d23b0 Simplify phpdocs generation 2016-05-01 17:30:19 +02:00
Marcus Bointon da739aa763 Fix callback example 2016-05-01 17:06:51 +02:00
Marcus Bointon d3eabffd0c Fix callback example 2016-05-01 17:06:20 +02:00
Marcus Bointon b1ec3ebc50 Docs 2016-05-01 17:02:40 +02:00
Marcus Bointon efbcfa97c0 Callback cleanup, examples 2016-05-01 17:00:48 +02:00
Marcus Bointon 558bcdc269 DKIM cleanup, examples 2016-05-01 13:09:24 +02:00
Jim Jagielski 84fcf44ecf Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-04-28 07:36:32 -04:00
Marcus Bointon 316321bbce Merge branch 'master' into 6.0 2016-04-28 13:06:00 +02:00
Marcus Bointon ea42b599cd Clean up documentation and examples 2016-04-26 22:33:02 +02:00
Marcus Bointon 25ed54e97e Clean up documentation and examples 2016-04-26 22:22:52 +02:00
Marcus Bointon 84d6af5b95 Clean up documentation and examples 2016-04-26 22:16:17 +02:00
Jim Jagielski f27434e343 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-04-25 06:54:18 -04:00
Marcus 665e964f66 Merge branch 'master' into 6.0 2016-04-25 11:02:17 +02:00
Marcus f0ed47850c Sort out namespaces and imports in examples 2016-04-22 19:13:15 +02:00
Marcus baf343dab3 Fix misnamed property, fixes #688 2016-04-21 13:21:19 +02:00
Marcus 338f992055 Provide links for League packages 2016-04-21 12:51:31 +02:00
Marcus f4ab7db9fa Remove unneeded state property, see #687
Provide links for League packages
2016-04-21 12:51:15 +02:00
Marcus 6bf687dbc0 Bump version to 6.0 2016-04-21 12:21:25 +02:00
Marcus 9254275d0b phpdoc cleanup 2016-04-21 12:19:52 +02:00
Marcus ad74f67968 Update generatedocs script for new file locations 2016-04-21 12:19:20 +02:00
Marcus 5dbf14e7f0 Debugformat info 2016-04-21 11:01:55 +02:00
Marcus 28d85344ee Add comment about legacy versions 2016-04-20 00:07:17 +02:00
Marcus 952e7630c1 Don't use is_readable - it breaks on windows with shared volumes - use file_exists instead, see #500 2016-04-19 23:22:20 +02:00
Marcus 3abcab1936 Clean up TODOs
Switch SingleToArray to protected
Update Readme
Update composer deps
2016-04-19 18:26:33 +02:00
Marcus 57c1b25d00 Use and/or in preference to &&/|| consistently - the improvement in readability far outweights the risks of incorrect precedence
Flip some tests for defence
2016-04-19 17:36:16 +02:00
Marcus a8b44e9a8e Merge remote-tracking branch 'remotes/upstream/master' into xoauth
# Conflicts:
#	src/PHPMailer.php
2016-04-19 17:30:13 +02:00
Marcus 9741c04ed8 Improve gmail xoauth example 2016-04-19 17:12:33 +02:00
Marcus 78467895e5 Rely on default debug output setting 2016-04-19 17:08:56 +02:00
Marcus a81898ca95 Set default debug output format automatically 2016-04-19 17:06:53 +02:00
Marcus fcecb5872b Add emoji to UTF-8 content 2016-04-19 17:05:58 +02:00
Jim Jagielski b79bda64fe Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-04-17 09:03:11 -04:00
Jim Jagielski 95020edae9 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-04-12 06:33:45 -04:00
Jim Jagielski 215b484baf Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-04-08 11:31:37 -04:00
Marcus 26378e0eca Fix precedence 2016-04-08 01:41:46 +02:00
Marcus dca2a72e19 Add Microsoft scope options 2016-04-07 11:35:44 +02:00
Marcus 498204253c Revert to later version! 2016-04-07 11:33:03 +02:00
Marcus c4b132e89d Merge branch '5.4' into xoauth
# Conflicts:
#	src/OAuthProvider/Google.php
#	src/PHPMailerOAuth.php
#	src/POP3.php
#	src/SMTP.php
2016-04-07 11:07:24 +02:00
Marcus 3d4e3b1a0d Years & version numbers 2016-04-07 11:04:03 +02:00
Marcus 6b7d61ad76 Merge branch '5.4' into xoauth
# Conflicts:
#	get_oauth_token.php
#	src/OAuthProvider/Google.php
#	src/PHPMailerOAuth.php
2016-04-07 10:59:05 +02:00
Marcus 86ea82969e Merge branch '5.4' into xoauth
# Conflicts:
#	get_oauth_token.php
#	src/OAuthProvider/Google.php
#	src/PHPMailerOAuth.php
2016-04-07 10:58:14 +02:00
Marcus 33f82ab517 Merge branch 'master' into 5.4
Bump version to 5.5
Clean up code generator
# Conflicts:
#	README.md
#	examples/send_file_upload.phps
#	src/SMTP.php
#	test/phpmailerTest.php
2016-04-07 10:52:37 +02:00
Marcus 27501ac7b9 Merge branch 'master' into 5.4
Bump version to 5.5
Clean up code generator
# Conflicts:
#	README.md
#	examples/send_file_upload.phps
#	src/SMTP.php
#	test/phpmailerTest.php
2016-04-07 10:51:05 +02:00
Marcus 2b961897bd PSR-2 cleanup 2016-04-07 08:13:04 +02:00
Marcus 1dd452e9e8 Fix typo 2016-04-07 08:10:31 +02:00
Marcus 05e43f3666 Don't use dynamic classnames in aliased namespaces, see #675
Increase PHP version req to 5.5 in composer.json
2016-04-06 20:18:34 +02:00
Marcus 739127f8e9 Code cleanup, see #675 2016-04-05 13:09:53 +02:00
Marcus 3a41f91fe2 Rearrangements for new XOAUTH approach, see #675 2016-04-05 12:13:39 +02:00
Sherryl George 94c7cf4d9e Xoauth
* Cleaner XOAUTH2 Implementation

* Update gmail_xoauth.phps
2016-04-05 11:53:49 +02:00
Jim Jagielski 9e986e6cfb Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-04-02 08:36:10 -04:00
Jim Jagielski 309538abaf Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-03-23 07:40:54 -04:00
Jim Jagielski f90032df3c Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-03-18 16:03:28 -04:00
Marcus ece9cb4991 Merge branch '5.4' into xoauth
# Conflicts:
#	README.md
2016-03-16 09:55:14 +01:00
Marcus a9054a5d61 Merge branch 'master' into 5.4 2016-03-16 09:49:28 +01:00
Marcus 8635606de4 Update deps 2016-03-08 11:47:57 +01:00
Marcus 7a80c452f3 Merge branch 'master' into xoauth
# Conflicts:
#	README.md
2016-03-05 22:00:08 +01:00
Marcus 870bbcb35e Merge branch 'master' into 5.4
# Conflicts:
#	README.md
2016-03-05 21:58:23 +01:00
Marcus 26c676f1e0 Try to clean up get_oauth_token 2016-03-05 21:52:56 +01:00
randomintcreatepretext.py a1b90c1ee9 Merge remote-tracking branch 'remotes/upstream/master' into xoauth
# Conflicts:
#	README.md
2016-02-11 00:18:14 +01:00
Jim Jagielski 12bb78caa3 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-02-10 09:28:15 -05:00
randomintcreatepretext.py 487933eb3d Merge remote-tracking branch 'remotes/upstream/master' into 5.4
# Conflicts:
#	README.md
2016-02-08 12:50:22 +01:00
randomintcreatepretext.py 75550adfa3 Merge remote-tracking branch 'remotes/upstream/master' into 5.4
# Conflicts:
#	README.md
2016-02-08 12:49:34 +01:00
Jim Jagielski 3898ece755 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-02-01 13:38:40 -05:00
Synchro 53f9f06cd4 Merge branch 'master' into 5.4 2016-01-30 16:29:34 +01:00
Synchro 711916966d Merge branch 'master' into 5.4
# Conflicts:
#	README.md
2016-01-30 16:26:05 +01:00
Synchro 059720971b Merge branch 'master' into 5.4
# Conflicts:
#	README.md
2016-01-30 16:25:16 +01:00
Jim Jagielski f059495d97 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-01-30 09:28:01 -05:00
Jim Jagielski b91826e917 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-01-29 10:13:12 -05:00
Jim Jagielski 164b5d19c0 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-01-28 09:59:42 -05:00
Synchro 8cf057efb7 More cleanup 2016-01-28 13:47:36 +01:00
Synchro 9e0bbaa1ae Changelog 2016-01-25 16:40:52 +01:00
Synchro 620388f34f Merge branch '5.4' into xoauth
# Conflicts:
#	changelog.md
#	composer.json
#	composer.lock
#	get_oauth_token.php
2016-01-25 16:08:47 +01:00
Synchro ffdde9b6a2 Remove deprecated elements
Update changelog
2016-01-25 16:01:59 +01:00
Jim Jagielski 83a1230a96 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2016-01-07 15:24:51 -05:00
Synchro 7bb65f288b Merge branch 'master' into xoauth 2016-01-07 20:38:58 +01:00
Synchro 9d96b7b362 Suggest generic oauth client 2016-01-07 18:41:01 +01:00
Synchro bf60c58a01 Merge branch 'master' into 5.4
# Conflicts:
#	composer.lock
#	get_oauth_token.php
2016-01-07 18:39:55 +01:00
Marcus Bointon be73e1f8a2 Merge pull request #603 from vuthao/5.4
remove check safe-mode
2016-01-06 18:48:59 +01:00
Vu Thao 62a3740c7b remove check safe-mode
(Safe Mode REMOVED as of PHP 5.4.0
http://php.net/manual/en/features.safe-mode.php)
2016-01-05 22:51:10 +07:00
Jim Jagielski 08a14319bf Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2015-12-28 07:57:05 -05:00
Jim Jagielski a7305fe316 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2015-12-25 20:53:55 -05:00
Jim Jagielski f3f25fb66d Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2015-12-22 07:07:50 -05:00
Marcus Bointon b380d98a17 Merge branch '5.4' into xoauth 2015-12-22 09:38:33 +01:00
Marcus Bointon 32a99356ef Merge remote-tracking branch 'remotes/upstream/master' into 5.4
# Conflicts:
#	test/phpmailerTest.php
2015-12-22 09:35:50 +01:00
Jim Jagielski b8f4b6d313 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2015-12-18 07:59:21 -05:00
Synchro b0faa82fb7 Merge branch '5.4' into xoauth
# Conflicts:
#	changelog.md
2015-12-17 17:34:40 +01:00
Synchro 280e7a51f8 Make parseAddresses static, see #82 2015-12-17 17:32:39 +01:00
Jim Jagielski 411b0e7ab6 Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2015-12-08 08:10:16 -05:00
Synchro de1015e6ed Fix composer files 2015-12-07 23:29:15 +01:00
Synchro dffac3a0f5 Merge remote-tracking branch 'remotes/upstream/5.4' into xoauth
# Conflicts:
#	composer.json
#	composer.lock
#	get_oauth_token.php
2015-12-07 22:37:30 +01:00
Synchro 40bdd9c488 Merge branch 'master' into 5.4
# Conflicts:
#	changelog.md
#	composer.json
#	get_oauth_token.php
2015-12-07 22:19:48 +01:00
Synchro 5cdb01b129 Ignore whatever the problem is with pop3 for now! 2015-12-01 15:44:12 +01:00
Synchro cccf32b7a6 Fix POP3 script path 2015-12-01 14:23:47 +01:00
Synchro bd4bb1024a Revert to old code for POP tests, ignore exit errors
Update deps
2015-12-01 10:20:44 +01:00
Jim Jagielski 988f51bc4c Merge branch 'master' of https://github.com/PHPMailer/PHPMailer 2015-11-25 11:54:34 -05:00
Synchro 0d0213af5b Update deps 2015-11-24 19:04:29 +01:00
Synchro 2074c8e5ab See what's happening in the shell 2015-11-24 19:04:12 +01:00
Synchro a7aa1491ef Ps args 2015-11-24 11:56:07 +01:00
Synchro 5c3f73586b Merge remote-tracking branch 'remotes/upstream/master' into 5.4 2015-11-23 23:10:26 +01:00
Synchro 703266cc29 Merge branch 'master' into 5.4 2015-11-23 10:34:55 +01:00
Synchro f8ed4eba2a PHPUnit again 2015-11-23 08:54:21 +01:00
Synchro da9666e893 PHPUnit tweaks 2015-11-12 14:43:19 +01:00
Synchro 428949a697 PHPUnit tweaks 2015-11-12 12:51:29 +01:00
Synchro 2ea088ecc5 PHPUnit tweaks 2015-11-12 12:30:31 +01:00
Synchro 6a7ed78618 PHPUnit tweaks 2015-11-12 12:18:21 +01:00
Synchro eaebda7d66 PHPUnit tweaks 2015-11-12 11:47:10 +01:00
Synchro 1f3a204d70 PHPUnit tweaks 2015-11-12 11:29:23 +01:00
Synchro f66899617a PHPUnit tweaks 2015-11-12 10:45:16 +01:00
Synchro 0c116a6287 PHPUnit tweaks 2015-11-12 10:13:28 +01:00
Synchro c9f2347300 PHPUnit tweaks 2015-11-12 10:12:55 +01:00
Synchro 545febf0cf PHPUnit tweaks 2015-11-12 09:43:56 +01:00
Synchro 7a55a752b3 PHPUnit tweaks 2015-11-12 09:37:41 +01:00
Synchro 6bcb0f8f8d PHPUnit tweaks 2015-11-12 08:43:23 +01:00
Synchro 2b632a71be PHPUnit tweaks 2015-11-11 19:20:16 +01:00
Synchro bcfd59bc6f PHPUnit tweaks 2015-11-11 18:13:28 +01:00
Synchro ea1c3b1b0e PHPUnit tweaks 2015-11-11 18:11:34 +01:00
Synchro 9a65420d1a PHPUnit tweaks 2015-11-11 18:05:38 +01:00
Synchro 2101e1654b PHPUnit tweaks 2015-11-11 18:04:02 +01:00
Synchro e817e299ff Merge branch '5.4' of https://github.com/PHPMailer/PHPMailer into xoauth
# Conflicts:
#	composer.json
#	composer.lock
2015-11-11 18:01:53 +01:00
Synchro 1baa71ae58 PHPUnit tweaks 2015-11-11 17:37:53 +01:00
Synchro be760f6551 PHPUnit tweaks 2015-11-11 17:31:50 +01:00
Synchro 0dae3451c6 Downgrade to PHPUnit 4.7 to avoid 4.8 bug 2015-11-11 17:08:35 +01:00
Synchro f2a08a26c0 Coding standards 2015-11-11 17:04:35 +01:00
Marcus Bointon 5443a5ce02 Merge pull request #557 from fbonzon/5.4
Use a closure now that PHP 5.4 is min requirement
2015-11-11 15:24:41 +01:00
François B 28e566da00 Use a closure now that PHP 5.4 is min requirement
Resurrects
https://github.com/PHPMailer/PHPMailer/commit/0f24d1e67974926fd5fa316c3b
13f89a73a3d8c1
2015-11-11 14:51:57 +01:00
Synchro 758eb3fe8e Travis & PHPUnit tweaks 2015-11-10 19:38:14 +01:00
Synchro a0407c6630 Travis & PHPUnit tweaks 2015-11-10 19:09:08 +01:00
Synchro 75dd5453b2 Travis & PHPUnit tweaks 2015-11-10 15:31:23 +01:00
Synchro 12805da50a Travis & PHPUnit tweaks 2015-11-10 15:17:46 +01:00
Synchro abc34907f1 Merge remote-tracking branch 'remotes/upstream/5.4' into xoauth 2015-11-10 14:45:22 +01:00
Synchro a139b96368 Tell Travis to install composer packages 2015-11-10 14:44:38 +01:00
Synchro fbe62ff9b5 Tidy up copyright notices 2015-11-10 14:44:16 +01:00
Synchro feea6358c6 Merge branch '5.4' into xoauth
# Conflicts:
#	get_oauth_token.php
2015-11-10 13:48:39 +01:00
Synchro 14e8ef03eb Short array syntax 2015-11-10 13:45:13 +01:00
Synchro 016e6330d4 xoauth stuff 2015-11-10 13:09:29 +01:00
Synchro 466264810a Merge remote-tracking branch 'remotes/upstream/5.4' into xoauth
# Conflicts:
#	composer.json
#	composer.lock
#	examples/gmail_xoauth.phps
#	get_oauth_token.php
#	src/OAuthProvider/Google.php
#	src/PHPMailerOAuth.php
2015-11-10 10:25:37 +01:00
Synchro 9b3e13dc14 First draft of 5.4 2015-11-09 19:09:13 +01:00
Synchro 19fcea0556 Cleanup 2015-10-20 13:52:29 +02:00
Synchro 65244ee9dc Merge remote-tracking branch 'upstream/master' into xoauth
# Conflicts:
#	class.phpmaileroauth.php
#	class.phpmaileroauthgoogle.php
#	class.smtp.php
#	examples/gmail_xoauth.phps
#	get_oauth_token.php
2015-10-15 09:29:01 +02:00
Synchro 8a922619bb Merge branch 'master' of https://github.com/hayageek/PHPMailer into xoauth, PR #507 2015-09-25 14:43:10 +02:00
Ravishanker Kusuma c71721636e XOAuth Providers support Google,Yahoo,Microsoft
Added token expiry check
2015-09-24 15:22:48 +08:00
Jim Jagielski 099dedad3c Merge pull request #1 from PHPMailer/master
mer
2014-12-02 14:18:08 -05:00
244 changed files with 20031 additions and 16610 deletions

21
.codecov.yml Normal file
View File

@ -0,0 +1,21 @@
codecov:
notify:
after_n_builds: 2
coverage:
round: nearest
# Status will be green when coverage is between 70 and 100%.
range: "70...100"
status:
project:
default:
threshold: 2%
paths:
- "src"
patch:
default:
threshold: 0%
paths:
- "src"
comment: false

15
.editorconfig Normal file
View File

@ -0,0 +1,15 @@
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2

17
.gitattributes vendored
View File

@ -1,12 +1,17 @@
* text=auto
/docs export-ignore
/test export-ignore
/.codecov.yml export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.phan export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/travis.phpunit.xml.dist export-ignore
/SECURITY.md export-ignore
/changelog.md export-ignore
/README.md export-ignore
/docs export-ignore
/examples export-ignore
/phpcs.xml.dist export-ignore
/phpdoc.dist.xml export-ignore
/phpunit.xml.dist export-ignore
/test export-ignore
/UPGRADING.md export-ignore

6
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,6 @@
# These are supported funding model platforms
github: Synchro
patreon: marcusbointon
tidelift: "packagist/phpmailer/phpmailer"
custom: https://marcus.bointon.com/donations/

View File

@ -1 +0,0 @@
Non-security issues and pull requests are no longer being accepted for the legacy PHPMailer 5.2 branch. Migrate to PHPMailer 6.0 (or later) and report your issue there.

23
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,23 @@
---
name: Bug report
about: If you've found a bug in PHPMailer, this is the right place to report it
title: ''
labels: ''
assignees: ''
---
Please check these things before submitting your issue:
- [ ] *Read the error message* you're seeing - it often tells you what is wrong, and may contain useful links & instructions
- [ ] Make sure you're using the latest version of PHPMailer
- [ ] Check that your problem is not dealt with in [the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting), especially if you're having problems connecting to Gmail or GoDaddy
- [ ] Include sufficient code to reproduce your problem
- [ ] If you're having an SMTP issue, include the debug output generated with `SMTPDebug = 2` set
- [ ] If you have a question about how to use PHPMailer (rather than reporting a bug in it), tag a question on Stack Overflow with `phpmailer`, but [**search first**](https://stackoverflow.com/questions/tagged/phpmailer)!
# Problem description
# Code to reproduce
# Debug output

View File

@ -1 +0,0 @@
Non-security issues and pull requests are no longer being accepted for the legacy PHPMailer 5.2 branch. Migrate to PHPMailer 6.0 (or later) and report your issue there.

15
.github/actions/build-docs/Dockerfile vendored Normal file
View File

@ -0,0 +1,15 @@
FROM phpdoc/phpdoc
LABEL "repository"="https://github.com/PHPMailer/PHPMailer"
LABEL "com.github.actions.name"="Build Docs"
LABEL "com.github.actions.description"="Build Docs with phpDocumentor"
LABEL "com.github.actions.icon"="file-text"
LABEL "com.github.actions.color"="blue"
# don't show errors
RUN echo "display_errors = Off" > $PHP_INI_DIR/conf.d/errors.ini
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

5
.github/actions/build-docs/entrypoint.sh vendored Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
set -eu
/opt/phpdoc/bin/phpdoc

21
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,21 @@
# Dependabot configuration.
#
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "cron"
cronjob: "10 22 5,20 * *" # At 22:10, every 5th and 20th day of the month.
open-pull-requests-limit: 5
commit-message:
prefix: "GH Actions:"
groups:
action-runners:
applies-to: version-updates
update-types:
- "minor"
- "patch"

30
.github/workflows/docs.yaml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Docs
on:
push:
branches:
- master
permissions: {}
jobs:
build_and_publish:
permissions:
contents: write # to push changes in repo (jamesives/github-pages-deploy-action)
name: Build and publish Docs
runs-on: ubuntu-latest
if: github.repository == 'PHPMailer/PHPMailer'
steps:
- name: Checkout sources
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
persist-credentials: false
- name: Build Docs
uses: ./.github/actions/build-docs
- name: Publish Docs to gh-pages
uses: JamesIves/github-pages-deploy-action@9d877eea73427180ae43cf98e8914934fe157a1a # v4.7.6
with:
branch: gh-pages
folder: docs
env:
BUILD_DIR: docs/
GH_PAT: ${{ secrets.GH_PAT }}

61
.github/workflows/scorecards.yml vendored Normal file
View File

@ -0,0 +1,61 @@
name: Scorecards supply-chain security
on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
- cron: '39 20 * * 1'
push:
branches: [ "master" ]
permissions: {}
jobs:
analysis:
# Don't run the cron job on forks.
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}
name: Scorecards analysis
runs-on: ubuntu-latest
permissions:
# Required when publishing results (badge / API / code scanning)
security-events: write
id-token: write
steps:
- name: "Checkout code"
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
# (Optional) Read-only PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecards on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
# repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
# Publish the results for public repositories to enable scorecard badges. For more details, see
# https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories, `publish_results` will automatically be set to `false`, regardless
# of the value entered here.
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
sarif_file: results.sarif

237
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,237 @@
name: "Tests"
on:
push:
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:
permissions: {}
jobs:
coding-standard:
runs-on: ubuntu-22.04
name: Coding standards
permissions:
contents: read # to fetch code (actions/checkout)
steps:
- name: Check out code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Set up PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: 'latest'
coverage: none
tools: cs2pr
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
- name: Check coding standards
id: phpcs
run: ./vendor/bin/phpcs -s --report-full --report-checkstyle=./phpcs-report.xml
- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./phpcs-report.xml
lint:
runs-on: ubuntu-22.04
strategy:
matrix:
php: ['5.5', '7.2', '8.0', '8.5']
experimental: [false]
include:
- php: 'nightly'
experimental: true
name: "Lint: PHP ${{ matrix.php }}"
continue-on-error: ${{ matrix.experimental }}
permissions:
contents: read # to fetch code (actions/checkout)
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=-1, display_errors=On, display_startup_errors=On
coverage: none
tools: cs2pr
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
- name: Lint against parse errors
if: ${{ matrix.php != 'nightly' }}
run: composer lint -- --checkstyle | cs2pr
- name: Lint against future parse errors (PHP nightly)
if: ${{ matrix.php == 'nightly' }}
run: composer lint
test:
needs: ['coding-standard', 'lint']
runs-on: ubuntu-22.04
strategy:
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
extensions: ['optimal', 'minimal']
coverage: [false]
experimental: [false]
include:
# Run code coverage on high/low PHP.
- php: '5.5'
extensions: 'optimal'
coverage: true
experimental: false
- php: '5.5'
extensions: 'minimal'
coverage: true
experimental: false
- php: '8.5'
extensions: 'optimal'
coverage: true
experimental: false
- php: '8.5'
extensions: 'minimal'
coverage: true
experimental: false
# Experimental builds. These are allowed to fail.
- php: '8.6'
extensions: 'optimal'
coverage: false
experimental: true
- php: '8.6'
extensions: 'minimal'
coverage: false
experimental: true
name: "Test: PHP ${{ matrix.php }} - ${{ matrix.extensions }}"
continue-on-error: ${{ matrix.experimental }}
permissions:
contents: read # to fetch code (actions/checkout)
steps:
- name: Check out code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
# About the "extensions":
#
# In a "normal" test run, the "default" extension set for a PHP version is used
# and it is ensured that certain extensions will be available, no matter what.
#
# For the "minimal" test run, all extensions are disabled and then only
# a limited set of minimally required extensions are re-enabled.
# The minimal set is based on the required extensions from PHPUnit + PHPMailer combined
# + Curl for Composer.
# Whether Xdebug will be enabled depends on the code coverage settings.
#
# Also see:
# https://github.com/shivammathur/setup-php/?tab=readme-ov-file#heavy_plus_sign-php-extension-support
# https://github.com/shivammathur/setup-php/wiki
- name: Determine extensions to use
id: set_extensions
run: |
if [[ "${{ matrix.extensions }}" == "optimal" ]]; then
# Optimal.
echo 'EXT=imap, mbstring, openssl, intl, ctype, filter, hash' >> $GITHUB_OUTPUT
echo 'COMPOSER_OPTIONS=' >> $GITHUB_OUTPUT
else
# Minimal.
echo 'EXT=none, curl, dom, json, libxml, mbstring, tokenizer, xml, xmlwriter, ctype, filter, hash' >> $GITHUB_OUTPUT
echo 'COMPOSER_OPTIONS=--ignore-platform-req=ext-simplexml' >> $GITHUB_OUTPUT
fi
- name: Set up PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
ini-values: sendmail_path=/usr/sbin/sendmail -t -i, error_reporting=-1, display_errors=On, display_startup_errors=On
extensions: ${{ steps.set_extensions.outputs.EXT }}
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install PHP packages - normal
if: ${{ matrix.php != '8.6' }}
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
with:
composer-options: ${{ steps.set_extensions.outputs.COMPOSER_OPTIONS }}
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
- name: Install PHP packages - ignore-platform-reqs
if: ${{ matrix.php == '8.6' }}
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
with:
composer-options: --ignore-platform-reqs ${{ steps.set_extensions.outputs.COMPOSER_OPTIONS }}
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
# Install postfix and automatically retry if the install failed, which happens reguarly.
# @link https://github.com/marketplace/actions/retry-step
- name: Install postfix
uses: nick-invision/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 2
max_attempts: 3
retry_wait_seconds: 8
command: |
sudo apt-get install --fix-broken -y libsqlite3-0 postfix
sudo systemctl stop postfix.service
- name: Set up sendmail
run: |
smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
mkdir -p build/logs
sudo cp test/testbootstrap-dist.php test/testbootstrap.php
sudo chmod +x test/fakesendmail.sh
sudo mkdir -p /var/qmail/bin
sudo cp test/fakesendmail.sh /var/qmail/bin/sendmail
sudo cp test/fakesendmail.sh /usr/sbin/sendmail
- name: Run tests, no code coverage
if: ${{ matrix.coverage == false }}
run: ./vendor/bin/phpunit --no-coverage
- name: Run tests with code coverage
if: ${{ matrix.coverage == true }}
run: vendor/bin/phpunit
- name: Send coverage report to Codecov
if: ${{ success() && matrix.coverage == true && github.event.repository.fork == false }}
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./build/logs/clover.xml
fail_ci_if_error: true
verbose: true

14
.gitignore vendored
View File

@ -1,6 +1,16 @@
docs/phpdoc/
docs/*
!docs/README.md
test/message.txt
test/testbootstrap.php
test/*.pem
build/
vendor/
*.pem
composer.lock
.phpcs.xml
phpcs.xml
.phpcs-cache
/.rnd
test/PHPMailerTest.php*nonexistent_file.txt
test/*/PHPMailerTest.php*nonexistent_file.txt
phpunit.xml
/.phpunit.result.cache

41
.phan/config.php Normal file
View File

@ -0,0 +1,41 @@
<?php
/**
* This configuration will be read and overlaid on top of the
* default configuration. Command line arguments will be applied
* after this file is read.
*/
return [
// A list of directories that should be parsed for class and
// method information. After excluding the directories
// defined in exclude_analysis_directory_list, the remaining
// files will be statically analyzed for errors.
//
// Thus, both first-party and third-party code being used by
// your application should be included in this list.
'directory_list' => [
'src',
'vendor',
'examples'
],
// A directory list that defines files that will be excluded
// from static analysis, but whose class and method
// information should be included.
//
// Generally, you'll want to include the directories for
// third-party code (such as "vendor/") in this list.
//
// n.b.: If you'd like to parse but not analyze 3rd
// party code, directories containing that code
// should be added to the `directory_list` as
// to `exclude_analysis_directory_list`.
"exclude_analysis_directory_list" => [
'vendor/'
],
'skip_slow_php_options_warning' => true,
'exclude_file_regex' => '@^vendor/.*/(tests|Tests)/@',
];

View File

@ -1,132 +0,0 @@
build:
environment:
php: '5.6.0'
before_commands:
- "composer install --prefer-source"
tools:
external_code_coverage:
enabled: true
timeout: 300
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'
php_code_coverage:
enabled: false
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'
php_code_sniffer:
enabled: true
config:
standard: PSR2
sniffs:
generic:
files:
one_class_per_file_sniff: false
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'
# Copy/Paste Detector
php_cpd:
enabled: true
excluded_dirs:
- docs
- examples
- extras
- test
- vendor
# PHP CS Fixer (http://http://cs.sensiolabs.org/).
php_cs_fixer:
enabled: true
config:
level: psr2
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'
# Analyzes the size and structure of a PHP project.
php_loc:
enabled: true
excluded_dirs:
- docs
- examples
- extras
- test
- vendor
# PHP Mess Detector (http://phpmd.org).
php_mess_detector:
enabled: true
config:
rulesets:
- codesize
- unusedcode
- naming
- design
naming_rules:
short_variable: { minimum: 2 }
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'
# Analyzes the size and structure of a PHP project.
php_pdepend:
enabled: true
excluded_dirs:
- docs
- examples
- extras
- test
- vendor
# Runs Scrutinizer's PHP Analyzer Tool
# https://scrutinizer-ci.com/docs/tools/php/php-analyzer/config_reference
php_analyzer:
enabled: true
config:
checkstyle:
enabled: true
naming:
enabled: true
property_name: ^[_a-zA-Z][a-zA-Z0-9_]*$ #Allow underscores & caps
method_name: ^(?:[_a-zA-Z]|__)[a-zA-Z0-9_]*$ #Allow underscores & caps
parameter_name: ^[a-z][a-zA-Z0-9_]*$ # Allow underscores
local_variable: ^[a-zA-Z][a-zA-Z0-9_]*$ #Allow underscores & caps
exception_name: ^[a-zA-Z][a-zA-Z0-9]*Exception$
isser_method_name: ^(?:[_a-zA-Z]|__)[a-zA-Z0-9]*$ #Allow underscores & caps
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'
# Security Advisory Checker
sensiolabs_security_checker: true

View File

@ -1,38 +0,0 @@
language: php
php:
- 7.1
- 7.0
- 5.6
- 5.5
- 5.4
- 5.3
matrix:
include:
- php: hhvm
dist: trusty
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y -qq postfix
install:
- composer install
before_script:
- sudo service postfix stop
- smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
- mkdir -p build/logs
- cd test
- cp testbootstrap-dist.php testbootstrap.php
- chmod +x fakesendmail.sh
- sudo mkdir -p /var/qmail/bin
- sudo cp fakesendmail.sh /var/qmail/bin/sendmail
- sudo cp fakesendmail.sh /usr/sbin/sendmail
- |
if [[ $TRAVIS_PHP_VERSION = "hhv"* ]]; then
echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' >> /etc/hhvm/php.ini
else
echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' > $(php --ini|grep -m 1 "ini files in:"|cut -d ":" -f 2)/sendmail.ini
fi
script:
- ../vendor/bin/phpunit --configuration ../travis.phpunit.xml.dist
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover ../build/logs/clover.xml

46
COMMITMENT Normal file
View File

@ -0,0 +1,46 @@
GPL Cooperation Commitment
Version 1.0
Before filing or continuing to prosecute any legal proceeding or claim
(other than a Defensive Action) arising from termination of a Covered
License, we commit to extend to the person or entity ('you') accused
of violating the Covered License the following provisions regarding
cure and reinstatement, taken from GPL version 3. As used here, the
term 'this License' refers to the specific Covered License being
enforced.
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly
and finally terminates your license, and (b) permanently, if the
copyright holder fails to notify you of the violation by some
reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you
have received notice of violation of this License (for any work)
from that copyright holder, and you cure the violation prior to 30
days after your receipt of the notice.
We intend this Commitment to be irrevocable, and binding and
enforceable against us and assignees of or successors to our
copyrights.
Definitions
'Covered License' means the GNU General Public License, version 2
(GPLv2), the GNU Lesser General Public License, version 2.1
(LGPLv2.1), or the GNU Library General Public License, version 2
(LGPLv2), all as published by the Free Software Foundation.
'Defensive Action' means a legal proceeding or claim that We bring
against you in response to a prior proceeding or claim initiated by
you or your affiliate.
'We' means each contributor to this repository as of the date of
inclusion of this file, including subsidiaries of a corporate
contributor.
This work is available under a Creative Commons Attribution-ShareAlike
4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/).

42
LICENSE
View File

@ -1,8 +1,8 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -10,7 +10,7 @@
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
@ -111,8 +111,8 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
@ -158,7 +158,7 @@ Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@ -267,7 +267,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
@ -312,7 +312,7 @@ of these things:
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) verify that the user has already received a copy of these
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@ -455,8 +455,8 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
@ -485,7 +485,7 @@ convey the exclusion of warranty; and each file should have at least the
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
@ -499,6 +499,4 @@ necessary. Here is a sample; alter the names:
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
That's all there is to it!

View File

@ -1,49 +0,0 @@
<?php
/**
* PHPMailer SPL autoloader.
* PHP Version 5
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailer SPL autoloader.
* @param string $classname The name of the class to load
*/
function PHPMailerAutoload($classname)
{
//Can't use __DIR__ as it's only in PHP 5.3+
$filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
if (is_readable($filename)) {
require $filename;
}
}
if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
//SPL autoloading was introduced in PHP 5.1.2
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
spl_autoload_register('PHPMailerAutoload', true, true);
} else {
spl_autoload_register('PHPMailerAutoload');
}
} else {
/**
* Fall back to traditional autoload for old PHP versions
* @param string $classname The name of the class to load
*/
function __autoload($classname)
{
PHPMailerAutoload($classname);
}
}

218
README.md
View File

@ -1,196 +1,232 @@
[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://supportukrainenow.org/)
![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png)
# PHPMailer - A full-featured email creation and transfer class for PHP
# PHPMailer A full-featured email creation and transfer class for PHP
Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/quality-score.png?s=3758e21d279becdf847a557a56a3ed16dfec9d5d)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/)
[![Code Coverage](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/coverage.png?s=3fe6ca5fe8cd2cdf96285756e42932f7ca256962)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/)
[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![Latest Unstable Version](https://poser.pugx.org/phpmailer/phpmailer/v/unstable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer)
## Class Features
[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions)
[![codecov.io](https://codecov.io/gh/PHPMailer/PHPMailer/branch/master/graph/badge.svg?token=iORZpwmYmM)](https://codecov.io/gh/PHPMailer/PHPMailer)
[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer)
[![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer)
[![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer)
[![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer/badge)](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer)
## 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
- Integrated SMTP support - send without a local mail server
- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs
- Integrated SMTP support send without a local mail server
- Send emails with multiple To, CC, BCC, and Reply-to addresses
- Multipart/alternative emails for mail clients that do not read HTML email
- Add attachments, including inline
- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
- SMTP authentication with LOGIN, PLAIN, NTLM, CRAM-MD5 and Google's XOAUTH2 mechanisms over SSL and TLS transports
- Error messages in 47 languages!
- Full UTF-8 support when using servers that support `SMTPUTF8`.
- Support for iCal events in multiparts and attachments
- SMTP authentication with `LOGIN`, `PLAIN`, `CRAM-MD5`, and `XOAUTH2` mechanisms over SMTPS and SMTP+STARTTLS transports
- Validates email addresses automatically
- Protects against header injection attacks
- Error messages in over 50 languages!
- DKIM and S/MIME signing support
- Compatible with PHP 5.0 and later
- Compatible with PHP 5.5 and later, including PHP 8.5
- Namespaced to prevent name clashes
- Much more!
## Why you might need it
Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as authentication, HTML messages, and attachments.
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 (and conflicting) standards, 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, if not unsafe!
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 macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost.
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.
*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 [Symfony Mailer](https://symfony.com/doc/current/mailer.html), [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc.
## License
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.
This software is distributed under the [LGPL 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution.
## Installation & loading
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 is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file:
```json
"phpmailer/phpmailer": "~5.2"
"phpmailer/phpmailer": "^7.0.0"
```
or
or run
```sh
composer require phpmailer/phpmailer
```
If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-google` package.
Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer.
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 want to use XOAUTH2 authentication, you will also need to add a dependency on the `league/oauth2-client` and appropriate service adapters package in your `composer.json`, or take a look at
by @decomplexity's [SendOauth2 wrapper](https://github.com/decomplexity/SendOauth2), especially if you're using Microsoft services.
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.
Alternatively, if you're not using Composer, you
can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually:
PHPMailer does *not* declare a namespace because namespaces were only introduced in PHP 5.3.
```php
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
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`.
require 'path/to/PHPMailer/src/Exception.php';
require 'path/to/PHPMailer/src/PHPMailer.php';
require 'path/to/PHPMailer/src/SMTP.php';
```
If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for it. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally.
## Legacy versions
PHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases.
### Upgrading from 5.2
The biggest changes are that source files are now in the `src/` folder, and PHPMailer now declares the namespace `PHPMailer\PHPMailer`. This has several important effects [read the upgrade guide](https://github.com/PHPMailer/PHPMailer/tree/master/UPGRADING.md) for more details.
### 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](https://github.com/PHPMailer/PHPMailer/tree/master/class.phpmailer.php). If you're using SMTP, you'll need [class.smtp.php](https://github.com/PHPMailer/PHPMailer/tree/master/class.smtp.php), and if you're using POP-before SMTP, you'll need [class.pop3.php](https://github.com/PHPMailer/PHPMailer/tree/master/class.pop3.php). For all of these, we recommend you use [the autoloader](https://github.com/PHPMailer/PHPMailer/tree/master/PHPMailerAutoload.php) too as otherwise you will either have to `require` all classes manually or use some other autoloader. You can skip the [language](https://github.com/PHPMailer/PHPMailer/tree/master/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.
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 [src/PHPMailer.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/PHPMailer.php). If you're using SMTP, you'll need [src/SMTP.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/SMTP.php), and if you're using POP-before SMTP (*very* unlikely!), you'll need [src/POP3.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/POP3.php). You can skip the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder if you're not showing errors to users and can make do with English-only errors. If you're using XOAUTH2 you will need [src/OAuth.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/OAuth.php) as well as the Composer dependencies for the services you wish to authenticate with. Really, it's much easier to use Composer!
## A Simple Example
```php
<?php
require 'PHPMailerAutoload.php';
//Import PHPMailer classes into the global namespace
//These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
$mail = new PHPMailer;
//Load Composer's autoloader (created by composer, not included with PHPMailer)
require 'vendor/autoload.php';
//$mail->SMTPDebug = 3; // Enable verbose debug output
//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'user@example.com'; // SMTP username
$mail->Password = 'secret'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
try {
//Server settings
$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'smtp.example.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'user@example.com'; //SMTP username
$mail->Password = 'secret'; //SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption
$mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
$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');
$mail->addCC('cc@example.com');
$mail->addBCC('bcc@example.com');
//Recipients
$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');
$mail->addCC('cc@example.com');
$mail->addBCC('bcc@example.com');
$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
//Attachments
$mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name
$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';
//Content
$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;
} else {
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
```
You'll find plenty more to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder.
You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through Gmail, building contact forms, sending to mailing lists, and more.
If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance.
That's it. You should now be ready to use PHPMailer!
## Localization
PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder you'll find numerous (46 at the time of writing!) translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this:
PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder, you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](https://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
//To load the French version
$mail->setLanguage('fr', '/optional/path/to/language/directory/');
```
We welcome corrections and new languages - if you're looking for corrections to do, run the [phpmailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/phpmailerLangTest.php) script in the tests folder and it will show any missing translations.
We welcome corrections and new languages if you're looking for corrections, run the [Language/TranslationCompletenessTest.php](https://github.com/PHPMailer/PHPMailer/blob/master/test/Language/TranslationCompletenessTest.php) script in the tests folder and it will show any missing translations.
## Documentation
Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, head for [the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) as it's frequently updated.
Examples of how to use PHPMailer for common scenarios can be found in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. If you're looking for a good starting point, we recommend you start with [the Gmail example](https://github.com/PHPMailer/PHPMailer/tree/master/examples/gmail.phps).
There are tips and a troubleshooting guide in the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, this should be the first place you look as it's the most frequently updated.
To reduce PHPMailer's deployed code footprint, examples are not included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly.
Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/).
Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/).
You'll find some basic user-level docs in the [docs](docs/) folder, and you can generate complete API-level documentation using the [generatedocs.sh](https://github.com/PHPMailer/PHPMailer/tree/master/docs/generatedocs.sh) shell script in the docs folder, though you'll need to install [PHPDocumentor](http://www.phpdoc.org) first. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/phpmailerTest.php) a good source of how to do various operations such as encryption.
You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](https://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailer/PHPMailerTest.php) a good reference for how to do various operations such as encryption.
If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](https://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
## Tests
[PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions.
There is a PHPUnit test script in the [test](https://github.com/PHPMailer/PHPMailer/tree/master/test/) folder.
Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer)
[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions)
If this isn't passing, is there something you can do to help?
## Security
Please disclose any vulnerabilities found responsibly report security issues to the maintainers privately.
Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately.
PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity.
PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer).
PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a critical remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html).
See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) for more detail on security issues.
See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security).
## Contributing
Please submit bug reports, suggestions, and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues).
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.
We're particularly interested in fixing edge-cases, expanding test coverage and updating translations.
If you found a mistake in the docs, or want to add something, go ahead and amend the wiki anyone can edit it.
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:
If you have git clones from prior to 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:
```sh
git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git
```
Please *don't* use the SourceForge or Google Code projects any more.
Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained.
## Sponsorship
Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), the world's only privacy-first email marketing system.
Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), a powerful email marketing system.
<a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="550" alt="Smartmessages.net privacy-first email marketing logo"></a>
<a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="250" height="28" alt="Smartmessages email marketing"></a>
Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to PHPMailer's maintainers and contributors just click the "Sponsor" button [on the project page](https://github.com/PHPMailer/PHPMailer). If your company uses PHPMailer, consider taking part in Tidelift's enterprise support programme.
Other contributions are gladly received, whether in beer 🍺, T-shirts 👕, Amazon wishlist raids, or cold, hard cash 💰.
## PHPMailer For Enterprise
Available as part of the Tidelift Subscription.
The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial
support and maintenance for the open-source packages you use to build your applications. Save time, reduce risk, and
improve code health, while paying the maintainers of the exact packages you
use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Changelog
See [changelog](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.
- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](https://sourceforge.net/projects/phpmailer/).
- [Marcus Bointon](https://github.com/Synchro) (`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) in 2008.
- Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008.
- Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in 2013.
- PHPMailer moves to the [PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013.
- PHPMailer moves to [the PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013.
### What's changed since moving from SourceForge?
- Official successor to the SourceForge and Google Code projects.
- Test suite.
- Continuous integration with Travis-CI.
- Continuous integration with GitHub Actions.
- Composer support.
- Public development.
- Additional languages and language strings.
- CRAM-MD5 authentication support.
- Preserves full repo history of authors, commits and branches from the original SourceForge project.
- Preserves full repo history of authors, commits, and branches from the original SourceForge project.

View File

@ -1,14 +1,25 @@
# Security notices relating to PHPMailer
Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately.
Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately.
PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/).
PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows.
PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift.
PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts.
PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security.
PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr.
PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it is not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity.
PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer).
PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html).
PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html).
PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending.

48
SMTPUTF8.md Normal file
View File

@ -0,0 +1,48 @@
# A short history of UTF-8 in email
## Background
For most of its existence, SMTP has been a 7-bit channel, only supporting US-ASCII characters. This has been a problem for many languages, especially those that use non-Latin scripts, and has led to the development of various workarounds.
The first major improvement, introduced in 1994 in [RFC 1652](https://www.rfc-editor.org/rfc/rfc1652) and extended in 2011 in [RFC 6152](https://www.rfc-editor.org/rfc/rfc6152), was the addition of the `8BITMIME` SMTP extension, which allowed raw 8-bit data to be included in message bodies sent over SMTP.
This allowed the message *contents* to contain 8-bit data, including things like UTF-8 text, even though the SMTP protocol itself was still firmly 7-bit. This worked by having the server switch to 8-bit after the headers, and then back to 7-bit after the completion of a `DATA` command.
From 1996, messages could support [RFC 2047 encoding](https://www.rfc-editor.org/rfc/rfc2047), which permitted inserting characters from any character set into header *values* (but not names), but only by encoding them in somewhat unreadable ways to allow them to survive passage through a 7-bit channel. An example with a subject of "Schrödinger's cat" would be:
```
Subject: =?utf-8?Q=Schr=C3=B6dinger=92s_Cat?=
```
Here the accented `ö` is encoded as `=C3=B6`, which is the UTF-8 encoding of the 2-byte character, and the whole thing is wrapped in `=?utf-8?Q?` to indicate that it uses the UTF-8 charset and `quoted-printable` encoding. This is a bit of a hack, and not very human-friendly, but it works.
Similarly, 8-bit message bodies could be encoded using the same `quoted-printable` and `base64` content transfer encoding (CTE) schemes, which preserved the 8-bit content while encoding it in a format that could survive transmission through a 7-bit channel.
Domain names were originally also stuck in a 7-bit world, actually even more constrained to only a subset of the US-ASCII character set. But of course, many people want to have domains in their own language/script. Internationalized domain name (IDN) permitted this, using yet another complex encoding scheme called punycode, defined for domain names in 2003 in [RFC 3492](https://www.rfc-editor.org/rfc/rfc3492). This finally allowed the domain part (after the `@`) of email addresses to contain UTF-8, though it was actually an illusion preserved by email client applications. For example, an address of
`user@café.example.com` translates to
`user@xn--caf-dma.example.com` in punycode, rendering it mostly unreadable, but 7-bit friendly, and remaining compatible with email clients that don't know about IDN.
The one remaining part of email that could not handle UTF-8 is the local part of email addresses (the part before the `@`).
I've only mentioned UTF-8 here, but most of these approaches also allowed other character sets that were popular, such as [the ISO-8859 family](https://en.wikipedia.org/wiki/ISO/IEC_8859). However, UTF-8 solves so many problems that these other character sets are gradually falling out of favour, as UTF-8 can support all languages.
This patchwork of overlapping approaches has served us well, but we have to admit that it's a mess.
## SMTPUTF8
`SMTPUTF8` is another SMTP extension, defined in [RFC 6531](https://www.rfc-editor.org/rfc/rfc6531) in 2012. This essentially solves the whole problem, allowing the entire SMTP conversation — commands, headers, and message bodies — to be sent in raw, unencoded UTF-8.
But there's a problem with this approach: adoption. If you send a UTF-8 message to a recipient whose mail server doesn't support this format, the sender has to somehow downgrade the message to make it survive a transition to 7-bit. This is a hard problem to solve, especially since there is no way to make a 7-bit system support UTF-8 in the local parts of addresses. This downgrade problem is what held up the adoption of `SMTPUTF8` in PHPMailer for many years, but in that time the *de facto* approach has become to simply fail in that situation, and tell the recipient it's time they upgraded their mail server 😅.
The vast majority of large email providers (gmail, Yahoo, Microsoft, etc), mail servers (postfix, exim, IIS, etc), and mail clients (Apple Mail, Outlook, Thunderbird, etc) now all support SMTPUTF8, so the need for backward compatibility is no longer what it was.
## SMTPUTF8 in PHPMailer
Several other PHP email libraries have implemented a halfway solution to `SMTPUTF8`, adding only the ability to support UTF-8 in email addresses, not elsewhere in the protocol. I wanted PHPMailer to do it "the right way", and this has taken much longer. PHPMailer now supports UTF-8 everywhere, and does not need to use transfer or header encodings for UTF-8 text when connecting to an `SMTPUTF8`-capable mail server.
This support is handled automatically: if you add an email address that requires UTF-8, PHPMailer will use UTF-8 for everything. If not, it will fall back to 7-bit and encode the message as necessary.
The one place you will need to be careful is in the selection of the address validator. By default, PHPMailer uses PHP's built-in `filter_var` validator, which does not allow UTF-8 email addresses. When PHPMailer spots that you have submitted a UTF-8 address, but have not altered the default validator, it will automatically switch to using a UTF-8-compatible validator. As soon as you do this, any SMTP connection you make will *require* that the server you connect to supports `SMTPUTF8`. You can select this validator explicitly by setting `PHPMailer::$validator = 'eai'` (an acronym for Email Address Internationalization).
### Postfix gotcha
Postfix has supported `SMTPUTF8` for a long time, but it has a peculiarity that it does not always advertise that it does so. However, rather surprisingly, if you use UTF-8 in the conversation, it will work anyway.

125
UPGRADING.md Normal file
View File

@ -0,0 +1,125 @@
# Upgrading from PHPMailer 5.2 to 6.0
PHPMailer 6.0 is a major update, breaking backward compatibility.
If you're in doubt about how you should be using PHPMailer 6, take a look at the examples as they have all been updated to work in a PHPMailer 6.0 style.
## PHP Version
PHPMailer 6.0 requires PHP 5.5 or later, and is fully compatible with PHP versions all the way up to 8.4. PHPMailer 5.2 supported PHP 5.0 and upwards, so if you need to run on a legacy PHP version, see the [PHPMailer 5.2-stable branch on Github](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable), but bear in mind that this branch is no longer maintained.
## Loading PHPMailer
The single biggest change will be in the way that you load PHPMailer. In earlier versions you may have done this:
```php
require 'PHPMailerAutoload.php';
```
or
```php
require 'class.phpmailer.php';
require 'class.smtp.php';
```
We recommend that you load PHPMailer via composer, using its standard autoloader, which you probably won't need to load if you're using it already, but in case you're not, you will need to do this instead:
```php
require 'vendor/autoload.php';
```
If you're not using composer, you can still load the classes manually, depending on what you're using:
```php
require 'src/PHPMailer.php';
require 'src/SMTP.php';
require 'src/Exception.php';
```
## Namespace
PHPMailer 6 uses a [namespace](https://www.php.net/manual/en/language.namespaces.rationale.php) of `PHPMailer\PHPMailer`, because it's the PHPMailer project within the PHPMailer organisation. You **must** import (with a `use` statement) classes you're using explicitly into your own namespace, or reference them absolutely in the global namespace - all the examples do this. This means the fully-qualified name of the main PHPMailer class is `PHPMailer\PHPMailer\PHPMailer`, which is a bit of a mouthful, but there's no harm in it! If you are using other PHPMailer classes explicitly (such as `SMTP` or `Exception`), you will need to import them into your namespace too.
For example you might create an instance like this:
```php
<?php
namespace MyProject;
use PHPMailer\PHPMailer\PHPMailer;
require 'vendor/autoload.php';
$mail = new PHPMailer;
...
```
or alternatively, using a fully qualified name:
```php
<?php
namespace MyProject;
require 'vendor/autoload.php';
$mail = new PHPMailer\PHPMailer\PHPMailer;
...
```
Note that `use` statements apply *only* to the file they appear in (they are local aliases), so if an included file contains `use` statements, it will not import the namespaced classes into the file you're including from.
## Namespaced exceptions
PHPMailer now uses its own namespaced `Exception` class, so if you were previously catching exceptions of type `phpmailerException` (or subclasses of that), you will need to update them to use the PHPMailer namespace, and make any existing `Exception` references use the global namespace, i.e. `\Exception`. If your original code was:
```php
try {
...
} catch (phpmailerException $e) {
echo $e->errorMessage();
} catch (Exception $e) {
echo $e->getMessage();
}
```
Convert it to:
```php
use PHPMailer\PHPMailer\Exception;
...
try {
...
} catch (Exception $e) {
echo $e->errorMessage();
} catch (\Exception $e) {
echo $e->getMessage();
}
```
## OAuth2 Support
The OAuth2 implementation has been completely redesigned using the [OAuth2 packages](https://oauth2-client.thephpleague.com) from the [League of extraordinary packages](https://thephpleague.com), providing support for many more OAuth services, and you'll need to update your code if you were using OAuth in 5.2. See [the examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) and documentation in the [PHPMailer wiki](https://github.com/PHPMailer/PHPMailer/wiki).
## Extras
Additional classes previously bundled in the `Extras` folder (such as htmlfilter and EasyPeasyICS) have been removed - use equivalent packages from [packagist.org](https://packagist.org) instead.
## Other upgrade changes
See the changelog for full details.
* File structure simplified, classes live in the `src/` folder
* Most statically called functions now use the `static` keyword instead of `self`, so it's possible to override static internal functions in subclasses, for example `validateAddress()`
* Complete RFC standardisation on CRLF (`\r\n`) line breaks by default:
* `PHPMailer::$LE` still exists, but all uses of it are changed to `static::$LE` for easier overriding. It may be changed to `\n` automatically when sending via `mail()` on UNIX-like OSs
* `PHPMailer::CRLF` line ending constant removed
* The length of the line break is no longer used in line length calculations
* Similar changes to line break handling in SMTP and POP3 classes
* All elements previously marked as deprecated have been removed:
* `PHPMailer->Version`
* `PHPMailer->ReturnPath`
* `PHPMailer->PluginDir`
* `PHPMailer->encodeQPphp()`
* `SMTP->CRLF`
* `SMTP->Version`
* `SMTP->SMTP_PORT`
* `POP3->CRLF`
* `POP3->Version`
* NTLM authentication has been removed - it never worked anyway!
* `PHPMailer->Workstation`
* `PHPMailer->Realm`
* `SMTP::authenticate` method signature changed
* `parseAddresses()` is now static
* `validateAddress()` is now called statically from `parseAddresses()`
* `idnSupported()` is now static and is called statically from `punyencodeAddress()`
* `PHPMailer->SingleToArray` is now protected

View File

@ -1 +1 @@
5.2.25
7.0.2

View File

@ -1,14 +1,436 @@
# ChangeLog
# PHPMailer Change Log
## Version 5.2.25 (August 2th 2917)
## Version 7.0.2 (January 9th, 2026)
* Fixes for sendmail parameter problems in WordPress, thanks to @SirLouen
* Reduce memory consumption when sending large attachments by @RobinvanderVliet
## Version 7.0.1 (November 25th, 2025)
* Use From domain when generating CIDs in msgHTML.
* Update to PHPCompatibility 10, resolve numerous PHPCS issues in PHP 8.5.
* Revise GitHub actions for PHP 8.5 and experimental 8.6 tests.
* Switch gmail example from the deprecated IMAP extension to use `directorytree/imapengine` for IMAP uploads.
* Set `htmlspecialchars()` flags explicitly and consistently.
* Convert XOAUTH2 token exceptions into PHPMailer Exceptions. The original exception is available as an inner exception.
* Deprecate VERSION constants in POP3 and SMTP classes.
* Remove dependency on `roave/security-advisories`; it's now built into composer 2.9.
* Update Dutch, Esperanto, and Norwegian translations.
## Version 7.0.0 (October 15th, 2025)
This is exactly the same as 6.11.1 but bumps the major version number to indicate the presence of a BC break in child classes. Specifically, `lang()`, `setLanguage()`, and `$language` are now static, and should be called statically.
## Version 6.12.0 (October 15th, 2025)
This is exactly the same as 6.10.0, reverting all the changes in 6.11.0 and 6.11.1, which inadvertently introduced a BC break affecting child classes. 6.11.1 has been re-released as 7.0.0.
## Version 6.11.1 (September 30th, 2025)
* Avoid function signature problems with the deprecation of `$useimap` in `parseAddresses`.
## Version 6.11.0 (September 29th, 2025)
* Add support for [RFC4954](https://www.rfc-editor.org/rfc/rfc4954#section-4) two-part authentication for large XOAUTH2 tokens.
* Also support empty tokens.
* Avoid bogus static analyser deprecation warnings in `setFrom`.
* Make language loading entirely static, thanks to @SirLouen.
* Emit warnings when `parseAddresses()` is used without the IMAP extension.
* Handle `mb_decode_mimeheader` changes from PHP 8.3+.
* Deprecate the charset param to parseAddresses.
* Fix PHP 8.5 linting issue.
* Don't use `-t` switch when calling qmail.
* Checking for interrupted system calls now works in languages other than English.
* Add support for extracting gmail transaction IDs after sending.
* For consistency, the protected `ReplyTo` property has been changed to match the format used for other address arrays.
* Fix line length issues when using S/MIME signing.
* Pin action runners to exact versions to avoid unexpected upstream changes.
## Version 6.10.0 (April 24th, 2025)
* Add support for [RFC 6530 SMTPUTF8](https://www.rfc-editor.org/rfc/rfc6530), permitting use of UTF-8 Unicode characters everywhere, thanks to @arnt and ICANN. See `SMTPUTF8.md` for details.
* More reliable checking for multibyte support.
## Version 6.9.3 (November 22nd, 2024)
* Add support for the release version of PHP 8.4
* Add experimental support for PHP 8.5
* Use rfc-editor.org for all RFC docs links
## Version 6.9.2 (October 9th, 2024)
* Escape dots in SMTP transaction ID patterns
* Add link to [aboutmy.email](https://aboutmy.email) testing service in docs
* Add a more comprehensive example for using XOAUTH2 with gmail and Azure, thanks to @decomplexity
* Update Turkish, Spanish, Japanese, Russian, French translations
* Add Urdu & Kurdish (Sorani) translations
* Fix broken links in docs and comments, avoid http links, correct link to LGPL 2.1 license file
* Cleaner PSR-3 SMTP debug logging
* Bump GitHub action versions
* Fix error handler scope issue in POP3 and SMTP classes
* Numerous test improvements by @jrfnl
## Version 6.9.1 (November 25th, 2023)
* Finalise SendOauth2 example
## Version 6.9.0 (November 23rd, 2023)
* Add support for official release of PHP 8.3, add experimental support for PHP 8.4
* Add `clearCustomHeader` and `replaceCustomHeader` methods
* Add support for the XCLIENT SMTP extension with `setSMTPXclientAttribute` and `getSMTPXclientAttributes` methods
* Don't attempt opportunistic TLS when connecting to localhost
* Add package link and example showing how to use @decomplexity's SendOauth2 wrapper
* Update example to show a better way of using an SMTP subclass
* Avoid some more deprecation warnings
* Update Danish and Polish translations
* Add Bengali and Assamese translations
## Version 6.8.1 (August 29th, 2023)
* Don't reflect malformed DSNs in error messages to avert any risk of XSS
* Improve Simplified Chinese, Sinhalese, and Norwegian translations
* Don't use `setAccessible` in PHP >= 8.1 in tests
* Avoid a deprecation notice in PHP 8.3
* Fix link in readme
## Version 6.8.0 (March 6th, 2023)
* Add DSN parsing class, thanks to @voronkovich
* Fix some name edge cases, expand tests
* Add pattern for ZonMTA message IDs
* Improve Hindi translation
## Version 6.7.1 (December 8th, 2022)
* Add official support for PHP 8.2
* Add PHP 8.3 to test suite with "experimental" status
* Add ext-openssl to composer suggest list
* Bump development dependencies
## Version 6.7 (December 5th, 2022)
* Break out boundary definitions into a method (note that boundary format has also changed slightly)
* Remove MIME preamble to match popular client behaviour, may help with DKIM too
* Fix handling of trailing whitespace in simple DKIM canonicalisation
* Fix some possible POP3 auth issues, including a TCP hang (thanks to @czirkoszoltan)
* Add Azure XOAUTH2 example and docs (thanks to @greew)
* Preserve errors during disconnect
* Avoid some PHP 8.1 type issues
* Update CI to run on Ubuntu 22.04
## Version 6.6.5 (October 7th, 2022)
* Don't try to issue RSET if there has been a connection error
* Reject attempts to add folders as attachments
* Don't suppress earlier error messages on close()
* Handle Host === null better
* Update Danish and Polish translations
* Change recommendation for Microsoft OAuth package to thenetworg/oauth2-azure
* Bump some GitHub action versions
## Version 6.6.4 (August 22nd, 2022)
* Update Greek translation
* Add text/csv MIME type
* Fix DKIM when sending to anonymous group via mail()
* Improve docs around auth following gmail & MS deprecations
* Update GitHub action deps
* Add OpenSSF Scorecard security health metrics
## Version 6.6.3 (June 20th, 2022)
* Add an HTML form to the OAuth setup script
* Minor CS improvements
* Add Mongolian translation
* Remove bogus "ch" translation
## Version 6.6.2 (June 14th, 2022)
* Fix docs deployment GitHub action
* Updates to parallel-lint and console highlighter, thanks to @jrfnl
## Version 6.6.1 (June 14th, 2022) (unreleased)
* Don't clear errors on RSET, so they can still be obtained when using keepalive
* Bump some GitHub action versions
* Fix some tests
* 🇺🇦 Slava Ukraini!
## Version 6.6 (February 28th, 2022)
* Introduce interface for OAuth providers, making it easier to use OAuth libraries other than the League one, thanks to @pdscopes.
* Add more contextual information to TLS connection failure error messages, and throw exceptions on TLS connection errors, thanks to @miken32
## Version 6.5.4 (February 17th, 2022)
* If we can't use escaping functions, refuse to do unsafe things
* Avoid PHP 8.1 trim issue
* Add tests for XMailer
* Fix bug in use of CharSet property
* Fix bug in file upload example
* Update dev dependencies
## Version 6.5.3 (November 25th, 2021)
* Wrong commit tagged for the 6.5.2 release!
* Version file updated
## Version 6.5.2 (November 25th, 2021)
* Enable official support for PHP 8.1
* Enable experimental support for PHP 8.2
* Fix for PHP 5.6
* Fix for incorrect options for punyencoding IDNs
## Version 6.5.1 (August 18th, 2021)
* Provisional support for PHP 8.1
* Major overhaul of test suite
* Add codecov.io coverage reporting
* Prefer implicit TLS on port 465 as default encryption scheme in examples, as per RFC8314
* Fix potential noisy output from IMAP address parser
* Stricter checking of custom MessageID validity
* Replace invalid default From address
* Support fallback for languages, so a request for `pt_xx` will fall back to `pt` rather than the default `en`.
* Support multi-line RFC2047 addresses in parseAddresses
* Improved Japanese translation
Many thanks to @jrfnl for all her work.
## Version 6.5.0 (June 16th, 2021)
* **SECURITY** Fixes CVE-2021-34551, a complex RCE affecting Windows hosts. See [SECURITY.md](SECURITY.md) for details.
* The fix for this issue changes the way that language files are loaded. While they remain in the same PHP-like format, they are processed as plain text, and any code in them will not be run, including operations such as concatenation using the `.` operator.
* *Deprecation* The current translation file format using PHP arrays is now deprecated; the next major version will introduce a new format.
* **SECURITY** Fixes CVE-2021-3603 that may permit untrusted code to be run from an address validator. See [SECURITY.md](SECURITY.md) for details.
* The fix for this issue includes a minor BC break: callables injected into `validateAddress`, or indirectly through the `$validator` class property, may no longer be simple strings. If you want to inject your own validator, provide a closure instead of a function name.
* Haraka message ID strings are now recognised
## Version 6.4.1 (April 29th, 2021)
* **SECURITY** Fixes CVE-2020-36326, a regression of CVE-2018-19296 object injection introduced in 6.1.8, see SECURITY.md for details
* Reject more file paths that look like URLs, matching RFC3986 spec, blocking URLS using schemes such as `ssh2`
* Ensure method signature consistency in `doCallback` calls
* Ukrainian language update
* Add composer scripts for checking coding standards and running tests
## Version 6.4.0 (March 31st, 2021)
* Revert change that made the `mail()` and sendmail transports set the envelope sender if one isn't explicitly provided, as it causes problems described in <https://github.com/PHPMailer/PHPMailer/issues/2298>
* Check for mbstring extension before decoding addresss in `parseAddress`
* Add Serbian Latin translation (`sr_latn`)
* Enrol PHPMailer in Tidelift
## Version 6.3.0 (February 19th, 2021)
* Handle early connection errors such as 421 during connection and EHLO states
* Switch to GitHub Actions for CI
* Generate debug output for `mail()`, sendmail, and qmail transports. Enable using the same mechanism as for SMTP: set `SMTPDebug` > 0
* Make the `mail()` and sendmail transports set the envelope sender the same way as SMTP does, i.e. use whatever `From` is set to, only falling back to the `sendmail_from` php.ini setting if `From` is unset. This avoids errors from the `mail()` function if `Sender` is not set explicitly and php.ini is not configured. This is a minor functionality change, so bumps the minor version number.
* Extend `parseAddresses` to decode encoded names, improve tests
## Version 6.2.0
* PHP 8.0 compatibility, many thanks to @jrf_nl!
* Switch from PHP CS Fixer to PHP CodeSniffer for coding standards
* Create class constants for the debug levels in the POP3 class
* Improve French, Slovenian, and Ukrainian translations
* Improve file upload examples so file extensions are retained
* Resolve PHP 8 line break issues due to a very old PHP bug being fixed
* Avoid warnings when using old openssl functions
* Improve Travis-CI build configuration
## Version 6.1.8 (October 9th, 2020)
* Mark `ext-hash` as required in composer.json. This has long been required, but now it will cause an error at install time rather than runtime, making it easier to diagnose
* Make file upload examples safer
* Update links to SMTP testing servers
* Avoid errors when set_time_limit is disabled (you need better hosting!)
* Allow overriding auth settings for local tests; makes it easy to run tests using HELO
* Recover gracefully from errors during keepalive sessions
* Add AVIF MIME type mapping
* Prevent duplicate `To` headers in BCC-only messages when using `mail()`
* Avoid file function problems when attaching files from Windows UNC paths
* Improve German, Bahasa Indonesian, Filipino translations
* Add Javascript-based example
* Increased test coverage
## Version 6.1.7 (July 14th, 2020)
* Split SMTP connection into two separate methods
* Undo BC break in PHP versions 5.2.3 - 7.0.0 introduced in 6.1.2 when injecting callables for address validation and HTML to text conversion
* Save response to SMTP welcome banner as other responses are saved
* Retry stream_select if interrupted by a signal
## Version 6.1.6 (May 27th, 2020)
* **SECURITY** Fix insufficient output escaping bug in file attachment names. CVE-2020-13625. Reported by Elar Lang of Clarified Security.
* Correct Armenian ISO language code from `am` to `hy`, add mapping for fallback
* Use correct timeout property in debug output
## Version 6.1.5 (March 14th, 2020)
* Reject invalid custom headers that are empty or contain breaks
* Various fixes for DKIM issues, especially when using `mail()` transport
* Drop the `l=` length tag from DKIM signatures; it's a mild security risk
* Ensure CRLF is used explicitly when needed, rather than `static::$LE`
* Add a method for trimming header content consistently
* Some minor tweaks to resolve static analyser complaints
* Check that attachment files are readable both when adding *and* when sending
* Work around Outlook bug in mishandling MIME preamble
* Danish translation improvements
## Version 6.1.4 (December 10th, 2019)
* Clean up hostname handling
* Avoid IDN error on older PHP versions, prep for PHP 8.0
* Don't force RFC2047 folding unnecessarily
* Enable tests on full release of PHP 7.4
## Version 6.1.3 (November 21st, 2019)
* Fix an issue preventing injected debug handlers from working
* Fix an issue relating to connection timeout
* Add `SMTP::MAX_REPLY_LENGTH` constant
* Remove some dev dependencies; phpdoc no longer included
* Fix an issue where non-compliant servers returning bare codes caused an SMTP hang
## Version 6.1.2 (November 13th, 2019)
* Substantial revision of DKIM header generation
* Use shorter hashes for auto-generated CID values
* Fix format of content-id headers, and only use them for inline attachments
* Remove all use of XHTML
* Lots of coding standards cleanup
* API docs are now auto-updated via GitHub actions
* Fix header separation bug created in 6.1.1
* Fix misidentification of background attributes in SVG images in msgHTML
## Version 6.1.1 (September 27th 2019)
* Fix misordered version tag
## Version 6.1.0 (September 27th 2019)
* Multiple bug fixes for folding of long header lines, thanks to @caugner
* Add support for [RFC2387 child element content-type hint](https://www.rfc-editor.org/rfc/rfc2387#section-3.1) in `multipart/related` structures.
* Support for Ical event methods other than `REQUEST`, thanks to @puhr-mde
* Change header folding and param separation to use spaces instead of tabs
* Use ; to separate multiple MIME header params
* Add support for RFC3461 DSN messages
* IMAP example code fixed
* Use PHP temp streams instead of temp files
* Allow for longer SMTP error codes
* Updated Brazilian Portuguese translation
* Throw exceptions on invalid encoding values
* Add Afrikaans translation, thanks to @Donno191
* Updated Farsi/Persian translation
* Add PHP 7.4 to test config
* Remove some ambiguity about setting XMailer property
* Improve error checking in mailing list example
* Drop PHP 5.5 from CI config as it's no longer supported by Travis-CI
* Fix S/MIME signing
* Add constants for encryption type
* More consistent use of constants for encryption, charset, encoding
* Add PHPMailer logo images
## Version 6.0.7 (February 1st 2019)
* Include RedHat GPL Cooperation Commitment - see the `COMMITMENT` file for details.
* Don't exclude composer.json from git exports as it breaks composer updates in projects that use PHPMailer
* Updated Malay translation
* Fix language tests
## Version 6.0.6 (November 14th 2018)
* **SECURITY** Fix potential object injection vulnerability. Reported by Sehun Oh of cyberone.kr.
* Added Tagalog translation, thanks to @StoneArtz
* Added Malagache translation, thanks to @Hackinet
* Updated Serbian translation, fixed incorrect language code, thanks to @mmilanovic4
* Updated Arabic translations (@MicroDroid)
* Updated Hungarian translations
* Updated Dutch translations
* Updated Slovenian translation (@filips123)
* Updated Slovak translation (@pcmanik)
* Updated Italian translation (@sabas)
* Updated Norwegian translation (@aleskr)
* Updated Indonesian translation (@mylastof)
* Add constants for common values, such as `text/html` and `quoted-printable`, and use them
* Added support for copied headers in DKIM, helping with debugging, and an option to add extra headers to the DKIM signature. See DKIM_sign example for how to use them. Thanks to @gwi-mmuths.
* Add Campaign Monitor transaction ID pattern matcher
* Remove deprecated constant and ini values causing warnings in PHP 7.3, added PHP 7.3 build to Travis config.
* Expanded test coverage
## Version 5.2.27 (November 14th 2018)
* **SECURITY** Fix potential object injection vulnerability. Reported by Sehun Oh of cyberone.kr.
* Note that the 5.2 branch is now deprecated and will not receive security updates after 31st December 2018.
## Version 6.0.5 (March 27th 2018)
* Re-roll of 6.0.4 to fix missed version file entry. No code changes.
## Version 6.0.4 (March 27th 2018)
* Add some modern MIME types
* Add Hindi translation (thanks to @dextel2)
* Improve composer docs
* Fix generation of path to language files
## Version 6.0.3 (January 5th 2018)
* Correct DKIM canonicalization of line breaks for header & body - thanks to @themichaelhall
* Make dependence on ext-filter explicit in composer.json
## Version 6.0.2 (November 29th 2017)
* Don't make max line length depend on line break format
* Improve Travis-CI config - thanks to Filippo Tessarotto
* Match SendGrid transaction IDs
* `idnSupported()` now static, as previously documented
* Improve error messages for invalid addresses
* Improve Indonesian translation (thanks to @januridp)
* Improve Esperanto translation (thanks to @dknacht)
* Clean up git export ignore settings for production and zip bundles
* Update license doc
* Updated upgrading docs
* Clarify `addStringEmbeddedImage` docs
* Hide auth credentials in all but lowest-level debug output, prevents leakage in bug reports
* Code style cleanup
## Version 6.0.1 (September 14th 2017)
* Use shorter Message-ID headers (with more entropy) to avoid iCloud blackhole bug
* Switch to Symfony code style (though it's not well defined)
* CI builds now apply syntax & code style checks, so make your PRs tidy!
* CI code coverage only applied on latest version of PHP to speed up builds (thanks to @Slamdunk for these CI changes)
* Remove `composer.lock` - it's important that libraries break early; keeping it is for apps
* Rename test scripts to PSR-4 spec
* Make content-id values settable on attachments, not just embedded items
* Add SMTP transaction IDs to callbacks & allow for future expansion
* Expand test coverage
## Version 6.0 (August 28th 2017)
This is a major update that breaks backwards compatibility.
* **Requires PHP 5.5 or later**
* **Uses the `PHPMailer\PHPMailer` namespace**
* File structure simplified and PSR-4 compatible, classes live in the `src/` folder
* The custom autoloader has been removed: [**use composer**](https://getcomposer.org)!
* Classes & Exceptions renamed to make use of the namespace
* Most statically called functions now use the `static` keyword instead of `self`, so it's possible to override static internal functions in subclasses, for example `validateAddress()`
* Complete RFC standardisation on CRLF (`\r\n`) line breaks for SMTP by default:
* `PHPMailer:$LE` defaults to CRLF
* All uses of `PHPMailer::$LE` property converted to use `static::$LE` constant for consistency and ease of overriding
* Similar changes to line break handling in SMTP and POP3 classes.
* Line break format for `mail()` transport is set automatically.
* Warnings emitted for buggy `mail()` in PHP versions 7.0.0 - 7.0.16 and 7.1.0 - 7.1.2; either upgrade or switch to SMTP.
* Extensive reworking of XOAUTH2, adding support for Google, Yahoo and Microsoft providers, thanks to @sherryl4george
* Major cleanup of docs and examples
* All elements previously marked as deprecated have been removed:
* `PHPMailer->Version` (replaced with `VERSION` constant)
* `PHPMailer->ReturnPath`
* `PHPMailer->PluginDir`
* `PHPMailer->encodeQPphp()`
* `SMTP->CRLF` (replaced with `LE` constant)
* `SMTP->Version` (replaced with `VERSION` constant)
* `SMTP->SMTP_PORT` (replaced with `DEFAULT_PORT` constant)
* `POP3->CRLF` (replaced with `LE` constant)
* `POP3->Version` (replaced with `VERSION` constant)
* `POP3->POP3_PORT` (replaced with `DEFAULT_PORT` constant)
* `POP3->POP3_TIMEOUT` (replaced with `DEFAULT_TIMEOUT` constant)
* NTLM authentication has been removed - it never worked anyway!
* `PHPMailer->Workstation`
* `PHPMailer->Realm`
* `SingleTo` functionality is deprecated; this belongs at a higher level - PHPMailer is not a mailing list system.
* `SMTP::authenticate` method signature changed
* `parseAddresses()` is now static
* `validateAddress()` is now called statically from `parseAddresses()`
* `idnSupported()` is now static and is called statically from `punyencodeAddress()`
* `PHPMailer->SingleToArray` is now protected
* `fixEOL()` method removed - it duplicates `PHPMailer::normalizeBreaks()`, so use that instead
* Don't try to use an auth mechanism if it's not supported by the server
* Reorder automatic AUTH mechanism selector to try most secure method first
* `Extras` classes have been removed - use alternative packages from [packagist.org](https://packagist.org) instead
* Better handling of automatic transfer encoding switch in the presence of long lines
* Simplification of address validation - now uses PHP's `FILTER_VALIDATE_EMAIL` pattern by default, retains advanced options
* `Debugoutput` can accept a PSR-3 logger instance
* To reduce code footprint, the examples folder is no longer included in composer deployments or GitHub zip files
* Trap low-level errors in SMTP, reports via debug output
* More reliable folding of message headers
* Inject your own SMTP implementation via `setSMTPInstance()` instead of having to subclass and override `getSMTPInstance()`.
* Make obtaining SMTP transaction ID more reliable
* Better handling of unreliable PHP timeouts
* Made `SMTPDebug = 4` slightly less noisy
## Version 5.2.25 (August 28th 2017)
* Make obtaining SMTP transaction ID more reliable
* Add Bosnian translation
* This is the last official release in the legacy PHPMailer 5.2 series; there may be future security patches (which will be found in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable)), but no further non-security PRs or issues will be accepted. Migrate to PHPMailer 6.0.
## Version 5.2.24 (July 26th 2017)
* **SECURITY** Fix XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
* **SECURITY** Fix XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it is not normally executable unless it is explicitly renamed, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
* Handle bare codes (an RFC contravention) in SMTP server responses
* Make message timestamps more dynamic - calculate the date separately for each message
* More thorough checks for reading attachments.
* Throw an exception when trying to send a message with an empty body caused by an internal error.
* Replaced all use of MD5 and SHA1 hash functions with SHA256.
* Now checks for invalid host strings when sending via SMTP.
* Include timestamps in HTML-format debug output
* Improve Turkish, Norwegian, Serbian, Brazilian Portuguese & simplified Chinese translations
* Correction of Serbian ISO language code from `sr` to `rs`
@ -431,10 +853,10 @@ All new documentation
* 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
@ -519,7 +941,7 @@ NOTE: will NOT work with PHP5 in E_STRICT error mode
## 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
* Fixed alt attachments bug: https://sourceforge.net/p/phpmailer/bugs/120/
## Version 1.72 (Wed, May 25 2004)
* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations.
@ -636,7 +1058,7 @@ NOTE: will NOT work with PHP5 in E_STRICT error mode
## 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)
(See PHP bug report: https://bugs.php.net/bug.php?id=11616
* mail() no longer passes a fifth parameter when not needed
## Version 1.15 (Fri, Jun 15 2001)

File diff suppressed because it is too large Load Diff

View File

@ -1,197 +0,0 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.4
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailerOAuth - PHPMailer subclass adding OAuth support.
* @package PHPMailer
* @author @sherryl4george
* @author Marcus Bointon (@Synchro) <phpmailer@synchromedia.co.uk>
*/
class PHPMailerOAuth extends PHPMailer
{
/**
* The OAuth user's email address
* @var string
*/
public $oauthUserEmail = '';
/**
* The OAuth refresh token
* @var string
*/
public $oauthRefreshToken = '';
/**
* The OAuth client ID
* @var string
*/
public $oauthClientId = '';
/**
* The OAuth client secret
* @var string
*/
public $oauthClientSecret = '';
/**
* An instance of the PHPMailerOAuthGoogle class.
* @var PHPMailerOAuthGoogle
* @access protected
*/
protected $oauth = null;
/**
* Get a PHPMailerOAuthGoogle instance to use.
* @return PHPMailerOAuthGoogle
*/
public function getOAUTHInstance()
{
if (!is_object($this->oauth)) {
$this->oauth = new PHPMailerOAuthGoogle(
$this->oauthUserEmail,
$this->oauthClientSecret,
$this->oauthClientId,
$this->oauthRefreshToken
);
}
return $this->oauth;
}
/**
* Initiate a connection to an SMTP server.
* Overrides the original smtpConnect method to add support for OAuth.
* @param array $options An array of options compatible with stream_context_create()
* @uses SMTP
* @access public
* @return bool
* @throws phpmailerException
*/
public function smtpConnect($options = array())
{
if (is_null($this->smtp)) {
$this->smtp = $this->getSMTPInstance();
}
if (is_null($this->oauth)) {
$this->oauth = $this->getOAUTHInstance();
}
// Already connected?
if ($this->smtp->connected()) {
return true;
}
$this->smtp->setTimeout($this->Timeout);
$this->smtp->setDebugLevel($this->SMTPDebug);
$this->smtp->setDebugOutput($this->Debugoutput);
$this->smtp->setVerp($this->do_verp);
$hosts = explode(';', $this->Host);
$lastexception = null;
foreach ($hosts as $hostentry) {
$hostinfo = array();
if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) {
// Not a valid host entry
continue;
}
// $hostinfo[2]: optional ssl or tls prefix
// $hostinfo[3]: the hostname
// $hostinfo[4]: optional port number
// The host string prefix can temporarily override the current setting for SMTPSecure
// If it's not specified, the default value is used
$prefix = '';
$secure = $this->SMTPSecure;
$tls = ($this->SMTPSecure == 'tls');
if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
$prefix = 'ssl://';
$tls = false; // Can't have SSL and TLS at the same time
$secure = 'ssl';
} elseif ($hostinfo[2] == 'tls') {
$tls = true;
// tls doesn't use a prefix
$secure = 'tls';
}
//Do we need the OpenSSL extension?
$sslext = defined('OPENSSL_ALGO_SHA1');
if ('tls' === $secure or 'ssl' === $secure) {
//Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
if (!$sslext) {
throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL);
}
}
$host = $hostinfo[3];
$port = $this->Port;
$tport = (integer)$hostinfo[4];
if ($tport > 0 and $tport < 65536) {
$port = $tport;
}
if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
try {
if ($this->Helo) {
$hello = $this->Helo;
} else {
$hello = $this->serverHostname();
}
$this->smtp->hello($hello);
//Automatically enable TLS encryption if:
// * it's not disabled
// * we have openssl extension
// * we are not already using SSL
// * the server offers STARTTLS
if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) {
$tls = true;
}
if ($tls) {
if (!$this->smtp->startTLS()) {
throw new phpmailerException($this->lang('connect_host'));
}
// We must resend HELO after tls negotiation
$this->smtp->hello($hello);
}
if ($this->SMTPAuth) {
if (!$this->smtp->authenticate(
$this->Username,
$this->Password,
$this->AuthType,
$this->Realm,
$this->Workstation,
$this->oauth
)
) {
throw new phpmailerException($this->lang('authenticate'));
}
}
return true;
} catch (phpmailerException $exc) {
$lastexception = $exc;
$this->edebug($exc->getMessage());
// We must have connected, but then failed TLS or Auth, so close connection nicely
$this->smtp->quit();
}
}
}
// If we get here, all connection attempts have failed, so close connection hard
$this->smtp->close();
// As we've caught all exceptions, just report whatever the last one was
if ($this->exceptions and !is_null($lastexception)) {
throw $lastexception;
}
return false;
}
}

View File

@ -1,77 +0,0 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.4
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailerOAuthGoogle - Wrapper for League OAuth2 Google provider.
* @package PHPMailer
* @author @sherryl4george
* @author Marcus Bointon (@Synchro) <phpmailer@synchromedia.co.uk>
* @link https://github.com/thephpleague/oauth2-client
*/
class PHPMailerOAuthGoogle
{
private $oauthUserEmail = '';
private $oauthRefreshToken = '';
private $oauthClientId = '';
private $oauthClientSecret = '';
/**
* @param string $UserEmail
* @param string $ClientSecret
* @param string $ClientId
* @param string $RefreshToken
*/
public function __construct(
$UserEmail,
$ClientSecret,
$ClientId,
$RefreshToken
) {
$this->oauthClientId = $ClientId;
$this->oauthClientSecret = $ClientSecret;
$this->oauthRefreshToken = $RefreshToken;
$this->oauthUserEmail = $UserEmail;
}
private function getProvider()
{
return new League\OAuth2\Client\Provider\Google([
'clientId' => $this->oauthClientId,
'clientSecret' => $this->oauthClientSecret
]);
}
private function getGrant()
{
return new \League\OAuth2\Client\Grant\RefreshToken();
}
private function getToken()
{
$provider = $this->getProvider();
$grant = $this->getGrant();
return $provider->getAccessToken($grant, ['refresh_token' => $this->oauthRefreshToken]);
}
public function getOauth64()
{
$token = $this->getToken();
return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001");
}
}

View File

@ -1,407 +0,0 @@
<?php
/**
* PHPMailer POP-Before-SMTP Authentication Class.
* PHP Version 5
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailer POP-Before-SMTP Authentication Class.
* Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
* Does not support APOP.
* @package PHPMailer
* @author Richard Davey (original author) <rich@corephp.co.uk>
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
*/
class POP3
{
/**
* The POP3 PHPMailer Version number.
* @var string
* @access public
*/
public $Version = '5.2.25';
/**
* Default POP3 port number.
* @var integer
* @access public
*/
public $POP3_PORT = 110;
/**
* Default timeout in seconds.
* @var integer
* @access public
*/
public $POP3_TIMEOUT = 30;
/**
* POP3 Carriage Return + Line Feed.
* @var string
* @access public
* @deprecated Use the constant instead
*/
public $CRLF = "\r\n";
/**
* Debug display level.
* Options: 0 = no, 1+ = yes
* @var integer
* @access public
*/
public $do_debug = 0;
/**
* POP3 mail server hostname.
* @var string
* @access public
*/
public $host;
/**
* POP3 port number.
* @var integer
* @access public
*/
public $port;
/**
* POP3 Timeout Value in seconds.
* @var integer
* @access public
*/
public $tval;
/**
* POP3 username
* @var string
* @access public
*/
public $username;
/**
* POP3 password.
* @var string
* @access public
*/
public $password;
/**
* Resource handle for the POP3 connection socket.
* @var resource
* @access protected
*/
protected $pop_conn;
/**
* Are we connected?
* @var boolean
* @access protected
*/
protected $connected = false;
/**
* Error container.
* @var array
* @access protected
*/
protected $errors = array();
/**
* Line break constant
*/
const CRLF = "\r\n";
/**
* Simple static wrapper for all-in-one POP before SMTP
* @param $host
* @param integer|boolean $port The port number to connect to
* @param integer|boolean $timeout The timeout value
* @param string $username
* @param string $password
* @param integer $debug_level
* @return boolean
*/
public static function popBeforeSmtp(
$host,
$port = false,
$timeout = false,
$username = '',
$password = '',
$debug_level = 0
) {
$pop = new POP3;
return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
}
/**
* Authenticate with a POP3 server.
* A connect, login, disconnect sequence
* appropriate for POP-before SMTP authorisation.
* @access public
* @param string $host The hostname to connect to
* @param integer|boolean $port The port number to connect to
* @param integer|boolean $timeout The timeout value
* @param string $username
* @param string $password
* @param integer $debug_level
* @return boolean
*/
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
{
$this->host = $host;
// If no port value provided, use default
if (false === $port) {
$this->port = $this->POP3_PORT;
} else {
$this->port = (integer)$port;
}
// If no timeout value provided, use default
if (false === $timeout) {
$this->tval = $this->POP3_TIMEOUT;
} else {
$this->tval = (integer)$timeout;
}
$this->do_debug = $debug_level;
$this->username = $username;
$this->password = $password;
// Reset the error log
$this->errors = array();
// connect
$result = $this->connect($this->host, $this->port, $this->tval);
if ($result) {
$login_result = $this->login($this->username, $this->password);
if ($login_result) {
$this->disconnect();
return true;
}
}
// We need to disconnect regardless of whether the login succeeded
$this->disconnect();
return false;
}
/**
* Connect to a POP3 server.
* @access public
* @param string $host
* @param integer|boolean $port
* @param integer $tval
* @return boolean
*/
public function connect($host, $port = false, $tval = 30)
{
// Are we already connected?
if ($this->connected) {
return true;
}
//On Windows this will raise a PHP Warning error if the hostname doesn't exist.
//Rather than suppress it with @fsockopen, capture it cleanly instead
set_error_handler(array($this, 'catchWarning'));
if (false === $port) {
$port = $this->POP3_PORT;
}
// connect to the POP3 server
$this->pop_conn = fsockopen(
$host, // POP3 Host
$port, // Port #
$errno, // Error Number
$errstr, // Error Message
$tval
); // Timeout (seconds)
// Restore the error handler
restore_error_handler();
// Did we connect?
if (false === $this->pop_conn) {
// It would appear not...
$this->setError(array(
'error' => "Failed to connect to server $host on port $port",
'errno' => $errno,
'errstr' => $errstr
));
return false;
}
// Increase the stream time-out
stream_set_timeout($this->pop_conn, $tval, 0);
// Get the POP3 server response
$pop3_response = $this->getResponse();
// Check for the +OK
if ($this->checkResponse($pop3_response)) {
// The connection is established and the POP3 server is talking
$this->connected = true;
return true;
}
return false;
}
/**
* Log in to the POP3 server.
* Does not support APOP (RFC 2828, 4949).
* @access public
* @param string $username
* @param string $password
* @return boolean
*/
public function login($username = '', $password = '')
{
if (!$this->connected) {
$this->setError('Not connected to POP3 server');
}
if (empty($username)) {
$username = $this->username;
}
if (empty($password)) {
$password = $this->password;
}
// Send the Username
$this->sendString("USER $username" . self::CRLF);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
// Send the Password
$this->sendString("PASS $password" . self::CRLF);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
return true;
}
}
return false;
}
/**
* Disconnect from the POP3 server.
* @access public
*/
public function disconnect()
{
$this->sendString('QUIT');
//The QUIT command may cause the daemon to exit, which will kill our connection
//So ignore errors here
try {
@fclose($this->pop_conn);
} catch (Exception $e) {
//Do nothing
};
}
/**
* Get a response from the POP3 server.
* $size is the maximum number of bytes to retrieve
* @param integer $size
* @return string
* @access protected
*/
protected function getResponse($size = 128)
{
$response = fgets($this->pop_conn, $size);
if ($this->do_debug >= 1) {
echo "Server -> Client: $response";
}
return $response;
}
/**
* Send raw data to the POP3 server.
* @param string $string
* @return integer
* @access protected
*/
protected function sendString($string)
{
if ($this->pop_conn) {
if ($this->do_debug >= 2) { //Show client messages when debug >= 2
echo "Client -> Server: $string";
}
return fwrite($this->pop_conn, $string, strlen($string));
}
return 0;
}
/**
* Checks the POP3 server response.
* Looks for for +OK or -ERR.
* @param string $string
* @return boolean
* @access protected
*/
protected function checkResponse($string)
{
if (substr($string, 0, 3) !== '+OK') {
$this->setError(array(
'error' => "Server reported an error: $string",
'errno' => 0,
'errstr' => ''
));
return false;
} else {
return true;
}
}
/**
* Add an error to the internal error store.
* Also display debug output if it's enabled.
* @param $error
* @access protected
*/
protected function setError($error)
{
$this->errors[] = $error;
if ($this->do_debug >= 1) {
echo '<pre>';
foreach ($this->errors as $error) {
print_r($error);
}
echo '</pre>';
}
}
/**
* Get an array of error messages, if any.
* @return array
*/
public function getErrors()
{
return $this->errors;
}
/**
* POP3 connection error handler.
* @param integer $errno
* @param string $errstr
* @param string $errfile
* @param integer $errline
* @access protected
*/
protected function catchWarning($errno, $errstr, $errfile, $errline)
{
$this->setError(array(
'error' => "Connecting to the POP3 server raised a PHP warning: ",
'errno' => $errno,
'errstr' => $errstr,
'errfile' => $errfile,
'errline' => $errline
));
}
}

View File

@ -19,43 +19,66 @@
"name": "Brent R. Matzelle"
}
],
"funding": [
{
"url": "https://github.com/Synchro",
"type": "github"
}
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
},
"lock": false
},
"require": {
"php": ">=5.5.0",
"ext-ctype": "*",
"php": ">=5.0.0"
"ext-filter": "*",
"ext-hash": "*"
},
"require-dev": {
"doctrine/annotations": "1.2.*",
"jms/serializer": "0.16.*",
"phpdocumentor/phpdocumentor": "2.*",
"phpunit/phpunit": "4.8.*",
"symfony/debug": "2.8.*",
"symfony/filesystem": "2.8.*",
"symfony/translation": "2.8.*",
"symfony/yaml": "2.8.*",
"zendframework/zend-cache": "2.5.1",
"zendframework/zend-config": "2.5.1",
"zendframework/zend-eventmanager": "2.5.1",
"zendframework/zend-filter": "2.5.1",
"zendframework/zend-i18n": "2.5.1",
"zendframework/zend-json": "2.5.1",
"zendframework/zend-math": "2.5.1",
"zendframework/zend-serializer": "2.5.*",
"zendframework/zend-servicemanager": "2.5.*",
"zendframework/zend-stdlib": "2.5.1"
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"doctrine/annotations": "^1.2.6 || ^1.13.3",
"php-parallel-lint/php-console-highlighter": "^1.0.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcompatibility/php-compatibility": "^10.0.0@dev",
"squizlabs/php_codesniffer": "^3.13.5",
"yoast/phpunit-polyfills": "^1.0.4"
},
"suggest": {
"league/oauth2-google": "Needed for Google XOAUTH2 authentication"
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
"ext-imap": "Needed to support advanced email address parsing according to RFC822",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication",
"directorytree/imapengine": "For uploading sent messages via IMAP, see gmail example"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"classmap": [
"class.phpmailer.php",
"class.phpmaileroauth.php",
"class.phpmaileroauthgoogle.php",
"class.smtp.php",
"class.pop3.php",
"extras/EasyPeasyICS.php",
"extras/ntlm_sasl_client.php"
]
"psr-4": {
"PHPMailer\\PHPMailer\\": "src/"
}
},
"license": "LGPL-2.1"
"autoload-dev": {
"psr-4": {
"PHPMailer\\Test\\": "test/"
}
},
"license": "LGPL-2.1-only",
"scripts": {
"check": "./vendor/bin/phpcs",
"style": "./vendor/bin/phpcbf",
"test": "./vendor/bin/phpunit --no-coverage",
"coverage": "./vendor/bin/phpunit",
"lint": [
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . --show-deprecated -e php,phps --exclude vendor --exclude .git --exclude build"
]
}
}

3593
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +0,0 @@
NEW CALLBACK FUNCTION:
======================
We have had requests for a method to process the results of sending emails
through PHPMailer. In this new release, we have implemented a callback
function that passes the results of each email sent (to, cc, and/or bcc).
We have provided an example that echos the results back to the screen. The
callback function can be used for any purpose. With minor modifications, the
callback function can be used to create CSV logs, post results to databases,
etc.
Please review the test.php script for the example.
It's pretty straight forward.
Enjoy!
Andy

View File

@ -1,55 +0,0 @@
CREATE DKIM KEYS and DNS Resource Record:
=========================================
To create DomainKeys Identified Mail keys, visit:
http://dkim.worxware.com/
... read the information, fill in the form, and download the ZIP file
containing the public key, private key, DNS Resource Record and instructions
to add to your DNS Zone Record, and the PHPMailer code to enable DKIM
digital signing.
/*** PROTECT YOUR PRIVATE & PUBLIC KEYS ***/
You need to protect your DKIM private and public keys from being viewed or
accessed. Add protection to your .htaccess file as in this example:
# secure htkeyprivate file
<Files .htkeyprivate>
order allow,deny
deny from all
</Files>
# secure htkeypublic file
<Files .htkeypublic>
order allow,deny
deny from all
</Files>
(the actual .htaccess additions are in the ZIP file sent back to you from
http://dkim.worxware.com/
A few notes on using DomainKey Identified Mail (DKIM):
You do not need to use PHPMailer to DKIM sign emails IF:
- you enable DomainKey support and add the DNS resource record
- you use your outbound mail server
If you are a third-party emailer that works on behalf of domain owners to
send their emails from your own server:
- you absolutely have to DKIM sign outbound emails
- the domain owner has to add the DNS resource record to match the
private key, public key, selector, identity, and domain that you create
- use caution with the "selector" ... at least one "selector" will already
exist in the DNS Zone Record of the domain at the domain owner's server
you need to ensure that the "selector" you use is unique
Note: since the IP address will not match the domain owner's DNS Zone record
you can be certain that email providers that validate based on DomainKey will
check the domain owner's DNS Zone record for your DNS resource record. Before
sending out emails on behalf of domain owners, ensure they have entered the
DNS resource record you provided them.
Enjoy!
Andy
PS. if you need additional information about DKIM, please see:
http://www.dkim.org/info/dkim-faq.html

View File

@ -1,44 +0,0 @@
#SMTP Debugging
If you are having problems connecting or sending emails through your SMTP server, the SMTP class can provide more information about the processing/errors taking place.
Use the debug functionality of the class to see what's going on in your connections. To do that, set the debug level in your script. For example:
```php
$mail->SMTPDebug = 2;
$mail->isSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP port
$mail->Host = "mail.yourhost.com"; // SMTP server
$mail->Username = "name@yourhost.com"; // SMTP account username
$mail->Password = "your password"; // SMTP account password
```
##Debug levels
Setting the `SMTPDebug` property results in different amounts of output:
* `0`: Disable debugging (you can also leave this out completely, 0 is the default).
* `1`: Output messages sent by the client.
* `2`: as 1, plus responses received from the server (this is probably the most useful setting for debugging).
* `3`: as 2, plus more information about the initial connection.
* `4`: as 3, plus even lower-level information, very verbose.
You don't need to use levels above 2 unless you're having trouble connecting at all - it will just make output more verbose and more difficult to read.
Note that you will get no output until you call `send()`, because no SMTP conversation takes place until you do that.
##Debug output format
The form that the debug output taks is determined by the `Debugoutput` property. This has several options:
* `echo` Output plain-text as-is, appropriate for CLI
* `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
* `error_log` Output to error log as configured in php.ini
By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise. Alternatively, you can implement your own system by providing a callable expecting two parameters: a message string and the debug level:
$mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
You can of course make this more complex - for example your could capture all the output and store it in a database.
And finally, don't forget to disable debugging before going into production.

9
docs/README.md Normal file
View File

@ -0,0 +1,9 @@
# PHPMailer Documentation
Generated documentation for PHPMailer is [available online](https://phpmailer.github.io/PHPMailer/), and is regenerated automatically whenever changes are made.
Pre-built PHPMailer API documentation is not provided in this repo, but you can generate it by running `phpdoc` in the top-level folder of this project, and documentation will be generated in this `docs` folder. You will need to have [phpDocumentor](https://www.phpdoc.org) installed. The configuration for phpdoc is in the [phpdoc.dist.xml file](https://github.com/PHPMailer/PHPMailer/blob/master/phpdoc.dist.xml).
Further help and information is available in [the PHPMailer README](https://github.com/PHPMailer/PHPMailer/blob/master/README.md), [the examples folder](https://github.com/PHPMailer/PHPMailer/tree/master/examples), and in [the GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki).
Fixes and additions to documentation are welcome - please submit pull requests or improve wiki pages.

View File

@ -1,128 +0,0 @@
<html>
<head>
<title>Examples using phpmailer</title>
</head>
<body>
<h2>Examples using PHPMailer</h2>
<h3>1. Advanced Example</h3>
<p>
This demonstrates sending multiple email messages with binary attachments
from a MySQL database using multipart/alternative messages.<p>
<pre>
require 'PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->setFrom('list@example.com', 'List manager');
$mail->Host = 'smtp1.example.com;smtp2.example.com';
$mail->Mailer = 'smtp';
@mysqli_connect('localhost','root','password');
@mysqli_select_db("my_company");
$query = "SELECT full_name, email, photo FROM employee";
$result = @mysqli_query($query);
while ($row = mysqli_fetch_assoc($result))
{
// HTML body
$body = "Hello &lt;font size=\"4\"&gt;" . $row['full_name'] . "&lt;/font&gt;, &lt;p&gt;";
$body .= "&lt;i&gt;Your&lt;/i&gt; personal photograph to this message.&lt;p&gt;";
$body .= "Sincerely, &lt;br&gt;";
$body .= "phpmailer List manager";
// Plain text body (for mail clients that cannot read HTML)
$text_body = 'Hello ' . $row['full_name'] . ", \n\n";
$text_body .= "Your personal photograph to this message.\n\n";
$text_body .= "Sincerely, \n";
$text_body .= 'phpmailer List manager';
$mail->Body = $body;
$mail->AltBody = $text_body;
$mail->addAddress($row['email'], $row['full_name']);
$mail->addStringAttachment($row['photo'], 'YourPhoto.jpg');
if(!$mail->send())
echo "There has been a mail error sending to " . $row['email'] . "&lt;br&gt;";
// Clear all addresses and attachments for next loop
$mail->clearAddresses();
$mail->clearAttachments();
}
</pre>
<p>
<h3>2. Extending PHPMailer</h3>
<p>
Extending classes with inheritance is one of the most
powerful features of object-oriented programming. It allows you to make changes to the
original class for your own personal use without hacking the original
classes, and it's very easy to do:
<p>
Here's a class that extends the phpmailer class and sets the defaults
for the particular site:<br>
PHP include file: my_phpmailer.php
<p>
<pre>
require 'PHPMailerAutoload.php';
class my_phpmailer extends PHPMailer {
// Set default variables for all new objects
public $From = 'from@example.com';
public $FromName = 'Mailer';
public $Host = 'smtp1.example.com;smtp2.example.com';
public $Mailer = 'smtp'; // Alternative to isSMTP()
public $WordWrap = 75;
// Replace the default debug output function
protected function edebug($msg) {
print('My Site Error');
print('Description:');
printf('%s', $msg);
exit;
}
//Extend the send function
public function send() {
$this->Subject = '[Yay for me!] '.$this->Subject;
return parent::send()
}
// Create an additional function
public function do_something($something) {
// Place your new code here
}
}
</pre>
<br>
Now here's a normal PHP page in the site, which will have all the defaults set above:<br>
<pre>
require 'my_phpmailer.php';
// Instantiate your new class
$mail = new my_phpmailer;
// Now you only need to add the necessary stuff
$mail->addAddress('josh@example.com', 'Josh Adams');
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the message body';
$mail->addAttachment('c:/temp/11-10-00.zip', 'new_name.zip'); // optional name
if(!$mail->send())
{
echo 'There was an error sending the message';
exit;
}
echo 'Message was sent successfully';
</pre>
</body>
</html>

View File

@ -1,28 +0,0 @@
<html>
<head>
<title>PHPMailer FAQ</title>
</head>
<body>
<h2>PHPMailer FAQ</h2>
<ul>
<li><strong>Q: I am concerned that using include files will take up too much
processing time on my computer. How can I make it run faster?</strong><br>
<strong>A:</strong> PHP by itself is fairly fast, but it recompiles scripts every time they are run, which takes up valuable
computer resources. You can bypass this by using an opcode cache which compiles
PHP code and store it in memory to reduce overhead immensely. <a href="http://www.php.net/apc/">APC
(Alternative PHP Cache)</a> is a free opcode cache extension in the PECL library.</li>
<li><strong>Q: Which mailer gives me the best performance?</strong><br>
<strong>A:</strong> On a single machine the <strong>sendmail (or Qmail)</strong> is fastest overall.
Next fastest is mail() to give you the best performance. Both do not have the overhead of SMTP.
If you do not have a local mail server (as is typical on Windows), SMTP is your only option.</li>
<li><strong>Q: When I try to attach a file with on my server I get a
"Could not find {file} on filesystem error". Why is this?</strong><br>
<strong>A:</strong> If you are using a Unix machine this is probably because the user
running your web server does not have read access to the directory in question. If you are using Windows,
then the problem is probably that you have used single backslashes to denote directories (\).
A single backslash has a special meaning to PHP so these are not
valid. Instead use double backslashes ("\\") or a single forward
slash ("/").</li>
</ul>
</body>
</html>

View File

@ -1,8 +0,0 @@
#!/bin/sh
# Regenerate PHPMailer documentation
# Run from within the docs folder
rm -rf phpdoc/*
phpdoc --directory .. --target ./phpdoc --ignore test/,examples/,extras/,test_script/,vendor/,language/ --sourcecode --force --title PHPMailer --template="clean"
# You can merge regenerated docs into a separate docs working copy without messing up the git status like so:
# rsync -a --delete --exclude ".git" --exclude "phpdoc-cache-*/" --exclude "README.md" phpdoc/ ../../phpmailer-docs
# After updating docs, push/PR them to the phpmailer gh-pages branch: https://github.com/PHPMailer/PHPMailer/tree/gh-pages

View File

@ -1,50 +0,0 @@
This is built for PHP Mailer 1.72 and was not tested with any previous version. It was developed under PHP 4.3.11 (E_ALL). It works under PHP 5 and 5.1 with E_ALL, but not in Strict mode due to var deprecation (but then neither does PHP Mailer either!). It follows the RFC 1939 standard explicitly and is fully commented.
With that noted, here is how to implement it:
I didn't want to modify the PHP Mailer classes at all, so you will have to include/require this class along with the base one. It can sit quite happily in the phpmailer directory.
When you need it, create your POP3 object
Right before I invoke PHP Mailer I activate the POP3 authorisation. POP3 before SMTP is a process whereby you login to your web hosts POP3 mail server BEFORE sending out any emails via SMTP. The POP3 logon 'verifies' your ability to send email by SMTP, which typically otherwise blocks you. On my web host (Pair Networks) a single POP3 logon is enough to 'verify' you for 90 minutes. Here is some sample PHP code that activates the POP3 logon and then sends an email via PHP Mailer:
<?php
$pop->authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);
$mail = new PHPMailer(); $mail->SMTPDebug = 2; $mail->isSMTP();
$mail->isHTML(false); $mail->Host = 'relay.example.com';
$mail->From = 'mailer@example.com';
$mail->FromName = 'Example Mailer';
$mail->Subject = 'My subject';
$mail->Body = 'Hello world';
$mail->addAddress('rich@corephp.co.uk', 'Richard Davey');
if (!$mail->send()) {
echo $mail->ErrorInfo;
}
?>
The PHP Mailer parts of this code should be obvious to anyone who has used PHP Mailer before. One thing to note - you almost certainly will not need to use SMTP Authentication *and* POP3 before SMTP together. The Authorisation method is a proxy method to all of the others within that class. There are connect, Logon and disconnect methods available, but I wrapped them in the single Authorisation one to make things easier.
The Parameters
The authorise parameters are as follows:
$pop->authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);
1. pop3.example.com - The POP3 Mail Server Name (hostname or IP address)
2. 110 - The POP3 Port on which to connect (default is usually 110, but check with your host)
3. 30 - A connection time-out value (in seconds)
4. mailer - The POP3 Username required to logon
5. password - The POP3 Password required to logon
6. 1 - The class debug level (0 = off, 1+ = debug output is echoed to the browser)
Final Comments + the Download
1) This class does not support APOP connections. This is only because I did not have an APOP server to test with, but if you'd like to see that added just contact me.
2) Opening and closing lots of POP3 connections can be quite a resource/network drain. If you need to send a whole batch of emails then just perform the authentication once at the start, and then loop through your mail sending script. Providing this process doesn't take longer than the verification period lasts on your POP3 server, you should be fine. With my host that period is 90 minutes, i.e. plenty of time.
3) If you have heavy requirements for this script (i.e. send a LOT of email on a frequent basis) then I would advise seeking out an alternative sending method (direct SMTP ideally). If this isn't possible then you could modify this class so the 'last authorised' date is recorded somewhere (MySQL, Flat file, etc) meaning you only open a new connection if the old one has expired, saving you precious overhead.
4) There are lots of other POP3 classes for PHP available. However most of them implement the full POP3 command set, where-as this one is purely for authentication, and much lighter as a result. However using any of the other POP3 classes to just logon to your server would have the same net result. At the end of the day, use whatever method you feel most comfortable with.
Download
My thanks to Chris Ryan for the inspiration (even if indirectly, via his SMTP class)

View File

@ -1,38 +0,0 @@
<?php
/**
* This example shows how to use DKIM message authentication with PHPMailer.
* There's more to using DKIM than just this code - check out this article:
* @link https://yomotherboard.com/how-to-setup-email-server-dkim-keys/
* See also the DKIM code in the PHPMailer unit tests,
* which shows how to make a key pair from PHP.
*/
require '../PHPMailerAutoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto@example.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer DKIM test';
//This should be the same as the domain of your From address
$mail->DKIM_domain = 'example.com';
//Path to your private key file
$mail->DKIM_private = 'dkim_private.pem';
//Set this to your own selector
$mail->DKIM_selector = 'phpmailer';
//If your private key has a passphrase, set it here
$mail->DKIM_passphrase = '';
//The identity you're signing as - usually your From address
$mail->DKIM_identity = $mail->From;
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}

View File

@ -0,0 +1,81 @@
<?php
/**
* This shows how to make a new public/private key pair suitable for use with DKIM.
* You should only need to do this once, and the public key (**not** the private key!)
* you generate should be inserted in your DNS matching the selector you want.
*
* You can also use the DKIM wizard here: https://www.sparkpost.com/resources/tools/dkim-wizard/
* but be aware that having your private key known anywhere outside your own server
* is a security risk, and it's easy enough to create your own on your own server.
*
* For security, any keys you create should not be accessible via your web site.
*
* 2048 bits is the recommended minimum key length - gmail won't accept less than 1024 bits.
* To test your DKIM config, use Sparkpost's DKIM tester:
* https://tools.sparkpost.com/dkim
*
* Note that you only need a *private* key to *send* a DKIM-signed message,
* but receivers need your *public* key in order to verify it.
*
* Your public key will need to be formatted appropriately for your DNS and
* inserted there using the selector you want to use.
*/
//Set these to match your domain and chosen DKIM selector
$domain = 'example.com';
$selector = 'phpmailer';
//Private key filename for this selector
$privatekeyfile = $selector . '_dkim_private.pem';
//Public key filename for this selector
$publickeyfile = $selector . '_dkim_public.pem';
if (file_exists($privatekeyfile)) {
echo "Using existing keys - if you want to generate new keys, delete old key files first.\n\n";
$privatekey = file_get_contents($privatekeyfile);
$publickey = file_get_contents($publickeyfile);
} else {
//Create a 2048-bit RSA key with an SHA256 digest
$pk = openssl_pkey_new(
[
'digest_alg' => 'sha256',
'private_key_bits' => 2048,
'private_key_type' => OPENSSL_KEYTYPE_RSA,
]
);
//Save private key
openssl_pkey_export_to_file($pk, $privatekeyfile);
//Save public key
$pubKey = openssl_pkey_get_details($pk);
$publickey = $pubKey['key'];
file_put_contents($publickeyfile, $publickey);
$privatekey = file_get_contents($privatekeyfile);
}
echo "Private key (keep this private!):\n\n" . $privatekey;
echo "\n\nPublic key:\n\n" . $publickey;
//Prepare public key for DNS, e.g.
//phpmailer._domainkey.example.com IN TXT "v=DKIM1; h=sha256; t=s; p=" "MIIBIjANBg...oXlwIDAQAB"...
$dnskey = "$selector._domainkey.$domain IN TXT";
$dnsvalue = '"v=DKIM1; h=sha256; t=s; p=" ';
//Some DNS servers don't like ;(semi colon) chars unless backslash-escaped
$dnsvalue2 = '"v=DKIM1\; h=sha256\; t=s\; p=" ';
//Strip and split the key into smaller parts and format for DNS
//Many DNS systems don't like long TXT entries
//but are OK if it's split into 255-char chunks
//Remove PEM wrapper
$publickey = preg_replace('/^-+.*?-+$/m', '', $publickey);
//Strip line breaks
$publickey = str_replace(["\r", "\n"], '', $publickey);
//Split into chunks
$keyparts = str_split($publickey, 253); //Becomes 255 when quotes are included
//Quote each chunk
foreach ($keyparts as $keypart) {
$dnsvalue .= '"' . trim($keypart) . '" ';
$dnsvalue2 .= '"' . trim($keypart) . '" ';
}
echo "\n\nDNS key:\n\n" . trim($dnskey);
echo "\n\nDNS value:\n\n" . trim($dnsvalue);
echo "\n\nDNS value (with escaping):\n\n" . trim($dnsvalue2);

46
examples/DKIM_sign.phps Normal file
View File

@ -0,0 +1,46 @@
<?php
/**
* This example shows sending a DKIM-signed message with PHPMailer.
* More info about DKIM can be found here: https://www.dkim.org/info/dkim-faq.html
* There's more to using DKIM than just this code - check out this article:
* @see https://yomotherboard.com/how-to-setup-email-server-dkim-keys/
* See also the DKIM_gen_keys example code in the examples folder,
* which shows how to make a key pair from PHP.
*/
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
require '../vendor/autoload.php';
//Usual setup
$mail = new PHPMailer();
$mail->setFrom('from@example.com', 'First Last');
$mail->addAddress('whoto@example.com', 'John Doe');
$mail->Subject = 'PHPMailer mail() test';
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//This should be the same as the domain of your From address
$mail->DKIM_domain = 'example.com';
//See the DKIM_gen_keys.phps script for making a key pair -
//here we assume you've already done that.
//Path to your private key:
$mail->DKIM_private = 'dkim_private.pem';
//Set this to your own selector
$mail->DKIM_selector = 'phpmailer';
//Put your private key's passphrase in here if it has one
$mail->DKIM_passphrase = '';
//The identity you're signing as - usually your From address
$mail->DKIM_identity = $mail->From;
//Suppress listing signed header fields in signature, defaults to true for debugging purpose
$mail->DKIM_copyHeaderFields = false;
//Optionally you can add extra headers for signing to meet special requirements
$mail->DKIM_extraHeaders = ['List-Unsubscribe', 'List-Help'];
//When you send, the DKIM settings will be used to sign the message
if (!$mail->send()) {
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message sent!';
}

96
examples/README.md Normal file
View File

@ -0,0 +1,96 @@
[![PHPMailer logo](images/phpmailer.png)](https://github.com/PHPMailer/PHPMailer)
# PHPMailer code examples
This folder contains a collection of examples of using [PHPMailer](https://github.com/PHPMailer/PHPMailer).
## About testing email sending
When working on email sending code you'll find yourself worrying about what might happen if all these test emails got sent to your mailing list. The solution is to use a fake mail server, one that acts just like the real thing, but just doesn't actually send anything out. Some offer web interfaces, feedback, logging, the ability to return specific error codes, all things that are useful for testing error handling, authentication etc. Here's a selection of mail testing tools you might like to try:
* [FakeEmail](https://github.com/tomwardill/FakeEmail), a Python-based fake mail server with a web interface.
* [smtp-sink](https://www.postfix.org/smtp-sink.1.html), part of the Postfix mail server, so you may have this installed already. This is used in the GitHub actions configuration to run PHPMailer's unit tests.
* [smtp4dev](https://github.com/rnwood/smtp4dev), a dummy SMTP server for Windows and Linux.
* [fakesendmail.sh](https://github.com/PHPMailer/PHPMailer/blob/master/test/fakesendmail.sh), part of PHPMailer's test setup, this is a shell script that emulates sendmail for testing 'mail' or 'sendmail' methods in PHPMailer.
* [HELO](https://usehelo.com), a very nice (commercial) mail server desktop app from BeyondCode, and [how to set it up for local testing](https://usehelo.com/blog/how-to-use-helo-with-phps-mail-function).
* [msglint](https://www.splitbrain.org/_static/msglint/), not a mail server, the IETF's MIME structure analyser checks the formatting of your messages.
* [MailHog](https://github.com/les-enovateurs/mailhog-examples), a Go-based email testing tool for developers with a web interface. You can use it with Docker and GitHub Actions to test your mails. The repository also contains a small part of PHPMailer's setup.
* [aboutmy.email](https://aboutmy.email), a service for evaluating your email config SPF, DKIM, DMARC, and compliance with list-unsubscribe, TLS, and many other settings.
Most of these examples use the `example.com` and `example.net` domains. These domains are reserved by IANA for illustrative purposes, as documented in [RFC 2606](https://www.rfc-editor.org/rfc/rfc2606). Don't use made-up domains like 'mydomain.com' or 'somedomain.com' in examples as someone, somewhere, probably owns them!
## Security note
Before running these examples in a web server, you'll need to rename them with '.php' extensions. They are supplied as '.phps' files which will usually be displayed with syntax highlighting by PHP instead of running them. This prevents potential security issues with running potential spam-gateway code if you happen to deploy these code examples on a live site - _please don't do that!_
Similarly, don't leave your passwords in these files as they will be visible to the world!
## [mail.phps](mail.phps)
This is a basic example which creates an email message from an external HTML file, creates a plain text body, sets various addresses, adds an attachment and sends the message. It uses PHP's built-in mail() function which is the simplest to use, but relies on the presence of a local mail server, something which is not usually available on Windows. If you find yourself in that situation, either install a local mail server, or use a remote one and send using SMTP instead.
## [simple_contact_form.phps](simple_contact_form.phps)
This is probably the most common reason for using PHPMailer - building a contact form. This example has a basic, unstyled form and also illustrates how to filter input data before using it, how to validate addresses, how to avoid being abused as a spam gateway, and how to address messages correctly so that you don't fail SPF checks.
## [exceptions.phps](exceptions.phps)
Like the mail example, but shows how to use PHPMailer's optional exceptions for error handling.
## [extending.phps](extending.phps)
This shows how to create a subclass of PHPMailer to customise its behaviour and simplify coding in your app.
## [smtp.phps](smtp.phps)
A simple example sending using SMTP with authentication.
## [smtp_no_auth.phps](smtp_no_auth.phps)
A simple example sending using SMTP without authentication.
## [send_file_upload.phps](send_file_upload.phps)
Lots of people want to do this... This is a simple form which accepts a file upload and emails it.
## [send_multiple_file_upload.phps](send_multiple_file_upload.phps)
A slightly more complex form that allows uploading multiple files at once and sends all of them as attachments to an email.
## [sendmail.phps](sendmail.phps)
A simple example using sendmail. Sendmail is a program (usually found on Linux/BSD, OS X and other UNIX-alikes) that can be used to submit messages to a local mail server without a lengthy SMTP conversation. It's probably the fastest sending mechanism, but lacks some error reporting features. There are sendmail emulators for most popular mail servers including postfix, qmail, exim etc.
## [gmail.phps](gmail.phps)
Submitting email via Google's Gmail service is a popular use of PHPMailer. It's much the same as normal SMTP sending, just with some specific settings, namely using TLS encryption, authentication is enabled, and it connects to the SMTP submission port 587 on the smtp.gmail.com host. This example does all that.
## [gmail_xoauth.phps](gmail_xoauth.phps)
Gmail now likes you to use XOAUTH2 for SMTP authentication. This is extremely laborious to set up, but once it's done you can use it repeatedly and will no longer need Gmail's ineptly-named "Allow less secure apps" setting enabled. [Read the guide in the wiki](https://github.com/PHPMailer/PHPMailer/wiki/Using-Gmail-with-XOAUTH2) for how to set it up.
## [pop_before_smtp.phps](pop_before_smtp.phps)
Back in the stone age, before effective SMTP authentication mechanisms were available, it was common for ISPs to use POP-before-SMTP authentication. As it implies, you authenticate using the POP3 protocol (an older protocol now mostly replaced by the far superior IMAP), and then the SMTP server will allow send access from your IP address for a short while, usually 5-15 minutes. PHPMailer includes a basic POP3 protocol client with just enough functionality to carry out this sequence - it's just like a normal SMTP conversation (without authentication), but connects via POP3 first.
## [mailing_list.phps](mailing_list.phps)
This is a somewhat naïve, but reasonably efficient example of sending similar emails to a list of different addresses. It sets up a PHPMailer instance using SMTP, then connects to a MySQL database to retrieve a list of recipients. The code loops over this list, sending email to each person using their info and marks them as sent in the database. It makes use of SMTP keepalive which saves reconnecting and re-authenticating between each message.
## [ssl_options.phps](ssl_options.phps)
PHP 5.6 introduced SSL certificate verification by default, and this applies to mail servers exactly as it does to web servers. Unfortunately, SSL misconfiguration in mail servers is quite common, so this caused a common problem: those that were previously using servers with bad configs suddenly found they stopped working when they upgraded PHP. PHPMailer provides a mechanism to disable SSL certificate verification as a workaround and this example shows how to do it. Bear in mind that this is **not** a good approach - the right way is to fix your mail server config!
## [smime_signed_mail.phps](smime_signed_mail.phps)
An example of how to sign messages using [S/MIME](https://en.wikipedia.org/wiki/S/MIME), ensuring that your data can't be tampered with in transit, and proves to recipients that it was you that sent it.
* * *
## [smtp_check.phps](smtp_check.phps)
This is an example showing how to use the SMTP class by itself (without PHPMailer) to check an SMTP connection.
## [smtp_low_memory.phps](smtp_low_memory.phps)
This demonstrates how to extend the SMTP class and make PHPMailer use it. In this case it's an effort to make the SMTP class use less memory when sending large attachments.
* * *

126
examples/azure_xoauth2.phps Normal file
View File

@ -0,0 +1,126 @@
<?php
/**
* This example shows how to send via Microsoft Outlook's servers using XOAUTH2 authentication
* using the league/oauth2-client to provide the OAuth2 token.
* To use a different OAuth2 library create a wrapper class that implements OAuthTokenProvider and
* pass that wrapper class to PHPMailer::setOAuth().
*/
//Import PHPMailer classes into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\OAuth;
//Alias the League Google OAuth2 provider class
use Greew\OAuth2\Client\Provider\Azure;
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
//Load dependencies from composer
//If this causes an error, run 'composer install'
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer();
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
//SMTP::DEBUG_OFF = off (for production use)
//SMTP::DEBUG_CLIENT = client messages
//SMTP::DEBUG_SERVER = client and server messages
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
//Set the hostname of the mail server
$mail->Host = 'smtp.office365.com';
//Set the SMTP port number:
// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or
// - 587 for SMTP+STARTTLS
$mail->Port = 587;
//Set the encryption mechanism to use:
// - SMTPS (implicit TLS on port 465) or
// - STARTTLS (explicit TLS on port 587)
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Set AuthType to use XOAUTH2
$mail->AuthType = 'XOAUTH2';
//Start Option 1: Use league/oauth2-client as OAuth2 token provider
//Fill in authentication details here
//Either the microsoft account owner, or the user that gave consent
$email = 'someone@somemicrosoftaccount.com';
$clientId = 'RANDOMCHARS-----duv1n2TS';
$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
$tenantId = 'RANDOMCHARS-----HSFTAOIlagss';
//Obtained by configuring and running get_oauth_token.php
//after setting up an app in Google Developer Console.
$refreshToken = 'RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0';
//Create a new OAuth2 provider instance
$provider = new Azure(
[
'clientId' => $clientId,
'clientSecret' => $clientSecret,
'tenantId' => $tenantId,
]
);
//Pass the OAuth provider instance to PHPMailer
$mail->setOAuth(
new OAuth(
[
'provider' => $provider,
'clientId' => $clientId,
'clientSecret' => $clientSecret,
'refreshToken' => $refreshToken,
'userName' => $email,
]
)
);
//End Option 1
//Option 2: Another OAuth library as OAuth2 token provider
//Set up the other oauth library as per its documentation
//Then create the wrapper class that implementations OAuthTokenProvider
$oauthTokenProvider = new MyOAuthTokenProvider(/* Email, ClientId, ClientSecret, etc. */);
//Pass the implementation of OAuthTokenProvider to PHPMailer
$mail->setOAuth($oauthTokenProvider);
//End Option 2
//Set who the message is to be sent from
//For Outlook, this generally needs to be the same as the user you logged in as
$mail->setFrom($email, 'First Last');
//Set who the message is to be sent to
$mail->addAddress('someone@someserver.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer Outlook XOAUTH2 SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->CharSet = PHPMailer::CHARSET_UTF8;
$mail->msgHTML(file_get_contents('contentsutf8.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');
//send the message, check for errors
if (!$mail->send()) {
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message sent!';
}

76
examples/callback.phps Normal file
View File

@ -0,0 +1,76 @@
<?php
/**
* This example shows how to use a callback function from PHPMailer.
*/
//Import PHPMailer classes into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require '../vendor/autoload.php';
/**
* Example PHPMailer callback function.
* This is a global function, but you can also pass a closure (or any other callable)
* to the `action_function` property.
*
* @param bool $result result of the send action
* @param array $to email address of the recipient
* @param array $cc cc email addresses
* @param array $bcc bcc email addresses
* @param string $subject the subject
* @param string $body the email body
*/
function callbackAction($result, $to, $cc, $bcc, $subject, $body)
{
echo "Message subject: \"$subject\"\n";
foreach ($to as $address) {
echo "Message to {$address[1]} <{$address[0]}>\n";
}
foreach ($cc as $address) {
echo "Message CC to {$address[1]} <{$address[0]}>\n";
}
foreach ($bcc as $toaddress) {
echo "Message BCC to {$toaddress[1]} <{$toaddress[0]}>\n";
}
if ($result) {
echo "Message sent successfully\n";
} else {
echo "Message send failed\n";
}
}
require_once '../vendor/autoload.php';
$mail = new PHPMailer();
try {
$mail->isMail();
$mail->setFrom('you@example.com', 'Your Name');
$mail->addAddress('jane@example.com', 'Jane Doe');
$mail->addCC('john@example.com', 'John Doe');
$mail->Subject = 'PHPMailer Test Subject';
$mail->msgHTML(file_get_contents('../examples/contents.html'));
//Optional - msgHTML will create an alternate automatically
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
$mail->addAttachment('images/phpmailer_mini.png');
$mail->action_function = 'callbackAction';
$mail->send();
} catch (Exception $e) {
echo $e->errorMessage();
}
//Alternative approach using a closure
try {
$mail->action_function = static function ($result, $to, $cc, $bcc, $subject, $body) {
if ($result) {
echo "Message sent successfully\n";
} else {
echo "Message send failed\n";
}
};
$mail->send();
} catch (Exception $e) {
echo $e->errorMessage();
}

View File

@ -1,604 +0,0 @@
<?php
/*
* A web form that both generates and uses PHPMailer code.
* revised, updated and corrected 27/02/2013
* by matt.sturdy@gmail.com
*/
require '../PHPMailerAutoload.php';
$CFG['smtp_debug'] = 2; //0 == off, 1 for client output, 2 for client and server
$CFG['smtp_debugoutput'] = 'html';
$CFG['smtp_server'] = 'localhost';
$CFG['smtp_port'] = '25';
$CFG['smtp_authenticate'] = false;
$CFG['smtp_username'] = 'name@example.com';
$CFG['smtp_password'] = 'yourpassword';
$CFG['smtp_secure'] = 'None';
$from_name = (isset($_POST['From_Name'])) ? $_POST['From_Name'] : '';
$from_email = (isset($_POST['From_Email'])) ? $_POST['From_Email'] : '';
$to_name = (isset($_POST['To_Name'])) ? $_POST['To_Name'] : '';
$to_email = (isset($_POST['To_Email'])) ? $_POST['To_Email'] : '';
$cc_email = (isset($_POST['cc_Email'])) ? $_POST['cc_Email'] : '';
$bcc_email = (isset($_POST['bcc_Email'])) ? $_POST['bcc_Email'] : '';
$subject = (isset($_POST['Subject'])) ? $_POST['Subject'] : '';
$message = (isset($_POST['Message'])) ? $_POST['Message'] : '';
$test_type = (isset($_POST['test_type'])) ? $_POST['test_type'] : 'smtp';
$smtp_debug = (isset($_POST['smtp_debug'])) ? $_POST['smtp_debug'] : $CFG['smtp_debug'];
$smtp_server = (isset($_POST['smtp_server'])) ? $_POST['smtp_server'] : $CFG['smtp_server'];
$smtp_port = (isset($_POST['smtp_port'])) ? $_POST['smtp_port'] : $CFG['smtp_port'];
$smtp_secure = strtolower((isset($_POST['smtp_secure'])) ? $_POST['smtp_secure'] : $CFG['smtp_secure']);
$smtp_authenticate = (isset($_POST['smtp_authenticate'])) ?
$_POST['smtp_authenticate'] : $CFG['smtp_authenticate'];
$authenticate_password = (isset($_POST['authenticate_password'])) ?
$_POST['authenticate_password'] : $CFG['smtp_password'];
$authenticate_username = (isset($_POST['authenticate_username'])) ?
$_POST['authenticate_username'] : $CFG['smtp_username'];
// storing all status output from the script to be shown to the user later
$results_messages = array();
// $example_code represents the "final code" that we're using, and will
// be shown to the user at the end.
$example_code = "\nrequire_once '../PHPMailerAutoload.php';";
$example_code .= "\n\n\$results_messages = array();";
$mail = new PHPMailer(true); //PHPMailer instance with exceptions enabled
$mail->CharSet = 'utf-8';
ini_set('default_charset', 'UTF-8');
$mail->Debugoutput = $CFG['smtp_debugoutput'];
$example_code .= "\n\n\$mail = new PHPMailer(true);";
$example_code .= "\n\$mail->CharSet = 'utf-8';";
$example_code .= "\nini_set('default_charset', 'UTF-8');";
class phpmailerAppException extends phpmailerException
{
}
$example_code .= "\n\nclass phpmailerAppException extends phpmailerException {}";
$example_code .= "\n\ntry {";
// Convert a string to its JavaScript representation.
function JSString($s) {
static $from = array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"');
static $to = array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\\"');
return is_null($s)? 'null': '"' . str_replace($from, $to, "$s") . '"';
}
try {
if (isset($_POST["submit"]) && $_POST['submit'] == "Submit") {
$to = $to_email;
if (!PHPMailer::validateAddress($to)) {
throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!");
}
$example_code .= "\n\$to = '" . addslashes($to_email) . "';";
$example_code .= "\nif(!PHPMailer::validateAddress(\$to)) {";
$example_code .= "\n throw new phpmailerAppException(\"Email address \" . " .
"\$to . \" is invalid -- aborting!\");";
$example_code .= "\n}";
switch ($test_type) {
case 'smtp':
$mail->isSMTP(); // telling the class to use SMTP
$mail->SMTPDebug = (integer)$smtp_debug;
$mail->Host = $smtp_server; // SMTP server
$mail->Port = (integer)$smtp_port; // set the SMTP port
if ($smtp_secure) {
$mail->SMTPSecure = strtolower($smtp_secure);
}
$mail->SMTPAuth = array_key_exists('smtp_authenticate', $_POST); // enable SMTP authentication?
if (array_key_exists('smtp_authenticate', $_POST)) {
$mail->Username = $authenticate_username; // SMTP account username
$mail->Password = $authenticate_password; // SMTP account password
}
$example_code .= "\n\$mail->isSMTP();";
$example_code .= "\n\$mail->SMTPDebug = " . (integer) $smtp_debug . ";";
$example_code .= "\n\$mail->Host = \"" . addslashes($smtp_server) . "\";";
$example_code .= "\n\$mail->Port = \"" . addslashes($smtp_port) . "\";";
$example_code .= "\n\$mail->SMTPSecure = \"" . addslashes(strtolower($smtp_secure)) . "\";";
$example_code .= "\n\$mail->SMTPAuth = " . (array_key_exists(
'smtp_authenticate',
$_POST
) ? 'true' : 'false') . ";";
if (array_key_exists('smtp_authenticate', $_POST)) {
$example_code .= "\n\$mail->Username = \"" . addslashes($authenticate_username) . "\";";
$example_code .= "\n\$mail->Password = \"" . addslashes($authenticate_password) . "\";";
}
break;
case 'mail':
$mail->isMail(); // telling the class to use PHP's mail()
$example_code .= "\n\$mail->isMail();";
break;
case 'sendmail':
$mail->isSendmail(); // telling the class to use Sendmail
$example_code .= "\n\$mail->isSendmail();";
break;
case 'qmail':
$mail->isQmail(); // telling the class to use Qmail
$example_code .= "\n\$mail->isQmail();";
break;
default:
throw new phpmailerAppException('Invalid test_type provided');
}
try {
if ($_POST['From_Name'] != '') {
$mail->addReplyTo($from_email, $from_name);
$mail->setFrom($from_email, $from_name);
$example_code .= "\n\$mail->addReplyTo(\"" .
addslashes($from_email) . "\", \"" . addslashes($from_name) . "\");";
$example_code .= "\n\$mail->setFrom(\"" .
addslashes($from_email) . "\", \"" . addslashes($from_name) . "\");";
} else {
$mail->addReplyTo($from_email);
$mail->setFrom($from_email, $from_email);
$example_code .= "\n\$mail->addReplyTo(\"" . addslashes($from_email) . "\");";
$example_code .= "\n\$mail->setFrom(\"" .
addslashes($from_email) . "\", \"" . addslashes($from_email) . "\");";
}
if ($_POST['To_Name'] != '') {
$mail->addAddress($to, $to_name);
$example_code .= "\n\$mail->addAddress(\"$to\", \"" . addslashes($to_name) . "\");";
} else {
$mail->addAddress($to);
$example_code .= "\n\$mail->addAddress(\"$to\");";
}
if ($_POST['bcc_Email'] != '') {
$indiBCC = explode(" ", $bcc_email);
foreach ($indiBCC as $key => $value) {
$mail->addBCC($value);
$example_code .= "\n\$mail->addBCC(\"" . addslashes($value) . "\");";
}
}
if ($_POST['cc_Email'] != '') {
$indiCC = explode(" ", $cc_Email);
foreach ($indiCC as $key => $value) {
$mail->addCC($value);
$example_code .= "\n\$mail->addCC(\"" . addslashes($value) . "\");";
}
}
} catch (phpmailerException $e) { //Catch all kinds of bad addressing
throw new phpmailerAppException($e->getMessage());
}
$mail->Subject = $subject . ' (PHPMailer test using ' . strtoupper($test_type) . ')';
$example_code .= "\n\$mail->Subject = \"" . addslashes($subject) .
' (PHPMailer test using ' . addslashes(strtoupper($test_type)) . ')";';
if ($_POST['Message'] == '') {
$body = file_get_contents('contents.html');
} else {
$body = $message;
}
$example_code .= "\n\$body = <<<'EOT'\n$body\nEOT;";
$mail->WordWrap = 78; // set word wrap to the RFC2822 limit
$mail->msgHTML($body, dirname(__FILE__), true); //Create message bodies and embed images
$example_code .= "\n\$mail->WordWrap = 78;";
$example_code .= "\n\$mail->msgHTML(\$body, dirname(__FILE__), true); //Create message bodies and embed images";
$mail->addAttachment('images/phpmailer_mini.png', 'phpmailer_mini.png'); // optional name
$mail->addAttachment('images/phpmailer.png', 'phpmailer.png'); // optional name
$example_code .= "\n\$mail->addAttachment('images/phpmailer_mini.png'," .
"'phpmailer_mini.png'); // optional name";
$example_code .= "\n\$mail->addAttachment('images/phpmailer.png', 'phpmailer.png'); // optional name";
$example_code .= "\n\ntry {";
$example_code .= "\n \$mail->send();";
$example_code .= "\n \$results_messages[] = \"Message has been sent using " .
addslashes(strtoupper($test_type)) . "\";";
$example_code .= "\n}";
$example_code .= "\ncatch (phpmailerException \$e) {";
$example_code .= "\n throw new phpmailerAppException('Unable to send to: ' . \$to. ': '.\$e->getMessage());";
$example_code .= "\n}";
try {
$mail->send();
$results_messages[] = "Message has been sent using " . strtoupper($test_type);
} catch (phpmailerException $e) {
throw new phpmailerAppException("Unable to send to: " . $to . ': ' . $e->getMessage());
}
}
} catch (phpmailerAppException $e) {
$results_messages[] = $e->errorMessage();
}
$example_code .= "\n}";
$example_code .= "\ncatch (phpmailerAppException \$e) {";
$example_code .= "\n \$results_messages[] = \$e->errorMessage();";
$example_code .= "\n}";
$example_code .= "\n\nif (count(\$results_messages) > 0) {";
$example_code .= "\n echo \"<h2>Run results</h2>\\n\";";
$example_code .= "\n echo \"<ul>\\n\";";
$example_code .= "\nforeach (\$results_messages as \$result) {";
$example_code .= "\n echo \"<li>\$result</li>\\n\";";
$example_code .= "\n}";
$example_code .= "\necho \"</ul>\\n\";";
$example_code .= "\n}";
?><!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHPMailer Test Page</title>
<script type="text/javascript" src="scripts/shCore.js"></script>
<script type="text/javascript" src="scripts/shBrushPhp.js"></script>
<link type="text/css" rel="stylesheet" href="styles/shCore.css">
<link type="text/css" rel="stylesheet" href="styles/shThemeDefault.css">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 1em;
padding: 1em;
}
table {
margin: 0 auto;
border-spacing: 0;
border-collapse: collapse;
}
table.column {
border-collapse: collapse;
background-color: #FFFFFF;
padding: 0.5em;
width: 35em;
}
td {
font-size: 1em;
padding: 0.1em 0.25em;
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
border-radius: 1em;
}
td.colleft {
text-align: right;
width: 35%;
}
td.colrite {
text-align: left;
width: 65%;
}
fieldset {
padding: 1em 1em 1em 1em;
margin: 0 2em;
border-radius: 1.5em;
-webkit-border-radius: 1em;
-moz-border-radius: 1em;
}
fieldset.inner {
width: 40%;
}
fieldset:hover, tr:hover {
background-color: #fafafa;
}
legend {
font-weight: bold;
font-size: 1.1em;
}
div.column-left {
float: left;
width: 45em;
height: 31em;
}
div.column-right {
display: inline;
width: 45em;
max-height: 31em;
}
input.radio {
float: left;
}
div.radio {
padding: 0.2em;
}
</style>
<script>
SyntaxHighlighter.config.clipboardSwf = 'scripts/clipboard.swf';
SyntaxHighlighter.all();
function startAgain() {
var post_params = {
"From_Name": <?php echo JSString($from_name); ?>,
"From_Email": <?php echo JSString($from_email); ?>,
"To_Name": <?php echo JSString($to_name); ?>,
"To_Email": <?php echo JSString($to_email); ?>,
"cc_Email": <?php echo JSString($cc_email); ?>,
"bcc_Email": <?php echo JSString($bcc_email); ?>,
"Subject": <?php echo JSString($subject); ?>,
"Message": <?php echo JSString($message); ?>,
"test_type": <?php echo JSString($test_type); ?>,
"smtp_debug": <?php echo JSString($smtp_debug); ?>,
"smtp_server": <?php echo JSString($smtp_server); ?>,
"smtp_port": <?php echo JSString($smtp_port); ?>,
"smtp_secure": <?php echo JSString($smtp_secure); ?>,
"smtp_authenticate": <?php echo JSString($smtp_authenticate); ?>,
"authenticate_username": <?php echo JSString($authenticate_username); ?>,
"authenticate_password": <?php echo JSString($authenticate_password); ?>
};
var resetForm = document.createElement("form");
resetForm.setAttribute("method", "POST");
resetForm.setAttribute("path", "index.php");
for (var k in post_params) {
var h = document.createElement("input");
h.setAttribute("type", "hidden");
h.setAttribute("name", k);
h.setAttribute("value", post_params[k]);
resetForm.appendChild(h);
}
document.body.appendChild(resetForm);
resetForm.submit();
}
function showHideDiv(test, element_id) {
var ops = {"smtp-options-table": "smtp"};
if (test == ops[element_id]) {
document.getElementById(element_id).style.display = "block";
} else {
document.getElementById(element_id).style.display = "none";
}
}
</script>
</head>
<body>
<?php
if (version_compare(PHP_VERSION, '5.0.0', '<')) {
echo 'Current PHP version: ' . phpversion() . "<br>";
echo exit("ERROR: Wrong PHP version. Must be PHP 5 or above.");
}
if (count($results_messages) > 0) {
echo '<h2>Run results</h2>';
echo '<ul>';
foreach ($results_messages as $result) {
echo "<li>$result</li>";
}
echo '</ul>';
}
if (isset($_POST["submit"]) && $_POST["submit"] == "Submit") {
echo "<button type=\"submit\" onclick=\"startAgain();\">Start Over</button><br>\n";
echo "<br><span>Script:</span>\n";
echo "<pre class=\"brush: php;\">\n";
echo htmlentities($example_code);
echo "\n</pre>\n";
echo "\n<hr style=\"margin: 3em;\">\n";
}
?>
<form method="POST" enctype="multipart/form-data">
<div>
<div class="column-left">
<fieldset>
<legend>Mail Details</legend>
<table border="1" class="column">
<tr>
<td class="colleft">
<label for="From_Name"><strong>From</strong> Name</label>
</td>
<td class="colrite">
<input type="text" id="From_Name" name="From_Name" value="<?php echo htmlentities($from_name); ?>"
style="width:95%;" autofocus placeholder="Your Name">
</td>
</tr>
<tr>
<td class="colleft">
<label for="From_Email"><strong>From</strong> Email Address</label>
</td>
<td class="colrite">
<input type="text" id="From_Email" name="From_Email" value="<?php echo htmlentities($from_email); ?>"
style="width:95%;" required placeholder="Your.Email@example.com">
</td>
</tr>
<tr>
<td class="colleft">
<label for="To_Name"><strong>To</strong> Name</label>
</td>
<td class="colrite">
<input type="text" id="To_Name" name="To_Name" value="<?php echo htmlentities($to_name); ?>"
style="width:95%;" placeholder="Recipient's Name">
</td>
</tr>
<tr>
<td class="colleft">
<label for="To_Email"><strong>To</strong> Email Address</label>
</td>
<td class="colrite">
<input type="text" id="To_Email" name="To_Email" value="<?php echo htmlentities($to_email); ?>"
style="width:95%;" required placeholder="Recipients.Email@example.com">
</td>
</tr>
<tr>
<td class="colleft">
<label for="cc_Email"><strong>CC Recipients</strong><br>
<small>(separate with commas)</small>
</label>
</td>
<td class="colrite">
<input type="text" id="cc_Email" name="cc_Email" value="<?php echo htmlentities($cc_email); ?>"
style="width:95%;" placeholder="cc1@example.com, cc2@example.com">
</td>
</tr>
<tr>
<td class="colleft">
<label for="bcc_Email"><strong>BCC Recipients</strong><br>
<small>(separate with commas)</small>
</label>
</td>
<td class="colrite">
<input type="text" id="bcc_Email" name="bcc_Email" value="<?php echo htmlentities($bcc_email); ?>"
style="width:95%;" placeholder="bcc1@example.com, bcc2@example.com">
</td>
</tr>
<tr>
<td class="colleft">
<label for="Subject"><strong>Subject</strong></label>
</td>
<td class="colrite">
<input type="text" name="Subject" id="Subject" value="<?php echo htmlentities($subject); ?>"
style="width:95%;" placeholder="Email Subject">
</td>
</tr>
<tr>
<td class="colleft">
<label for="Message"><strong>Message</strong><br>
<small>If blank, will use content.html</small>
</label>
</td>
<td class="colrite">
<textarea name="Message" id="Message" style="width:95%;height:5em;"
placeholder="Body of your email"><?php echo htmlentities($message); ?></textarea>
</td>
</tr>
</table>
<div style="margin:1em 0;">Test will include two attachments.</div>
</fieldset>
</div>
<div class="column-right">
<fieldset class="inner"> <!-- SELECT TYPE OF MAIL -->
<legend>Mail Test Specs</legend>
<table border="1" class="column">
<tr>
<td class="colleft">Test Type</td>
<td class="colrite">
<div class="radio">
<label for="radio-mail">Mail()</label>
<input class="radio" type="radio" name="test_type" value="mail" id="radio-mail"
onclick="showHideDiv(this.value, 'smtp-options-table');"
<?php echo ($test_type == 'mail') ? 'checked' : ''; ?>
required>
</div>
<div class="radio">
<label for="radio-sendmail">Sendmail</label>
<input class="radio" type="radio" name="test_type" value="sendmail" id="radio-sendmail"
onclick="showHideDiv(this.value, 'smtp-options-table');"
<?php echo ($test_type == 'sendmail') ? 'checked' : ''; ?>
required>
</div>
<div class="radio">
<label for="radio-qmail">Qmail</label>
<input class="radio" type="radio" name="test_type" value="qmail" id="radio-qmail"
onclick="showHideDiv(this.value, 'smtp-options-table');"
<?php echo ($test_type == 'qmail') ? 'checked' : ''; ?>
required>
</div>
<div class="radio">
<label for="radio-smtp">SMTP</label>
<input class="radio" type="radio" name="test_type" value="smtp" id="radio-smtp"
onclick="showHideDiv(this.value, 'smtp-options-table');"
<?php echo ($test_type == 'smtp') ? 'checked' : ''; ?>
required>
</div>
</td>
</tr>
</table>
<div id="smtp-options-table" style="margin:1em 0 0 0;
<?php if ($test_type != 'smtp') {
echo "display: none;";
} ?>">
<span style="margin:1.25em 0; display:block;"><strong>SMTP Specific Options:</strong></span>
<table border="1" class="column">
<tr>
<td class="colleft"><label for="smtp_debug">SMTP Debug ?</label></td>
<td class="colrite">
<select size="1" id="smtp_debug" name="smtp_debug">
<option <?php echo ($smtp_debug == '0') ? 'selected' : ''; ?> value="0">
0 - Disabled
</option>
<option <?php echo ($smtp_debug == '1') ? 'selected' : ''; ?> value="1">
1 - Client messages
</option>
<option <?php echo ($smtp_debug == '2') ? 'selected' : ''; ?> value="2">
2 - Client and server messages
</option>
</select>
</td>
</tr>
<tr>
<td class="colleft"><label for="smtp_server">SMTP Server</label></td>
<td class="colrite">
<input type="text" id="smtp_server" name="smtp_server"
value="<?php echo htmlentities($smtp_server); ?>" style="width:95%;"
placeholder="smtp.server.com">
</td>
</tr>
<tr>
<td class="colleft" style="width: 5em;"><label for="smtp_port">SMTP Port</label></td>
<td class="colrite">
<input type="text" name="smtp_port" id="smtp_port" size="3"
value="<?php echo htmlentities($smtp_port); ?>" placeholder="Port">
</td>
</tr>
<tr>
<td class="colleft"><label for="smtp_secure">SMTP Security</label></td>
<td>
<select size="1" name="smtp_secure" id="smtp_secure">
<option <?php echo ($smtp_secure == 'none') ? 'selected' : '' ?>>None</option>
<option <?php echo ($smtp_secure == 'tls') ? 'selected' : '' ?>>TLS</option>
<option <?php echo ($smtp_secure == 'ssl') ? 'selected' : '' ?>>SSL</option>
</select>
</td>
</tr>
<tr>
<td class="colleft"><label for="smtp-authenticate">SMTP Authenticate?</label></td>
<td class="colrite">
<input type="checkbox" id="smtp-authenticate"
name="smtp_authenticate"
<?php if ($smtp_authenticate != '') {
echo "checked";
} ?>
value="true">
</td>
</tr>
<tr>
<td class="colleft"><label for="authenticate_username">Authenticate Username</label></td>
<td class="colrite">
<input type="text" id="authenticate_username" name="authenticate_username"
value="<?php echo htmlentities($authenticate_username); ?>" style="width:95%;"
placeholder="SMTP Server Username">
</td>
</tr>
<tr>
<td class="colleft"><label for="authenticate_password">Authenticate Password</label></td>
<td class="colrite">
<input type="password" name="authenticate_password" id="authenticate_password"
value="<?php echo htmlentities($authenticate_password); ?>" style="width:95%;"
placeholder="SMTP Server Password">
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<br style="clear:both;">
<div style="margin-left:2em; margin-bottom:5em; float:left;">
<div style="margin-bottom: 1em; ">
<input type="submit" value="Submit" name="submit">
</div>
<?php echo 'Current PHP version: ' . phpversion(); ?>
</div>
</div>
</form>
</body>
</html>

View File

@ -0,0 +1,146 @@
<?php
/**
* This example shows how to handle a simple contact form safely.
*/
//Import PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
//Don't run this unless we're handling a form submission
if (array_key_exists('email', $_POST)) {
date_default_timezone_set('Etc/UTC');
require '../vendor/autoload.php';
$isAjax = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&
strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest';
//Create a new PHPMailer instance
$mail = new PHPMailer();
//Send using SMTP to localhost (faster and safer than using mail()) requires a local mail server
//See other examples for how to use a remote server such as gmail
$mail->isSMTP();
$mail->Host = 'localhost';
$mail->Port = 25;
//Use a fixed address in your own domain as the from address
//**DO NOT** use the submitter's address here as it will be forgery
//and will cause your messages to fail SPF checks
$mail->setFrom('from@example.com', 'First Last');
//Choose who the message should be sent to
//You don't have to use a <select> like in this example, you can simply use a fixed address
//the important thing is *not* to trust an email address submitted from the form directly,
//as an attacker can substitute their own and try to use your form to send spam
$addresses = [
'sales' => 'sales@example.com',
'support' => 'support@example.com',
'accounts' => 'accounts@example.com',
];
//Validate address selection before trying to use it
if (array_key_exists('dept', $_POST) && array_key_exists($_POST['dept'], $addresses)) {
$mail->addAddress($addresses[$_POST['dept']]);
} else {
//Fall back to a fixed address if dept selection is invalid or missing
$mail->addAddress('support@example.com');
}
//Put the submitter's address in a reply-to header
//This will fail if the address provided is invalid,
//in which case we should ignore the whole request
if ($mail->addReplyTo($_POST['email'], $_POST['name'])) {
$mail->Subject = 'PHPMailer contact form';
//Keep it simple - don't use HTML
$mail->isHTML(false);
//Build a simple message body
$mail->Body = <<<EOT
Email: {$_POST['email']}
Name: {$_POST['name']}
Message: {$_POST['message']}
EOT;
//Send the message, check for errors
if (!$mail->send()) {
//The reason for failing to send will be in $mail->ErrorInfo
//but it's unsafe to display errors directly to users - process the error, log it on your server.
if ($isAjax) {
http_response_code(500);
}
$response = [
"status" => false,
"message" => 'Sorry, something went wrong. Please try again later.'
];
} else {
$response = [
"status" => true,
"message" => 'Message sent! Thanks for contacting us.'
];
}
} else {
$response = [
"status" => false,
"message" => 'Invalid email address, message ignored.'
];
}
if ($isAjax) {
header('Content-type:application/json;charset=utf-8');
echo json_encode($response);
exit();
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact form</title>
</head>
<body>
<h1>Contact us</h1>
<h2 id="status-message"><?php if (isset($response)) {
echo $response['message'];
}?></h2>
<form method="POST" id="contact-form">
<label for="name">Name: <input type="text" name="name" id="name"></label><br>
<label for="email">Email address: <input type="email" name="email" id="email"></label><br>
<label for="message">Message: <textarea name="message" id="message" rows="8" cols="20"></textarea></label><br>
<label for="dept">Send query to department:</label>
<select name="dept" id="dept">
<option value="sales">Sales</option>
<option value="support" selected>Technical support</option>
<option value="accounts">Accounts</option>
</select><br>
<input type="submit" value="Send">
</form>
<script type="application/javascript">
const form = document.getElementById("contact-form")
function email(data) {
const message = document.getElementById("status-message")
fetch("", {
method: "POST",
body: data,
headers: {
'X-Requested-With' : 'XMLHttpRequest'
}
})
.then(response => response.json())
.then(response => {message.innerHTML = response.message})
.catch(error => {
error.json().then(response => {
message.innerHTML = response.message
})
})
}
const submitEvent = form.addEventListener("submit", (event) => {
event.preventDefault();
const formData = new FormData(form);
email(formData);
})
</script>
</body>
</html>

View File

@ -1,19 +1,23 @@
<?php
/**
* This example shows how to handle a simple contact form.
* This example shows how to handle a simple contact form safely.
*/
//Import PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
$msg = '';
//Don't run this unless we're handling a form submission
if (array_key_exists('email', $_POST)) {
date_default_timezone_set('Etc/UTC');
require '../PHPMailerAutoload.php';
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP - requires a local mail server
//Faster and safer than using mail()
$mail = new PHPMailer();
//Send using SMTP to localhost (faster and safer than using mail()) requires a local mail server
//See other examples for how to use a remote server such as gmail
$mail->isSMTP();
$mail->Host = 'localhost';
$mail->Port = 25;
@ -22,8 +26,22 @@ if (array_key_exists('email', $_POST)) {
//**DO NOT** use the submitter's address here as it will be forgery
//and will cause your messages to fail SPF checks
$mail->setFrom('from@example.com', 'First Last');
//Send the message to yourself, or whoever should receive contact for submissions
$mail->addAddress('whoto@example.com', 'John Doe');
//Choose who the message should be sent to
//You don't have to use a <select> like in this example, you can simply use a fixed address
//the important thing is *not* to trust an email address submitted from the form directly,
//as an attacker can substitute their own and try to use your form to send spam
$addresses = [
'sales' => 'sales@example.com',
'support' => 'support@example.com',
'accounts' => 'accounts@example.com',
];
//Validate address selection before trying to use it
if (array_key_exists('dept', $_POST) && array_key_exists($_POST['dept'], $addresses)) {
$mail->addAddress($addresses[$_POST['dept']]);
} else {
//Fall back to a fixed address if dept selection is invalid or missing
$mail->addAddress('support@example.com');
}
//Put the submitter's address in a reply-to header
//This will fail if the address provided is invalid,
//in which case we should ignore the whole request
@ -40,7 +58,7 @@ EOT;
//Send the message, check for errors
if (!$mail->send()) {
//The reason for failing to send will be in $mail->ErrorInfo
//but you shouldn't display errors to users - process the error, log it on your server.
//but it's unsafe to display errors directly to users - process the error, log it on your server.
$msg = 'Sorry, something went wrong. Please try again later.';
} else {
$msg = 'Message sent! Thanks for contacting us.';
@ -65,6 +83,12 @@ EOT;
<label for="name">Name: <input type="text" name="name" id="name"></label><br>
<label for="email">Email address: <input type="email" name="email" id="email"></label><br>
<label for="message">Message: <textarea name="message" id="message" rows="8" cols="20"></textarea></label><br>
<label for="dept">Send query to department:</label>
<select name="dept" id="dept">
<option value="sales">Sales</option>
<option value="support" selected>Technical support</option>
<option value="accounts">Accounts</option>
</select><br>
<input type="submit" value="Send">
</form>
</body>

View File

@ -1,5 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>PHPMailer Test</title>

View File

@ -1,5 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHPMailer Test</title>
@ -10,12 +10,14 @@
<div align="center">
<a href="https://github.com/PHPMailer/PHPMailer/"><img src="images/phpmailer.png" height="90" width="340" alt="PHPMailer rocks"></a>
</div>
<p>This example uses <strong>HTML</strong>.</p>
<p>This example uses <strong>HTML</strong> with the UTF-8 Unicode charset.</p>
<p>Chinese text: 郵件內容為空</p>
<p>Russian text: Пустое тело сообщения</p>
<p>Armenian text: Հաղորդագրությունը դատարկ է</p>
<p>Czech text: Prázdné tělo zprávy</p>
<p>Emoji: <span style="font-size: 48px">😂 🦄 💥 📤 📧</span></p>
<p>Image data URL (base64)<img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="#"></p>
<p>Image data URL (URL-encoded)<img src="data:image/gif,GIF89a%01%00%01%00%00%00%00%21%F9%04%01%0A%00%01%00%2C%00%00%00%00%01%00%01%00%00%02%02L%01%00%3B" alt="#"></p>
</div>
</body>
</html>

View File

@ -1,9 +1,14 @@
<?php
/**
* This example shows how to make use of PHPMailer's exceptions for error handling.
*/
require '../PHPMailerAutoload.php';
//Import PHPMailer classes into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require '../vendor/autoload.php';
//Create a new PHPMailer instance
//Passing true to the constructor enables the use of exceptions for error handling
@ -19,7 +24,7 @@ try {
$mail->Subject = 'PHPMailer Exceptions test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//and convert the HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
@ -27,9 +32,9 @@ try {
//send the message
//Note that we don't need check the response from this because it will throw an exception if it has trouble
$mail->send();
echo "Message sent!";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
echo 'Message sent!';
} catch (Exception $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (\Exception $e) { //The leading slash means the Global PHP Exception class will be caught
echo $e->getMessage(); //Boring error messages from anything else!
}

72
examples/extending.phps Normal file
View File

@ -0,0 +1,72 @@
<?php
/**
* This example shows how to extend PHPMailer to simplify your coding.
* If PHPMailer doesn't do something the way you want it to, or your code
* contains too much boilerplate, don't edit the library files,
* create a subclass instead and customise that.
* That way all your changes will be retained when PHPMailer is updated.
*/
//Import PHPMailer classes into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
require '../vendor/autoload.php';
/**
* Use PHPMailer as a base class and extend it
*/
class MyPHPMailer extends PHPMailer
{
/**
* myPHPMailer constructor.
*
* @param bool|null $exceptions
* @param string $body A default HTML message body
*/
public function __construct($exceptions, $body = '')
{
//Don't forget to do this or other things may not be set correctly!
parent::__construct($exceptions);
//Set a default 'From' address
$this->setFrom('joe@example.com', 'Joe User');
//Send via SMTP
$this->isSMTP();
//Equivalent to setting `Host`, `Port` and `SMTPSecure` all at once
$this->Host = 'tls://smtp.example.com:587';
//Set an HTML and plain-text body, import relative image references
$this->msgHTML($body, './images/');
//Show debug output
$this->SMTPDebug = SMTP::DEBUG_SERVER;
//Inject a new debug output handler
$this->Debugoutput = static function ($str, $level) {
echo "Debug level $level; message: $str\n";
};
}
//Extend the send function
public function send()
{
$this->Subject = '[Yay for me!] ' . $this->Subject;
$r = parent::send();
echo 'I sent a message with subject ' . $this->Subject;
return $r;
}
}
//Now creating and sending a message becomes simpler when you use this class in your app code
try {
//Instantiate your new class, making use of the new `$body` parameter
$mail = new myPHPMailer(true, '<strong>This is the message body</strong>');
//Now you only need to set things that are different from the defaults you defined
$mail->addAddress('jane@example.com', 'Jane User');
$mail->Subject = 'Here is the subject';
$mail->addAttachment(__FILE__, 'myPHPMailer.php');
$mail->send(); //No need to check for errors - the exception handler will do it
} catch (Exception $e) {
//Note that this is catching the PHPMailer Exception class, not the global \Exception type!
echo 'Caught a ' . get_class($e) . ': ' . $e->getMessage();
}

View File

@ -1,55 +1,63 @@
<?php
/**
* This example shows settings to use when sending via Google's Gmail servers.
* This uses traditional id & password authentication - look at the gmail_xoauth.phps
* example to see how to use XOAUTH2.
* The IMAP section shows how to save this message to the 'Sent Mail' folder using IMAP commands.
*/
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
//Import PHPMailer classes into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
require '../PHPMailerAutoload.php';
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
$mail = new PHPMailer();
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//SMTP::DEBUG_OFF = off (for production use)
//SMTP::DEBUG_CLIENT = client messages
//SMTP::DEBUG_SERVER = client and server messages
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
//Set the hostname of the mail server
$mail->Host = 'smtp.gmail.com';
// use
// $mail->Host = gethostbyname('smtp.gmail.com');
// if your network does not support SMTP over IPv6
//Use `$mail->Host = gethostbyname('smtp.gmail.com');`
//if your network does not support SMTP over IPv6,
//though this may cause issues with TLS
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the SMTP port number:
// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or
// - 587 for SMTP+STARTTLS
$mail->Port = 465;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Set the encryption mechanism to use:
// - SMTPS (implicit TLS on port 465) or
// - STARTTLS (explicit TLS on port 587)
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = "username@gmail.com";
$mail->Username = 'username@gmail.com';
//Password to use for SMTP authentication
$mail->Password = "yourpassword";
$mail->Password = 'yourpassword';
//Set who the message is to be sent from
//Note that with gmail you can only use your account address (same as `Username`)
//or predefined aliases that you have configured within your account.
//Do not use user-submitted addresses in here
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
//This is a good place to put user-submitted addresses
$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
@ -60,7 +68,7 @@ $mail->Subject = 'PHPMailer GMail SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
@ -70,30 +78,29 @@ $mail->addAttachment('images/phpmailer_mini.png');
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo "Message sent!";
echo 'Message sent!';
//Section 2: IMAP
//Uncomment these to save your message in the 'Sent Mail' folder.
#if (save_mail($mail)) {
# echo "Message saved!";
#}
#save_mail($mail->getSentMIMEMessage());
}
//Section 2: IMAP
//IMAP commands requires the PHP IMAP Extension, found at: https://php.net/manual/en/imap.setup.php
//Function to call which uses the PHP imap_*() functions to save messages: https://php.net/manual/en/book.imap.php
//You can use imap_getmailboxes($imapStream, '/imap/ssl') to get a list of available folders or labels, this can
//be useful if you are trying to get this working on a non-Gmail IMAP server.
function save_mail($mail) {
//You can change 'Sent Mail' to any other folder or tag
$path = "{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail";
//This example uses the directorytree/imapengine IMAP library: https://imapengine.com
//Earlier versions of this code used the deprecated PHP imap_* functions.
function save_mail($message)
{
$mailbox = new \DirectoryTree\ImapEngine\Mailbox([
'host' => 'imap.gmail.com',
'port' => 993,
'encryption' => 'ssl',
'username' => 'user@example.com',
'password' => 'password',
]);
//Tell your server to open an IMAP connection using the same username and password as you used for SMTP
$imapStream = imap_open($path, $mail->Username, $mail->Password);
// Find the "sent" messages folder yours may have a different name.
$folder = $mailbox->folders()->find('Sent Mail');
$result = imap_append($imapStream, $path, $mail->getSentMIMEMessage());
imap_close($imapStream);
return $result;
$folder->messages()->append($message);
}

View File

@ -1,85 +1,121 @@
<?php
/**
* This example shows settings to use when sending via Google's Gmail servers.
* This example shows how to send via Google's Gmail servers using XOAUTH2 authentication
* using the league/oauth2-client to provide the OAuth2 token.
* To use a different OAuth2 library create a wrapper class that implements OAuthTokenProvider and
* pass that wrapper class to PHPMailer::setOAuth().
*/
//Import PHPMailer classes into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\OAuth;
//Alias the League Google OAuth2 provider class
use League\OAuth2\Client\Provider\Google;
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
require '../PHPMailerAutoload.php';
//Load dependencies from composer
//If this causes an error, run 'composer install'
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailerOAuth;
$mail = new PHPMailer();
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 0;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//SMTP::DEBUG_OFF = off (for production use)
//SMTP::DEBUG_CLIENT = client messages
//SMTP::DEBUG_SERVER = client and server messages
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
//Set the hostname of the mail server
$mail->Host = 'smtp.gmail.com';
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the SMTP port number:
// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or
// - 587 for SMTP+STARTTLS
$mail->Port = 465;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Set the encryption mechanism to use:
// - SMTPS (implicit TLS on port 465) or
// - STARTTLS (explicit TLS on port 587)
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Set AuthType
//Set AuthType to use XOAUTH2
$mail->AuthType = 'XOAUTH2';
//User Email to use for SMTP authentication - user who gave consent to our app
$mail->oauthUserEmail = "from@gmail.com";
//Start Option 1: Use league/oauth2-client as OAuth2 token provider
//Fill in authentication details here
//Either the gmail account owner, or the user that gave consent
$email = 'someone@gmail.com';
$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
//Obtained From Google Developer Console
$mail->oauthClientId = "RANDOMCHARS-----duv1n2.apps.googleusercontent.com";
//Obtained by configuring and running get_oauth_token.php
//after setting up an app in Google Developer Console.
$refreshToken = 'RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0';
//Obtained From Google Developer Console
$mail->oauthClientSecret = "RANDOMCHARS-----lGyjPcRtvP";
//Create a new OAuth2 provider instance
$provider = new Google(
[
'clientId' => $clientId,
'clientSecret' => $clientSecret,
]
);
//Obtained By running get_oauth_token.php after setting up APP in Google Developer Console.
//Set Redirect URI in Developer Console as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
// eg: http://localhost/phpmail/get_oauth_token.php
$mail->oauthRefreshToken = "RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0";
//Pass the OAuth provider instance to PHPMailer
$mail->setOAuth(
new OAuth(
[
'provider' => $provider,
'clientId' => $clientId,
'clientSecret' => $clientSecret,
'refreshToken' => $refreshToken,
'userName' => $email,
]
)
);
//End Option 1
//Option 2: Another OAuth library as OAuth2 token provider
//Set up the other oauth library as per its documentation
//Then create the wrapper class that implements OAuthTokenProvider
$oauthTokenProvider = new MyOAuthTokenProvider(/* Email, ClientId, ClientSecret, etc. */);
//Pass the implementation of OAuthTokenProvider to PHPMailer
$mail->setOAuth($oauthTokenProvider);
//End Option 2
//Set who the message is to be sent from
//For gmail, this generally needs to be the same as the user you logged in as
$mail->setFrom('from@example.com', 'First Last');
$mail->setFrom($email, 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto@example.com', 'John Doe');
$mail->addAddress('someone@gmail.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer GMail SMTP test';
$mail->Subject = 'PHPMailer GMail XOAUTH2 SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->CharSet = PHPMailer::CHARSET_UTF8;
$mail->msgHTML(file_get_contents('contentsutf8.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo "Message sent!";
echo 'Message sent!';
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,209 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 1280 640" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g id="Background" transform="matrix(8.70744,5.33177e-16,-5.33177e-16,-4.35372,-4208.74,2147.69)">
<path d="M630.351,346.3L483.35,346.3L483.35,493.301L630.351,493.301L630.351,346.3L630.351,346.3Z" style="fill:rgb(51,51,51);fill-rule:nonzero;"/>
</g>
<g id="PHPMailer" transform="matrix(0.986688,0,0,0.986688,12.9314,1.29196)">
<g transform="matrix(1.14074,0,0,1,-76.5738,0)">
<g id="path68" transform="matrix(2.14981,0,0,-2.46335,-776.134,1230.68)">
<path d="M614.574,416.832L584.18,445.184L584.18,381.999L644.963,381.999L644.963,445.181L614.574,416.832Z" style="fill:rgb(248,203,102);fill-rule:nonzero;"/>
</g>
<g id="path74" transform="matrix(2.14981,0,0,-2.56665,-776.135,1278.22)">
<path d="M644.989,460.2L584.155,460.2L614.574,432.967L644.989,460.2Z" style="fill:rgb(248,203,102);fill-rule:nonzero;"/>
</g>
</g>
<g>
<g transform="matrix(260.4,0,0,280,52.6877,289.686)">
<path d="M0.488,-0.47C0.488,-0.441 0.484,-0.412 0.476,-0.385C0.468,-0.357 0.455,-0.333 0.439,-0.312C0.422,-0.29 0.4,-0.274 0.374,-0.261C0.348,-0.248 0.318,-0.242 0.282,-0.242L0.173,-0.242L0.173,0L0.055,0L0.055,-0.688L0.277,-0.688C0.314,-0.688 0.345,-0.683 0.371,-0.672C0.398,-0.662 0.419,-0.647 0.437,-0.627C0.454,-0.608 0.467,-0.585 0.476,-0.559C0.484,-0.532 0.488,-0.502 0.488,-0.47ZM0.369,-0.468C0.369,-0.503 0.36,-0.53 0.343,-0.549C0.326,-0.567 0.299,-0.576 0.264,-0.576L0.173,-0.576L0.173,-0.353L0.268,-0.353C0.285,-0.353 0.3,-0.356 0.313,-0.361C0.326,-0.367 0.336,-0.375 0.345,-0.385C0.353,-0.395 0.359,-0.407 0.363,-0.421C0.367,-0.435 0.369,-0.451 0.369,-0.468Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(260.4,0,0,280,184.157,289.686)">
<path d="M0.38,0L0.38,-0.273L0.173,-0.273L0.173,0L0.055,0L0.055,-0.688L0.173,-0.688L0.173,-0.382L0.38,-0.382L0.38,-0.688L0.498,-0.688L0.498,0L0.38,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(260.4,0,0,280,327.324,289.686)">
<path d="M0.488,-0.47C0.488,-0.441 0.484,-0.412 0.476,-0.385C0.468,-0.357 0.455,-0.333 0.439,-0.312C0.422,-0.29 0.4,-0.274 0.374,-0.261C0.348,-0.248 0.318,-0.242 0.282,-0.242L0.173,-0.242L0.173,0L0.055,0L0.055,-0.688L0.277,-0.688C0.314,-0.688 0.345,-0.683 0.371,-0.672C0.398,-0.662 0.419,-0.647 0.437,-0.627C0.454,-0.608 0.467,-0.585 0.476,-0.559C0.484,-0.532 0.488,-0.502 0.488,-0.47ZM0.369,-0.468C0.369,-0.503 0.36,-0.53 0.343,-0.549C0.326,-0.567 0.299,-0.576 0.264,-0.576L0.173,-0.576L0.173,-0.353L0.268,-0.353C0.285,-0.353 0.3,-0.356 0.313,-0.361C0.326,-0.367 0.336,-0.375 0.345,-0.385C0.353,-0.395 0.359,-0.407 0.363,-0.421C0.367,-0.435 0.369,-0.451 0.369,-0.468Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
</g>
<g>
<g transform="matrix(260.4,0,0,280,640.738,289.686)">
<path d="M0.453,0L0.352,-0.161L0.128,-0.161L0.128,0L0.021,0L0.021,-0.688L0.128,-0.688L0.57,0L0.453,0ZM0.282,-0.27L0.128,-0.515L0.128,-0.27L0.282,-0.27Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(260.4,0,0,280,787.905,289.686)">
<rect x="0.055" y="-0.688" width="0.119" height="0.688" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(260.4,0,0,280,816.346,289.686)">
<path d="M0.124,0L0.124,-0.688L0.242,-0.688L0.242,-0.111L0.499,-0.111L0.499,0L0.124,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(260.4,0,0,280,936.864,289.686)">
<path d="M0.089,0L0.089,-0.688L0.483,-0.688L0.483,-0.577L0.207,-0.577L0.207,-0.382L0.459,-0.382L0.459,-0.271L0.207,-0.271L0.207,-0.111L0.499,-0.111L0.499,0L0.089,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(233.533,0,0,280,1069.8,289.686)">
<path d="M0.442,0L0.312,-0.261L0.173,-0.261L0.173,0L0.055,0L0.055,-0.688L0.336,-0.688C0.372,-0.688 0.402,-0.683 0.429,-0.674C0.455,-0.664 0.477,-0.65 0.495,-0.633C0.512,-0.615 0.525,-0.593 0.534,-0.568C0.543,-0.543 0.547,-0.514 0.547,-0.483C0.547,-0.457 0.544,-0.434 0.538,-0.412C0.531,-0.391 0.523,-0.372 0.512,-0.355C0.501,-0.339 0.487,-0.325 0.472,-0.314C0.457,-0.302 0.44,-0.294 0.422,-0.289L0.575,0L0.442,0ZM0.428,-0.477C0.428,-0.511 0.419,-0.535 0.401,-0.552C0.383,-0.568 0.357,-0.576 0.324,-0.576L0.173,-0.576L0.173,-0.373L0.327,-0.373C0.345,-0.373 0.36,-0.376 0.373,-0.381C0.385,-0.386 0.396,-0.393 0.404,-0.402C0.412,-0.411 0.418,-0.422 0.422,-0.435C0.426,-0.448 0.428,-0.462 0.428,-0.477Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
</g>
</g>
<g transform="matrix(1,0,0,1,73.8296,353)">
<g transform="matrix(41,0,0,41,0,29.709)">
<path d="M0.352,-0.612L0.352,0L0.259,0L0.259,-0.612L0.022,-0.612L0.022,-0.688L0.588,-0.688L0.588,-0.612L0.352,-0.612Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,25.0444,29.709)">
<path d="M0.155,-0.438C0.165,-0.456 0.175,-0.471 0.187,-0.484C0.198,-0.496 0.21,-0.507 0.224,-0.515C0.238,-0.523 0.253,-0.529 0.269,-0.532C0.285,-0.536 0.304,-0.538 0.324,-0.538C0.358,-0.538 0.385,-0.534 0.407,-0.524C0.429,-0.515 0.446,-0.503 0.458,-0.486C0.471,-0.47 0.479,-0.45 0.484,-0.427C0.489,-0.404 0.491,-0.379 0.491,-0.352L0.491,0L0.403,0L0.403,-0.335C0.403,-0.357 0.401,-0.377 0.399,-0.394C0.396,-0.411 0.391,-0.425 0.383,-0.436C0.375,-0.448 0.364,-0.456 0.35,-0.462C0.335,-0.467 0.317,-0.47 0.294,-0.47C0.273,-0.47 0.254,-0.466 0.238,-0.459C0.221,-0.451 0.206,-0.441 0.195,-0.427C0.183,-0.414 0.174,-0.397 0.167,-0.377C0.16,-0.358 0.157,-0.336 0.157,-0.312L0.157,0L0.069,0L0.069,-0.725L0.157,-0.725L0.157,-0.536C0.157,-0.525 0.157,-0.515 0.157,-0.504C0.156,-0.493 0.156,-0.483 0.156,-0.474C0.155,-0.465 0.155,-0.457 0.154,-0.451C0.154,-0.445 0.154,-0.44 0.153,-0.438L0.155,-0.438Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,47.8467,29.709)">
<path d="M0.135,-0.246C0.135,-0.218 0.138,-0.192 0.143,-0.169C0.149,-0.146 0.158,-0.126 0.17,-0.109C0.182,-0.092 0.197,-0.079 0.215,-0.07C0.234,-0.061 0.256,-0.056 0.282,-0.056C0.32,-0.056 0.351,-0.064 0.374,-0.079C0.397,-0.094 0.412,-0.114 0.42,-0.137L0.498,-0.115C0.492,-0.101 0.484,-0.086 0.474,-0.071C0.464,-0.056 0.451,-0.043 0.435,-0.031C0.418,-0.019 0.397,-0.009 0.372,-0.002C0.347,0.006 0.317,0.01 0.282,0.01C0.204,0.01 0.145,-0.014 0.104,-0.06C0.063,-0.107 0.042,-0.176 0.042,-0.268C0.042,-0.317 0.049,-0.359 0.061,-0.393C0.073,-0.428 0.09,-0.456 0.112,-0.477C0.133,-0.499 0.158,-0.514 0.187,-0.524C0.216,-0.533 0.246,-0.538 0.279,-0.538C0.323,-0.538 0.36,-0.531 0.39,-0.517C0.42,-0.502 0.444,-0.483 0.462,-0.457C0.48,-0.432 0.493,-0.402 0.5,-0.368C0.508,-0.334 0.512,-0.297 0.512,-0.257L0.512,-0.246L0.135,-0.246ZM0.421,-0.313C0.416,-0.369 0.402,-0.409 0.378,-0.435C0.355,-0.46 0.321,-0.473 0.277,-0.473C0.263,-0.473 0.247,-0.471 0.231,-0.466C0.215,-0.461 0.2,-0.453 0.187,-0.441C0.173,-0.429 0.161,-0.413 0.152,-0.392C0.142,-0.371 0.137,-0.345 0.136,-0.313L0.421,-0.313Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,82.04,29.709)">
<path d="M0.614,-0.481C0.614,-0.451 0.609,-0.423 0.599,-0.397C0.589,-0.371 0.575,-0.349 0.555,-0.33C0.535,-0.311 0.511,-0.296 0.481,-0.285C0.451,-0.274 0.417,-0.268 0.377,-0.268L0.175,-0.268L0.175,0L0.082,0L0.082,-0.688L0.372,-0.688C0.412,-0.688 0.448,-0.683 0.478,-0.673C0.508,-0.663 0.534,-0.649 0.554,-0.631C0.574,-0.613 0.589,-0.591 0.599,-0.566C0.609,-0.54 0.614,-0.512 0.614,-0.481ZM0.521,-0.48C0.521,-0.524 0.507,-0.557 0.48,-0.579C0.454,-0.602 0.414,-0.613 0.36,-0.613L0.175,-0.613L0.175,-0.342L0.364,-0.342C0.418,-0.342 0.457,-0.354 0.483,-0.377C0.508,-0.401 0.521,-0.435 0.521,-0.48Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,109.387,29.709)">
<path d="M0.547,0L0.547,-0.319L0.175,-0.319L0.175,0L0.082,0L0.082,-0.688L0.175,-0.688L0.175,-0.397L0.547,-0.397L0.547,-0.688L0.641,-0.688L0.641,0L0.547,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,138.996,29.709)">
<path d="M0.614,-0.481C0.614,-0.451 0.609,-0.423 0.599,-0.397C0.589,-0.371 0.575,-0.349 0.555,-0.33C0.535,-0.311 0.511,-0.296 0.481,-0.285C0.451,-0.274 0.417,-0.268 0.377,-0.268L0.175,-0.268L0.175,0L0.082,0L0.082,-0.688L0.372,-0.688C0.412,-0.688 0.448,-0.683 0.478,-0.673C0.508,-0.663 0.534,-0.649 0.554,-0.631C0.574,-0.613 0.589,-0.591 0.599,-0.566C0.609,-0.54 0.614,-0.512 0.614,-0.481ZM0.521,-0.48C0.521,-0.524 0.507,-0.557 0.48,-0.579C0.454,-0.602 0.414,-0.613 0.36,-0.613L0.175,-0.613L0.175,-0.342L0.364,-0.342C0.418,-0.342 0.457,-0.354 0.483,-0.377C0.508,-0.401 0.521,-0.435 0.521,-0.48Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,176.993,29.709)">
<path d="M0.135,-0.246C0.135,-0.218 0.138,-0.192 0.143,-0.169C0.149,-0.146 0.158,-0.126 0.17,-0.109C0.182,-0.092 0.197,-0.079 0.215,-0.07C0.234,-0.061 0.256,-0.056 0.282,-0.056C0.32,-0.056 0.351,-0.064 0.374,-0.079C0.397,-0.094 0.412,-0.114 0.42,-0.137L0.498,-0.115C0.492,-0.101 0.484,-0.086 0.474,-0.071C0.464,-0.056 0.451,-0.043 0.435,-0.031C0.418,-0.019 0.397,-0.009 0.372,-0.002C0.347,0.006 0.317,0.01 0.282,0.01C0.204,0.01 0.145,-0.014 0.104,-0.06C0.063,-0.107 0.042,-0.176 0.042,-0.268C0.042,-0.317 0.049,-0.359 0.061,-0.393C0.073,-0.428 0.09,-0.456 0.112,-0.477C0.133,-0.499 0.158,-0.514 0.187,-0.524C0.216,-0.533 0.246,-0.538 0.279,-0.538C0.323,-0.538 0.36,-0.531 0.39,-0.517C0.42,-0.502 0.444,-0.483 0.462,-0.457C0.48,-0.432 0.493,-0.402 0.5,-0.368C0.508,-0.334 0.512,-0.297 0.512,-0.257L0.512,-0.246L0.135,-0.246ZM0.421,-0.313C0.416,-0.369 0.402,-0.409 0.378,-0.435C0.355,-0.46 0.321,-0.473 0.277,-0.473C0.263,-0.473 0.247,-0.471 0.231,-0.466C0.215,-0.461 0.2,-0.453 0.187,-0.441C0.173,-0.429 0.161,-0.413 0.152,-0.392C0.142,-0.371 0.137,-0.345 0.136,-0.313L0.421,-0.313Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,199.795,29.709)">
<path d="M0.375,0L0.375,-0.335C0.375,-0.361 0.373,-0.382 0.37,-0.399C0.367,-0.417 0.361,-0.431 0.354,-0.441C0.346,-0.452 0.336,-0.459 0.324,-0.464C0.311,-0.468 0.296,-0.47 0.278,-0.47C0.26,-0.47 0.243,-0.467 0.228,-0.459C0.213,-0.452 0.2,-0.441 0.19,-0.427C0.179,-0.414 0.171,-0.397 0.165,-0.376C0.16,-0.356 0.157,-0.333 0.157,-0.306L0.157,0L0.069,0L0.069,-0.416C0.069,-0.427 0.069,-0.438 0.069,-0.45C0.069,-0.463 0.069,-0.474 0.068,-0.485C0.068,-0.496 0.068,-0.505 0.067,-0.513C0.067,-0.521 0.067,-0.526 0.066,-0.528L0.149,-0.528C0.15,-0.527 0.15,-0.522 0.15,-0.515C0.151,-0.508 0.151,-0.5 0.152,-0.49C0.152,-0.481 0.153,-0.472 0.153,-0.462C0.153,-0.453 0.153,-0.444 0.153,-0.438L0.155,-0.438C0.163,-0.453 0.171,-0.467 0.18,-0.479C0.189,-0.492 0.2,-0.502 0.212,-0.511C0.224,-0.52 0.238,-0.526 0.254,-0.531C0.27,-0.536 0.288,-0.538 0.309,-0.538C0.349,-0.538 0.381,-0.53 0.404,-0.514C0.427,-0.498 0.444,-0.473 0.453,-0.438L0.454,-0.438C0.462,-0.453 0.471,-0.467 0.48,-0.479C0.49,-0.492 0.502,-0.502 0.515,-0.511C0.528,-0.52 0.542,-0.526 0.559,-0.531C0.575,-0.536 0.593,-0.538 0.614,-0.538C0.641,-0.538 0.664,-0.535 0.683,-0.527C0.703,-0.52 0.719,-0.509 0.731,-0.494C0.743,-0.479 0.752,-0.46 0.758,-0.436C0.764,-0.413 0.767,-0.385 0.767,-0.352L0.767,0L0.68,0L0.68,-0.335C0.68,-0.361 0.679,-0.382 0.675,-0.399C0.672,-0.417 0.667,-0.431 0.659,-0.441C0.651,-0.452 0.641,-0.459 0.629,-0.464C0.617,-0.468 0.601,-0.47 0.583,-0.47C0.565,-0.47 0.548,-0.467 0.533,-0.46C0.518,-0.453 0.505,-0.442 0.495,-0.429C0.484,-0.415 0.476,-0.398 0.47,-0.377C0.465,-0.357 0.462,-0.333 0.462,-0.306L0.462,0L0.375,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,233.948,29.709)">
<path d="M0.202,0.01C0.149,0.01 0.109,-0.004 0.083,-0.032C0.056,-0.06 0.042,-0.099 0.042,-0.147C0.042,-0.182 0.049,-0.211 0.062,-0.233C0.075,-0.255 0.093,-0.273 0.114,-0.286C0.135,-0.298 0.16,-0.307 0.187,-0.312C0.214,-0.317 0.242,-0.32 0.271,-0.32L0.389,-0.322L0.389,-0.351C0.389,-0.373 0.387,-0.391 0.382,-0.407C0.378,-0.422 0.371,-0.434 0.361,-0.444C0.352,-0.453 0.34,-0.46 0.326,-0.465C0.312,-0.469 0.295,-0.471 0.276,-0.471C0.259,-0.471 0.244,-0.47 0.23,-0.468C0.216,-0.465 0.204,-0.461 0.194,-0.454C0.184,-0.448 0.176,-0.439 0.17,-0.428C0.164,-0.418 0.16,-0.404 0.158,-0.387L0.066,-0.396C0.069,-0.416 0.075,-0.435 0.084,-0.453C0.094,-0.47 0.107,-0.485 0.123,-0.498C0.14,-0.511 0.161,-0.521 0.186,-0.528C0.212,-0.535 0.242,-0.538 0.278,-0.538C0.344,-0.538 0.394,-0.523 0.428,-0.492C0.461,-0.462 0.478,-0.418 0.478,-0.36L0.478,-0.133C0.478,-0.107 0.481,-0.087 0.488,-0.074C0.495,-0.061 0.508,-0.054 0.527,-0.054C0.532,-0.054 0.537,-0.055 0.542,-0.055C0.547,-0.056 0.552,-0.057 0.556,-0.058L0.556,-0.003C0.545,0 0.534,0.002 0.523,0.003C0.512,0.004 0.501,0.005 0.488,0.005C0.472,0.005 0.457,0.003 0.446,-0.002C0.434,-0.006 0.424,-0.013 0.417,-0.022C0.409,-0.031 0.403,-0.042 0.399,-0.055C0.396,-0.068 0.393,-0.083 0.392,-0.101L0.389,-0.101C0.38,-0.084 0.369,-0.069 0.358,-0.055C0.347,-0.042 0.334,-0.03 0.319,-0.02C0.304,-0.011 0.287,-0.003 0.268,0.002C0.249,0.007 0.227,0.01 0.202,0.01ZM0.222,-0.056C0.25,-0.056 0.275,-0.061 0.296,-0.072C0.317,-0.082 0.334,-0.095 0.348,-0.111C0.362,-0.127 0.372,-0.144 0.379,-0.163C0.386,-0.182 0.389,-0.2 0.389,-0.217L0.389,-0.261L0.293,-0.259C0.271,-0.258 0.251,-0.257 0.232,-0.254C0.212,-0.251 0.195,-0.246 0.181,-0.238C0.166,-0.23 0.154,-0.218 0.146,-0.204C0.137,-0.189 0.133,-0.17 0.133,-0.146C0.133,-0.117 0.141,-0.095 0.156,-0.08C0.171,-0.064 0.194,-0.056 0.222,-0.056Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,256.75,29.709)">
<path d="M0.067,-0.641L0.067,-0.725L0.155,-0.725L0.155,-0.641L0.067,-0.641ZM0.067,0L0.067,-0.528L0.155,-0.528L0.155,0L0.067,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,265.859,29.709)">
<rect x="0.067" y="-0.725" width="0.088" height="0.725" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,286.359,29.709)">
<path d="M0.134,-0.267C0.134,-0.236 0.136,-0.208 0.141,-0.183C0.145,-0.158 0.153,-0.136 0.163,-0.117C0.174,-0.099 0.187,-0.085 0.204,-0.075C0.221,-0.065 0.243,-0.06 0.268,-0.06C0.299,-0.06 0.325,-0.068 0.346,-0.085C0.367,-0.102 0.38,-0.128 0.385,-0.163L0.474,-0.157C0.471,-0.135 0.464,-0.114 0.455,-0.094C0.445,-0.074 0.432,-0.056 0.415,-0.041C0.398,-0.026 0.378,-0.013 0.354,-0.004C0.329,0.005 0.302,0.01 0.27,0.01C0.229,0.01 0.194,0.003 0.165,-0.011C0.136,-0.025 0.112,-0.045 0.094,-0.069C0.076,-0.094 0.063,-0.123 0.055,-0.156C0.047,-0.189 0.042,-0.226 0.042,-0.265C0.042,-0.3 0.045,-0.331 0.051,-0.359C0.057,-0.386 0.065,-0.41 0.076,-0.43C0.087,-0.45 0.099,-0.467 0.113,-0.481C0.128,-0.495 0.143,-0.506 0.16,-0.514C0.177,-0.523 0.194,-0.529 0.213,-0.532C0.231,-0.536 0.25,-0.538 0.269,-0.538C0.299,-0.538 0.325,-0.534 0.348,-0.526C0.371,-0.518 0.391,-0.507 0.408,-0.492C0.425,-0.478 0.438,-0.462 0.449,-0.442C0.459,-0.423 0.466,-0.403 0.471,-0.38L0.38,-0.374C0.376,-0.403 0.364,-0.426 0.346,-0.443C0.327,-0.461 0.301,-0.469 0.267,-0.469C0.242,-0.469 0.221,-0.465 0.204,-0.457C0.187,-0.448 0.174,-0.436 0.163,-0.419C0.153,-0.402 0.145,-0.381 0.141,-0.356C0.136,-0.331 0.134,-0.301 0.134,-0.267Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,306.859,29.709)">
<rect x="0.067" y="-0.725" width="0.088" height="0.725" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,315.968,29.709)">
<path d="M0.202,0.01C0.149,0.01 0.109,-0.004 0.083,-0.032C0.056,-0.06 0.042,-0.099 0.042,-0.147C0.042,-0.182 0.049,-0.211 0.062,-0.233C0.075,-0.255 0.093,-0.273 0.114,-0.286C0.135,-0.298 0.16,-0.307 0.187,-0.312C0.214,-0.317 0.242,-0.32 0.271,-0.32L0.389,-0.322L0.389,-0.351C0.389,-0.373 0.387,-0.391 0.382,-0.407C0.378,-0.422 0.371,-0.434 0.361,-0.444C0.352,-0.453 0.34,-0.46 0.326,-0.465C0.312,-0.469 0.295,-0.471 0.276,-0.471C0.259,-0.471 0.244,-0.47 0.23,-0.468C0.216,-0.465 0.204,-0.461 0.194,-0.454C0.184,-0.448 0.176,-0.439 0.17,-0.428C0.164,-0.418 0.16,-0.404 0.158,-0.387L0.066,-0.396C0.069,-0.416 0.075,-0.435 0.084,-0.453C0.094,-0.47 0.107,-0.485 0.123,-0.498C0.14,-0.511 0.161,-0.521 0.186,-0.528C0.212,-0.535 0.242,-0.538 0.278,-0.538C0.344,-0.538 0.394,-0.523 0.428,-0.492C0.461,-0.462 0.478,-0.418 0.478,-0.36L0.478,-0.133C0.478,-0.107 0.481,-0.087 0.488,-0.074C0.495,-0.061 0.508,-0.054 0.527,-0.054C0.532,-0.054 0.537,-0.055 0.542,-0.055C0.547,-0.056 0.552,-0.057 0.556,-0.058L0.556,-0.003C0.545,0 0.534,0.002 0.523,0.003C0.512,0.004 0.501,0.005 0.488,0.005C0.472,0.005 0.457,0.003 0.446,-0.002C0.434,-0.006 0.424,-0.013 0.417,-0.022C0.409,-0.031 0.403,-0.042 0.399,-0.055C0.396,-0.068 0.393,-0.083 0.392,-0.101L0.389,-0.101C0.38,-0.084 0.369,-0.069 0.358,-0.055C0.347,-0.042 0.334,-0.03 0.319,-0.02C0.304,-0.011 0.287,-0.003 0.268,0.002C0.249,0.007 0.227,0.01 0.202,0.01ZM0.222,-0.056C0.25,-0.056 0.275,-0.061 0.296,-0.072C0.317,-0.082 0.334,-0.095 0.348,-0.111C0.362,-0.127 0.372,-0.144 0.379,-0.163C0.386,-0.182 0.389,-0.2 0.389,-0.217L0.389,-0.261L0.293,-0.259C0.271,-0.258 0.251,-0.257 0.232,-0.254C0.212,-0.251 0.195,-0.246 0.181,-0.238C0.166,-0.23 0.154,-0.218 0.146,-0.204C0.137,-0.189 0.133,-0.17 0.133,-0.146C0.133,-0.117 0.141,-0.095 0.156,-0.08C0.171,-0.064 0.194,-0.056 0.222,-0.056Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,338.771,29.709)">
<path d="M0.464,-0.146C0.464,-0.121 0.459,-0.099 0.449,-0.08C0.44,-0.06 0.426,-0.044 0.408,-0.031C0.389,-0.018 0.367,-0.008 0.341,-0.001C0.314,0.006 0.284,0.01 0.25,0.01C0.219,0.01 0.191,0.007 0.167,0.003C0.142,-0.002 0.121,-0.01 0.102,-0.02C0.083,-0.03 0.068,-0.044 0.055,-0.061C0.043,-0.078 0.034,-0.099 0.028,-0.124L0.105,-0.139C0.113,-0.111 0.128,-0.09 0.152,-0.077C0.175,-0.064 0.208,-0.057 0.25,-0.057C0.268,-0.057 0.286,-0.058 0.302,-0.061C0.317,-0.064 0.331,-0.068 0.342,-0.074C0.354,-0.081 0.363,-0.089 0.369,-0.1C0.375,-0.11 0.378,-0.124 0.378,-0.139C0.378,-0.155 0.375,-0.168 0.367,-0.178C0.36,-0.189 0.349,-0.197 0.336,-0.204C0.323,-0.211 0.306,-0.217 0.287,-0.222C0.268,-0.227 0.247,-0.233 0.225,-0.239C0.203,-0.244 0.182,-0.25 0.162,-0.257C0.141,-0.264 0.122,-0.273 0.105,-0.284C0.088,-0.296 0.075,-0.31 0.064,-0.326C0.054,-0.343 0.049,-0.364 0.049,-0.389C0.049,-0.437 0.066,-0.474 0.1,-0.499C0.135,-0.524 0.185,-0.537 0.25,-0.537C0.309,-0.537 0.355,-0.526 0.389,-0.506C0.424,-0.485 0.445,-0.452 0.455,-0.407L0.375,-0.397C0.373,-0.411 0.367,-0.423 0.359,-0.432C0.352,-0.441 0.342,-0.449 0.331,-0.454C0.32,-0.46 0.308,-0.464 0.294,-0.467C0.28,-0.469 0.265,-0.47 0.25,-0.47C0.211,-0.47 0.181,-0.464 0.163,-0.452C0.144,-0.44 0.134,-0.422 0.134,-0.397C0.134,-0.383 0.138,-0.371 0.145,-0.362C0.152,-0.353 0.162,-0.345 0.174,-0.339C0.187,-0.332 0.202,-0.327 0.219,-0.322C0.237,-0.317 0.256,-0.312 0.277,-0.307C0.291,-0.304 0.306,-0.3 0.32,-0.296C0.335,-0.292 0.349,-0.287 0.363,-0.281C0.377,-0.275 0.39,-0.269 0.402,-0.261C0.414,-0.253 0.425,-0.244 0.434,-0.233C0.443,-0.223 0.45,-0.21 0.456,-0.196C0.461,-0.181 0.464,-0.165 0.464,-0.146Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,359.271,29.709)">
<path d="M0.464,-0.146C0.464,-0.121 0.459,-0.099 0.449,-0.08C0.44,-0.06 0.426,-0.044 0.408,-0.031C0.389,-0.018 0.367,-0.008 0.341,-0.001C0.314,0.006 0.284,0.01 0.25,0.01C0.219,0.01 0.191,0.007 0.167,0.003C0.142,-0.002 0.121,-0.01 0.102,-0.02C0.083,-0.03 0.068,-0.044 0.055,-0.061C0.043,-0.078 0.034,-0.099 0.028,-0.124L0.105,-0.139C0.113,-0.111 0.128,-0.09 0.152,-0.077C0.175,-0.064 0.208,-0.057 0.25,-0.057C0.268,-0.057 0.286,-0.058 0.302,-0.061C0.317,-0.064 0.331,-0.068 0.342,-0.074C0.354,-0.081 0.363,-0.089 0.369,-0.1C0.375,-0.11 0.378,-0.124 0.378,-0.139C0.378,-0.155 0.375,-0.168 0.367,-0.178C0.36,-0.189 0.349,-0.197 0.336,-0.204C0.323,-0.211 0.306,-0.217 0.287,-0.222C0.268,-0.227 0.247,-0.233 0.225,-0.239C0.203,-0.244 0.182,-0.25 0.162,-0.257C0.141,-0.264 0.122,-0.273 0.105,-0.284C0.088,-0.296 0.075,-0.31 0.064,-0.326C0.054,-0.343 0.049,-0.364 0.049,-0.389C0.049,-0.437 0.066,-0.474 0.1,-0.499C0.135,-0.524 0.185,-0.537 0.25,-0.537C0.309,-0.537 0.355,-0.526 0.389,-0.506C0.424,-0.485 0.445,-0.452 0.455,-0.407L0.375,-0.397C0.373,-0.411 0.367,-0.423 0.359,-0.432C0.352,-0.441 0.342,-0.449 0.331,-0.454C0.32,-0.46 0.308,-0.464 0.294,-0.467C0.28,-0.469 0.265,-0.47 0.25,-0.47C0.211,-0.47 0.181,-0.464 0.163,-0.452C0.144,-0.44 0.134,-0.422 0.134,-0.397C0.134,-0.383 0.138,-0.371 0.145,-0.362C0.152,-0.353 0.162,-0.345 0.174,-0.339C0.187,-0.332 0.202,-0.327 0.219,-0.322C0.237,-0.317 0.256,-0.312 0.277,-0.307C0.291,-0.304 0.306,-0.3 0.32,-0.296C0.335,-0.292 0.349,-0.287 0.363,-0.281C0.377,-0.275 0.39,-0.269 0.402,-0.261C0.414,-0.253 0.425,-0.244 0.434,-0.233C0.443,-0.223 0.45,-0.21 0.456,-0.196C0.461,-0.181 0.464,-0.165 0.464,-0.146Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,391.162,29.709)">
<path d="M0.155,-0.438C0.165,-0.456 0.175,-0.471 0.187,-0.484C0.198,-0.496 0.21,-0.507 0.224,-0.515C0.238,-0.523 0.253,-0.529 0.269,-0.532C0.285,-0.536 0.304,-0.538 0.324,-0.538C0.358,-0.538 0.385,-0.534 0.407,-0.524C0.429,-0.515 0.446,-0.503 0.458,-0.486C0.471,-0.47 0.479,-0.45 0.484,-0.427C0.489,-0.404 0.491,-0.379 0.491,-0.352L0.491,0L0.403,0L0.403,-0.335C0.403,-0.357 0.401,-0.377 0.399,-0.394C0.396,-0.411 0.391,-0.425 0.383,-0.436C0.375,-0.448 0.364,-0.456 0.35,-0.462C0.335,-0.467 0.317,-0.47 0.294,-0.47C0.273,-0.47 0.254,-0.466 0.238,-0.459C0.221,-0.451 0.206,-0.441 0.195,-0.427C0.183,-0.414 0.174,-0.397 0.167,-0.377C0.16,-0.358 0.157,-0.336 0.157,-0.312L0.157,0L0.069,0L0.069,-0.725L0.157,-0.725L0.157,-0.536C0.157,-0.525 0.157,-0.515 0.157,-0.504C0.156,-0.493 0.156,-0.483 0.156,-0.474C0.155,-0.465 0.155,-0.457 0.154,-0.451C0.154,-0.445 0.154,-0.44 0.153,-0.438L0.155,-0.438Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,413.964,29.709)">
<path d="M0.271,-0.004C0.257,0 0.244,0.003 0.23,0.005C0.216,0.007 0.2,0.008 0.182,0.008C0.111,0.008 0.076,-0.032 0.076,-0.112L0.076,-0.464L0.015,-0.464L0.015,-0.528L0.08,-0.528L0.105,-0.646L0.164,-0.646L0.164,-0.528L0.262,-0.528L0.262,-0.464L0.164,-0.464L0.164,-0.131C0.164,-0.105 0.168,-0.088 0.177,-0.077C0.185,-0.067 0.199,-0.062 0.22,-0.062C0.228,-0.062 0.236,-0.063 0.244,-0.064C0.252,-0.065 0.261,-0.067 0.271,-0.069L0.271,-0.004Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,425.355,29.709)">
<path d="M0.271,-0.004C0.257,0 0.244,0.003 0.23,0.005C0.216,0.007 0.2,0.008 0.182,0.008C0.111,0.008 0.076,-0.032 0.076,-0.112L0.076,-0.464L0.015,-0.464L0.015,-0.528L0.08,-0.528L0.105,-0.646L0.164,-0.646L0.164,-0.528L0.262,-0.528L0.262,-0.464L0.164,-0.464L0.164,-0.131C0.164,-0.105 0.168,-0.088 0.177,-0.077C0.185,-0.067 0.199,-0.062 0.22,-0.062C0.228,-0.062 0.236,-0.063 0.244,-0.064C0.252,-0.065 0.261,-0.067 0.271,-0.069L0.271,-0.004Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,436.746,29.709)">
<path d="M0.514,-0.267C0.514,-0.227 0.511,-0.19 0.504,-0.156C0.498,-0.122 0.487,-0.093 0.472,-0.068C0.457,-0.044 0.437,-0.025 0.412,-0.011C0.387,0.003 0.356,0.01 0.32,0.01C0.282,0.01 0.249,0.003 0.221,-0.012C0.192,-0.026 0.171,-0.049 0.156,-0.082L0.153,-0.082C0.154,-0.081 0.154,-0.078 0.154,-0.073C0.154,-0.068 0.154,-0.062 0.155,-0.054C0.155,-0.046 0.155,-0.037 0.155,-0.028C0.155,-0.018 0.155,-0.008 0.155,0.001L0.155,0.208L0.067,0.208L0.067,-0.42C0.067,-0.433 0.067,-0.445 0.067,-0.457C0.067,-0.469 0.067,-0.479 0.066,-0.489C0.066,-0.499 0.066,-0.507 0.065,-0.514C0.065,-0.521 0.065,-0.525 0.064,-0.528L0.149,-0.528C0.15,-0.527 0.15,-0.524 0.151,-0.518C0.151,-0.512 0.152,-0.505 0.152,-0.497C0.153,-0.489 0.153,-0.48 0.154,-0.47C0.154,-0.461 0.154,-0.452 0.154,-0.443L0.156,-0.443C0.164,-0.46 0.174,-0.475 0.184,-0.487C0.194,-0.498 0.206,-0.508 0.22,-0.516C0.233,-0.524 0.248,-0.529 0.264,-0.532C0.281,-0.536 0.299,-0.538 0.32,-0.538C0.356,-0.538 0.387,-0.531 0.412,-0.518C0.437,-0.505 0.457,-0.487 0.472,-0.463C0.487,-0.44 0.498,-0.411 0.504,-0.378C0.511,-0.344 0.514,-0.307 0.514,-0.267ZM0.422,-0.265C0.422,-0.297 0.42,-0.326 0.416,-0.352C0.412,-0.377 0.405,-0.398 0.396,-0.416C0.386,-0.434 0.373,-0.447 0.357,-0.456C0.341,-0.465 0.321,-0.47 0.297,-0.47C0.278,-0.47 0.259,-0.467 0.242,-0.461C0.225,-0.456 0.21,-0.445 0.197,-0.43C0.184,-0.414 0.174,-0.392 0.167,-0.365C0.159,-0.337 0.155,-0.302 0.155,-0.258C0.155,-0.22 0.158,-0.189 0.165,-0.163C0.171,-0.137 0.18,-0.116 0.192,-0.1C0.204,-0.084 0.218,-0.073 0.236,-0.066C0.253,-0.059 0.274,-0.055 0.296,-0.055C0.321,-0.055 0.341,-0.06 0.357,-0.069C0.373,-0.079 0.386,-0.092 0.396,-0.11C0.405,-0.128 0.412,-0.15 0.416,-0.176C0.42,-0.202 0.422,-0.231 0.422,-0.265Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,459.548,29.709)">
<path d="M0.464,-0.146C0.464,-0.121 0.459,-0.099 0.449,-0.08C0.44,-0.06 0.426,-0.044 0.408,-0.031C0.389,-0.018 0.367,-0.008 0.341,-0.001C0.314,0.006 0.284,0.01 0.25,0.01C0.219,0.01 0.191,0.007 0.167,0.003C0.142,-0.002 0.121,-0.01 0.102,-0.02C0.083,-0.03 0.068,-0.044 0.055,-0.061C0.043,-0.078 0.034,-0.099 0.028,-0.124L0.105,-0.139C0.113,-0.111 0.128,-0.09 0.152,-0.077C0.175,-0.064 0.208,-0.057 0.25,-0.057C0.268,-0.057 0.286,-0.058 0.302,-0.061C0.317,-0.064 0.331,-0.068 0.342,-0.074C0.354,-0.081 0.363,-0.089 0.369,-0.1C0.375,-0.11 0.378,-0.124 0.378,-0.139C0.378,-0.155 0.375,-0.168 0.367,-0.178C0.36,-0.189 0.349,-0.197 0.336,-0.204C0.323,-0.211 0.306,-0.217 0.287,-0.222C0.268,-0.227 0.247,-0.233 0.225,-0.239C0.203,-0.244 0.182,-0.25 0.162,-0.257C0.141,-0.264 0.122,-0.273 0.105,-0.284C0.088,-0.296 0.075,-0.31 0.064,-0.326C0.054,-0.343 0.049,-0.364 0.049,-0.389C0.049,-0.437 0.066,-0.474 0.1,-0.499C0.135,-0.524 0.185,-0.537 0.25,-0.537C0.309,-0.537 0.355,-0.526 0.389,-0.506C0.424,-0.485 0.445,-0.452 0.455,-0.407L0.375,-0.397C0.373,-0.411 0.367,-0.423 0.359,-0.432C0.352,-0.441 0.342,-0.449 0.331,-0.454C0.32,-0.46 0.308,-0.464 0.294,-0.467C0.28,-0.469 0.265,-0.47 0.25,-0.47C0.211,-0.47 0.181,-0.464 0.163,-0.452C0.144,-0.44 0.134,-0.422 0.134,-0.397C0.134,-0.383 0.138,-0.371 0.145,-0.362C0.152,-0.353 0.162,-0.345 0.174,-0.339C0.187,-0.332 0.202,-0.327 0.219,-0.322C0.237,-0.317 0.256,-0.312 0.277,-0.307C0.291,-0.304 0.306,-0.3 0.32,-0.296C0.335,-0.292 0.349,-0.287 0.363,-0.281C0.377,-0.275 0.39,-0.269 0.402,-0.261C0.414,-0.253 0.425,-0.244 0.434,-0.233C0.443,-0.223 0.45,-0.21 0.456,-0.196C0.461,-0.181 0.464,-0.165 0.464,-0.146Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,480.048,29.709)">
<path d="M0.091,-0.427L0.091,-0.528L0.187,-0.528L0.187,-0.427L0.091,-0.427ZM0.091,0L0.091,-0.101L0.187,-0.101L0.187,0L0.091,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,491.439,29.709)">
<path d="M0,0.01L0.201,-0.725L0.278,-0.725L0.079,0.01L0,0.01Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,502.831,29.709)">
<path d="M0,0.01L0.201,-0.725L0.278,-0.725L0.079,0.01L0,0.01Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,514.222,29.709)">
<path d="M0.268,0.208C0.237,0.208 0.21,0.204 0.187,0.198C0.164,0.192 0.144,0.183 0.127,0.172C0.11,0.16 0.097,0.146 0.086,0.13C0.076,0.114 0.069,0.097 0.064,0.077L0.152,0.064C0.158,0.089 0.171,0.108 0.191,0.121C0.211,0.134 0.237,0.141 0.27,0.141C0.29,0.141 0.308,0.138 0.324,0.132C0.34,0.127 0.354,0.118 0.366,0.106C0.377,0.094 0.386,0.078 0.392,0.058C0.398,0.039 0.401,0.015 0.401,-0.013L0.401,-0.098L0.4,-0.098C0.394,-0.085 0.386,-0.072 0.376,-0.06C0.367,-0.048 0.355,-0.037 0.341,-0.027C0.327,-0.018 0.311,-0.01 0.293,-0.005C0.275,0.001 0.254,0.004 0.23,0.004C0.197,0.004 0.168,-0.002 0.144,-0.013C0.12,-0.024 0.101,-0.041 0.086,-0.063C0.071,-0.086 0.059,-0.114 0.052,-0.147C0.045,-0.181 0.042,-0.219 0.042,-0.263C0.042,-0.306 0.045,-0.344 0.052,-0.377C0.059,-0.411 0.071,-0.44 0.087,-0.464C0.102,-0.487 0.123,-0.505 0.148,-0.518C0.173,-0.53 0.204,-0.537 0.24,-0.537C0.278,-0.537 0.31,-0.528 0.338,-0.511C0.365,-0.494 0.386,-0.47 0.401,-0.438L0.402,-0.438C0.402,-0.446 0.403,-0.455 0.403,-0.465C0.404,-0.475 0.404,-0.485 0.405,-0.494C0.405,-0.503 0.406,-0.511 0.406,-0.517C0.407,-0.524 0.408,-0.527 0.408,-0.528L0.492,-0.528C0.491,-0.525 0.491,-0.52 0.491,-0.513C0.49,-0.506 0.49,-0.498 0.49,-0.488C0.489,-0.479 0.489,-0.468 0.489,-0.456C0.489,-0.444 0.489,-0.432 0.489,-0.419L0.489,-0.015C0.489,0.059 0.471,0.114 0.434,0.152C0.398,0.189 0.342,0.208 0.268,0.208ZM0.401,-0.264C0.401,-0.301 0.397,-0.332 0.389,-0.359C0.381,-0.385 0.371,-0.406 0.358,-0.423C0.345,-0.439 0.33,-0.452 0.313,-0.459C0.296,-0.467 0.279,-0.471 0.262,-0.471C0.239,-0.471 0.22,-0.467 0.204,-0.459C0.188,-0.452 0.174,-0.439 0.164,-0.423C0.153,-0.406 0.145,-0.384 0.14,-0.358C0.135,-0.332 0.133,-0.301 0.133,-0.264C0.133,-0.226 0.135,-0.194 0.14,-0.168C0.145,-0.142 0.153,-0.121 0.164,-0.105C0.174,-0.09 0.187,-0.078 0.203,-0.071C0.219,-0.064 0.238,-0.061 0.26,-0.061C0.278,-0.061 0.295,-0.065 0.312,-0.072C0.329,-0.08 0.344,-0.092 0.357,-0.108C0.37,-0.124 0.381,-0.145 0.389,-0.171C0.397,-0.197 0.401,-0.228 0.401,-0.264Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,537.024,29.709)">
<path d="M0.067,-0.641L0.067,-0.725L0.155,-0.725L0.155,-0.641L0.067,-0.641ZM0.067,0L0.067,-0.528L0.155,-0.528L0.155,0L0.067,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,546.133,29.709)">
<path d="M0.271,-0.004C0.257,0 0.244,0.003 0.23,0.005C0.216,0.007 0.2,0.008 0.182,0.008C0.111,0.008 0.076,-0.032 0.076,-0.112L0.076,-0.464L0.015,-0.464L0.015,-0.528L0.08,-0.528L0.105,-0.646L0.164,-0.646L0.164,-0.528L0.262,-0.528L0.262,-0.464L0.164,-0.464L0.164,-0.131C0.164,-0.105 0.168,-0.088 0.177,-0.077C0.185,-0.067 0.199,-0.062 0.22,-0.062C0.228,-0.062 0.236,-0.063 0.244,-0.064C0.252,-0.065 0.261,-0.067 0.271,-0.069L0.271,-0.004Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,557.524,29.709)">
<path d="M0.155,-0.438C0.165,-0.456 0.175,-0.471 0.187,-0.484C0.198,-0.496 0.21,-0.507 0.224,-0.515C0.238,-0.523 0.253,-0.529 0.269,-0.532C0.285,-0.536 0.304,-0.538 0.324,-0.538C0.358,-0.538 0.385,-0.534 0.407,-0.524C0.429,-0.515 0.446,-0.503 0.458,-0.486C0.471,-0.47 0.479,-0.45 0.484,-0.427C0.489,-0.404 0.491,-0.379 0.491,-0.352L0.491,0L0.403,0L0.403,-0.335C0.403,-0.357 0.401,-0.377 0.399,-0.394C0.396,-0.411 0.391,-0.425 0.383,-0.436C0.375,-0.448 0.364,-0.456 0.35,-0.462C0.335,-0.467 0.317,-0.47 0.294,-0.47C0.273,-0.47 0.254,-0.466 0.238,-0.459C0.221,-0.451 0.206,-0.441 0.195,-0.427C0.183,-0.414 0.174,-0.397 0.167,-0.377C0.16,-0.358 0.157,-0.336 0.157,-0.312L0.157,0L0.069,0L0.069,-0.725L0.157,-0.725L0.157,-0.536C0.157,-0.525 0.157,-0.515 0.157,-0.504C0.156,-0.493 0.156,-0.483 0.156,-0.474C0.155,-0.465 0.155,-0.457 0.154,-0.451C0.154,-0.445 0.154,-0.44 0.153,-0.438L0.155,-0.438Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,580.326,29.709)">
<path d="M0.153,-0.528L0.153,-0.193C0.153,-0.168 0.155,-0.146 0.159,-0.129C0.163,-0.112 0.169,-0.098 0.177,-0.087C0.186,-0.077 0.197,-0.069 0.211,-0.065C0.225,-0.06 0.242,-0.058 0.262,-0.058C0.283,-0.058 0.302,-0.062 0.319,-0.069C0.335,-0.076 0.35,-0.087 0.362,-0.101C0.373,-0.115 0.383,-0.132 0.389,-0.152C0.396,-0.172 0.399,-0.196 0.399,-0.222L0.399,-0.528L0.487,-0.528L0.487,-0.113C0.487,-0.102 0.487,-0.09 0.487,-0.078C0.487,-0.066 0.487,-0.054 0.488,-0.043C0.488,-0.032 0.488,-0.023 0.489,-0.015C0.489,-0.007 0.489,-0.002 0.49,0L0.407,0C0.406,-0.002 0.406,-0.006 0.406,-0.013C0.405,-0.02 0.405,-0.029 0.405,-0.038C0.404,-0.047 0.404,-0.057 0.403,-0.066C0.403,-0.076 0.403,-0.084 0.403,-0.09L0.401,-0.09C0.393,-0.075 0.384,-0.061 0.374,-0.049C0.363,-0.036 0.352,-0.026 0.338,-0.017C0.325,-0.009 0.31,-0.002 0.292,0.003C0.275,0.007 0.255,0.01 0.232,0.01C0.203,0.01 0.178,0.006 0.157,-0.001C0.136,-0.008 0.118,-0.019 0.104,-0.034C0.091,-0.049 0.081,-0.068 0.074,-0.092C0.068,-0.115 0.065,-0.143 0.065,-0.176L0.065,-0.528L0.153,-0.528Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,603.128,29.709)">
<path d="M0.514,-0.267C0.514,-0.082 0.449,0.01 0.32,0.01C0.28,0.01 0.247,0.003 0.22,-0.012C0.193,-0.026 0.172,-0.05 0.155,-0.082L0.154,-0.082C0.154,-0.074 0.154,-0.065 0.154,-0.056C0.153,-0.047 0.153,-0.038 0.152,-0.03C0.152,-0.022 0.151,-0.016 0.151,-0.01C0.15,-0.005 0.15,-0.001 0.149,0L0.064,0C0.065,-0.003 0.065,-0.008 0.065,-0.015C0.066,-0.022 0.066,-0.03 0.066,-0.04C0.067,-0.05 0.067,-0.061 0.067,-0.072C0.067,-0.084 0.067,-0.096 0.067,-0.109L0.067,-0.725L0.155,-0.725L0.155,-0.518C0.155,-0.508 0.155,-0.499 0.155,-0.49C0.155,-0.481 0.155,-0.473 0.154,-0.466C0.154,-0.458 0.154,-0.451 0.153,-0.443L0.155,-0.443C0.172,-0.477 0.193,-0.501 0.22,-0.516C0.247,-0.531 0.28,-0.538 0.32,-0.538C0.387,-0.538 0.436,-0.516 0.467,-0.471C0.498,-0.426 0.514,-0.358 0.514,-0.267ZM0.422,-0.264C0.422,-0.3 0.42,-0.331 0.415,-0.357C0.41,-0.383 0.403,-0.405 0.393,-0.422C0.383,-0.438 0.37,-0.451 0.354,-0.458C0.339,-0.466 0.32,-0.47 0.297,-0.47C0.274,-0.47 0.254,-0.466 0.236,-0.459C0.218,-0.451 0.204,-0.439 0.192,-0.423C0.18,-0.406 0.171,-0.384 0.165,-0.357C0.158,-0.33 0.155,-0.297 0.155,-0.258C0.155,-0.221 0.158,-0.189 0.165,-0.163C0.171,-0.137 0.18,-0.116 0.192,-0.1C0.204,-0.084 0.218,-0.073 0.236,-0.066C0.253,-0.059 0.274,-0.055 0.296,-0.055C0.318,-0.055 0.336,-0.059 0.352,-0.066C0.368,-0.074 0.381,-0.086 0.391,-0.103C0.402,-0.119 0.409,-0.141 0.414,-0.167C0.419,-0.194 0.422,-0.226 0.422,-0.264Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,625.931,29.709)">
<rect x="0.091" y="-0.107" width="0.095" height="0.107" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,637.322,29.709)">
<path d="M0.134,-0.267C0.134,-0.236 0.136,-0.208 0.141,-0.183C0.145,-0.158 0.153,-0.136 0.163,-0.117C0.174,-0.099 0.187,-0.085 0.204,-0.075C0.221,-0.065 0.243,-0.06 0.268,-0.06C0.299,-0.06 0.325,-0.068 0.346,-0.085C0.367,-0.102 0.38,-0.128 0.385,-0.163L0.474,-0.157C0.471,-0.135 0.464,-0.114 0.455,-0.094C0.445,-0.074 0.432,-0.056 0.415,-0.041C0.398,-0.026 0.378,-0.013 0.354,-0.004C0.329,0.005 0.302,0.01 0.27,0.01C0.229,0.01 0.194,0.003 0.165,-0.011C0.136,-0.025 0.112,-0.045 0.094,-0.069C0.076,-0.094 0.063,-0.123 0.055,-0.156C0.047,-0.189 0.042,-0.226 0.042,-0.265C0.042,-0.3 0.045,-0.331 0.051,-0.359C0.057,-0.386 0.065,-0.41 0.076,-0.43C0.087,-0.45 0.099,-0.467 0.113,-0.481C0.128,-0.495 0.143,-0.506 0.16,-0.514C0.177,-0.523 0.194,-0.529 0.213,-0.532C0.231,-0.536 0.25,-0.538 0.269,-0.538C0.299,-0.538 0.325,-0.534 0.348,-0.526C0.371,-0.518 0.391,-0.507 0.408,-0.492C0.425,-0.478 0.438,-0.462 0.449,-0.442C0.459,-0.423 0.466,-0.403 0.471,-0.38L0.38,-0.374C0.376,-0.403 0.364,-0.426 0.346,-0.443C0.327,-0.461 0.301,-0.469 0.267,-0.469C0.242,-0.469 0.221,-0.465 0.204,-0.457C0.187,-0.448 0.174,-0.436 0.163,-0.419C0.153,-0.402 0.145,-0.381 0.141,-0.356C0.136,-0.331 0.134,-0.301 0.134,-0.267Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,657.822,29.709)">
<path d="M0.514,-0.265C0.514,-0.172 0.494,-0.103 0.453,-0.058C0.412,-0.013 0.353,0.01 0.276,0.01C0.239,0.01 0.206,0.004 0.177,-0.007C0.148,-0.018 0.124,-0.035 0.104,-0.058C0.084,-0.08 0.068,-0.109 0.058,-0.143C0.047,-0.178 0.042,-0.218 0.042,-0.265C0.042,-0.447 0.121,-0.538 0.279,-0.538C0.32,-0.538 0.355,-0.532 0.385,-0.521C0.415,-0.51 0.439,-0.493 0.458,-0.47C0.477,-0.447 0.491,-0.418 0.5,-0.384C0.51,-0.35 0.514,-0.31 0.514,-0.265ZM0.422,-0.265C0.422,-0.306 0.419,-0.34 0.412,-0.366C0.406,-0.393 0.397,-0.414 0.385,-0.43C0.372,-0.446 0.357,-0.457 0.34,-0.464C0.322,-0.47 0.302,-0.473 0.28,-0.473C0.258,-0.473 0.238,-0.47 0.219,-0.463C0.201,-0.456 0.186,-0.445 0.173,-0.429C0.161,-0.413 0.151,-0.391 0.144,-0.365C0.138,-0.338 0.134,-0.305 0.134,-0.265C0.134,-0.224 0.138,-0.19 0.145,-0.163C0.152,-0.136 0.162,-0.115 0.175,-0.099C0.187,-0.083 0.202,-0.071 0.219,-0.065C0.236,-0.058 0.255,-0.055 0.275,-0.055C0.297,-0.055 0.318,-0.058 0.336,-0.065C0.354,-0.071 0.37,-0.082 0.382,-0.098C0.395,-0.114 0.405,-0.136 0.412,-0.163C0.418,-0.19 0.422,-0.224 0.422,-0.265Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,680.624,29.709)">
<path d="M0.375,0L0.375,-0.335C0.375,-0.361 0.373,-0.382 0.37,-0.399C0.367,-0.417 0.361,-0.431 0.354,-0.441C0.346,-0.452 0.336,-0.459 0.324,-0.464C0.311,-0.468 0.296,-0.47 0.278,-0.47C0.26,-0.47 0.243,-0.467 0.228,-0.459C0.213,-0.452 0.2,-0.441 0.19,-0.427C0.179,-0.414 0.171,-0.397 0.165,-0.376C0.16,-0.356 0.157,-0.333 0.157,-0.306L0.157,0L0.069,0L0.069,-0.416C0.069,-0.427 0.069,-0.438 0.069,-0.45C0.069,-0.463 0.069,-0.474 0.068,-0.485C0.068,-0.496 0.068,-0.505 0.067,-0.513C0.067,-0.521 0.067,-0.526 0.066,-0.528L0.149,-0.528C0.15,-0.527 0.15,-0.522 0.15,-0.515C0.151,-0.508 0.151,-0.5 0.152,-0.49C0.152,-0.481 0.153,-0.472 0.153,-0.462C0.153,-0.453 0.153,-0.444 0.153,-0.438L0.155,-0.438C0.163,-0.453 0.171,-0.467 0.18,-0.479C0.189,-0.492 0.2,-0.502 0.212,-0.511C0.224,-0.52 0.238,-0.526 0.254,-0.531C0.27,-0.536 0.288,-0.538 0.309,-0.538C0.349,-0.538 0.381,-0.53 0.404,-0.514C0.427,-0.498 0.444,-0.473 0.453,-0.438L0.454,-0.438C0.462,-0.453 0.471,-0.467 0.48,-0.479C0.49,-0.492 0.502,-0.502 0.515,-0.511C0.528,-0.52 0.542,-0.526 0.559,-0.531C0.575,-0.536 0.593,-0.538 0.614,-0.538C0.641,-0.538 0.664,-0.535 0.683,-0.527C0.703,-0.52 0.719,-0.509 0.731,-0.494C0.743,-0.479 0.752,-0.46 0.758,-0.436C0.764,-0.413 0.767,-0.385 0.767,-0.352L0.767,0L0.68,0L0.68,-0.335C0.68,-0.361 0.679,-0.382 0.675,-0.399C0.672,-0.417 0.667,-0.431 0.659,-0.441C0.651,-0.452 0.641,-0.459 0.629,-0.464C0.617,-0.468 0.601,-0.47 0.583,-0.47C0.565,-0.47 0.548,-0.467 0.533,-0.46C0.518,-0.453 0.505,-0.442 0.495,-0.429C0.484,-0.415 0.476,-0.398 0.47,-0.377C0.465,-0.357 0.462,-0.333 0.462,-0.306L0.462,0L0.375,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,714.777,29.709)">
<path d="M0,0.01L0.201,-0.725L0.278,-0.725L0.079,0.01L0,0.01Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,726.168,29.709)">
<path d="M0.614,-0.481C0.614,-0.451 0.609,-0.423 0.599,-0.397C0.589,-0.371 0.575,-0.349 0.555,-0.33C0.535,-0.311 0.511,-0.296 0.481,-0.285C0.451,-0.274 0.417,-0.268 0.377,-0.268L0.175,-0.268L0.175,0L0.082,0L0.082,-0.688L0.372,-0.688C0.412,-0.688 0.448,-0.683 0.478,-0.673C0.508,-0.663 0.534,-0.649 0.554,-0.631C0.574,-0.613 0.589,-0.591 0.599,-0.566C0.609,-0.54 0.614,-0.512 0.614,-0.481ZM0.521,-0.48C0.521,-0.524 0.507,-0.557 0.48,-0.579C0.454,-0.602 0.414,-0.613 0.36,-0.613L0.175,-0.613L0.175,-0.342L0.364,-0.342C0.418,-0.342 0.457,-0.354 0.483,-0.377C0.508,-0.401 0.521,-0.435 0.521,-0.48Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,753.515,29.709)">
<path d="M0.547,0L0.547,-0.319L0.175,-0.319L0.175,0L0.082,0L0.082,-0.688L0.175,-0.688L0.175,-0.397L0.547,-0.397L0.547,-0.688L0.641,-0.688L0.641,0L0.547,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,783.124,29.709)">
<path d="M0.614,-0.481C0.614,-0.451 0.609,-0.423 0.599,-0.397C0.589,-0.371 0.575,-0.349 0.555,-0.33C0.535,-0.311 0.511,-0.296 0.481,-0.285C0.451,-0.274 0.417,-0.268 0.377,-0.268L0.175,-0.268L0.175,0L0.082,0L0.082,-0.688L0.372,-0.688C0.412,-0.688 0.448,-0.683 0.478,-0.673C0.508,-0.663 0.534,-0.649 0.554,-0.631C0.574,-0.613 0.589,-0.591 0.599,-0.566C0.609,-0.54 0.614,-0.512 0.614,-0.481ZM0.521,-0.48C0.521,-0.524 0.507,-0.557 0.48,-0.579C0.454,-0.602 0.414,-0.613 0.36,-0.613L0.175,-0.613L0.175,-0.342L0.364,-0.342C0.418,-0.342 0.457,-0.354 0.483,-0.377C0.508,-0.401 0.521,-0.435 0.521,-0.48Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,810.471,29.709)">
<path d="M0.667,0L0.667,-0.459C0.667,-0.476 0.667,-0.493 0.667,-0.51C0.668,-0.527 0.668,-0.543 0.669,-0.557C0.67,-0.574 0.67,-0.59 0.671,-0.605C0.667,-0.589 0.662,-0.572 0.657,-0.556C0.653,-0.542 0.648,-0.527 0.643,-0.511C0.638,-0.496 0.633,-0.481 0.628,-0.469L0.451,0L0.385,0L0.205,-0.469C0.203,-0.474 0.201,-0.479 0.199,-0.486L0.185,-0.529C0.182,-0.537 0.18,-0.544 0.178,-0.552C0.172,-0.569 0.167,-0.587 0.162,-0.605C0.162,-0.587 0.162,-0.569 0.163,-0.551C0.164,-0.536 0.164,-0.52 0.165,-0.503C0.165,-0.486 0.165,-0.472 0.165,-0.459L0.165,0L0.082,0L0.082,-0.688L0.205,-0.688L0.388,-0.211C0.39,-0.204 0.393,-0.196 0.396,-0.186C0.399,-0.176 0.402,-0.165 0.405,-0.154C0.408,-0.144 0.411,-0.133 0.413,-0.124C0.416,-0.114 0.417,-0.107 0.418,-0.102C0.419,-0.107 0.421,-0.114 0.424,-0.124C0.426,-0.134 0.429,-0.144 0.433,-0.155C0.436,-0.166 0.44,-0.176 0.443,-0.186C0.446,-0.196 0.449,-0.204 0.452,-0.211L0.631,-0.688L0.751,-0.688L0.751,0L0.667,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,844.624,29.709)">
<path d="M0.202,0.01C0.149,0.01 0.109,-0.004 0.083,-0.032C0.056,-0.06 0.042,-0.099 0.042,-0.147C0.042,-0.182 0.049,-0.211 0.062,-0.233C0.075,-0.255 0.093,-0.273 0.114,-0.286C0.135,-0.298 0.16,-0.307 0.187,-0.312C0.214,-0.317 0.242,-0.32 0.271,-0.32L0.389,-0.322L0.389,-0.351C0.389,-0.373 0.387,-0.391 0.382,-0.407C0.378,-0.422 0.371,-0.434 0.361,-0.444C0.352,-0.453 0.34,-0.46 0.326,-0.465C0.312,-0.469 0.295,-0.471 0.276,-0.471C0.259,-0.471 0.244,-0.47 0.23,-0.468C0.216,-0.465 0.204,-0.461 0.194,-0.454C0.184,-0.448 0.176,-0.439 0.17,-0.428C0.164,-0.418 0.16,-0.404 0.158,-0.387L0.066,-0.396C0.069,-0.416 0.075,-0.435 0.084,-0.453C0.094,-0.47 0.107,-0.485 0.123,-0.498C0.14,-0.511 0.161,-0.521 0.186,-0.528C0.212,-0.535 0.242,-0.538 0.278,-0.538C0.344,-0.538 0.394,-0.523 0.428,-0.492C0.461,-0.462 0.478,-0.418 0.478,-0.36L0.478,-0.133C0.478,-0.107 0.481,-0.087 0.488,-0.074C0.495,-0.061 0.508,-0.054 0.527,-0.054C0.532,-0.054 0.537,-0.055 0.542,-0.055C0.547,-0.056 0.552,-0.057 0.556,-0.058L0.556,-0.003C0.545,0 0.534,0.002 0.523,0.003C0.512,0.004 0.501,0.005 0.488,0.005C0.472,0.005 0.457,0.003 0.446,-0.002C0.434,-0.006 0.424,-0.013 0.417,-0.022C0.409,-0.031 0.403,-0.042 0.399,-0.055C0.396,-0.068 0.393,-0.083 0.392,-0.101L0.389,-0.101C0.38,-0.084 0.369,-0.069 0.358,-0.055C0.347,-0.042 0.334,-0.03 0.319,-0.02C0.304,-0.011 0.287,-0.003 0.268,0.002C0.249,0.007 0.227,0.01 0.202,0.01ZM0.222,-0.056C0.25,-0.056 0.275,-0.061 0.296,-0.072C0.317,-0.082 0.334,-0.095 0.348,-0.111C0.362,-0.127 0.372,-0.144 0.379,-0.163C0.386,-0.182 0.389,-0.2 0.389,-0.217L0.389,-0.261L0.293,-0.259C0.271,-0.258 0.251,-0.257 0.232,-0.254C0.212,-0.251 0.195,-0.246 0.181,-0.238C0.166,-0.23 0.154,-0.218 0.146,-0.204C0.137,-0.189 0.133,-0.17 0.133,-0.146C0.133,-0.117 0.141,-0.095 0.156,-0.08C0.171,-0.064 0.194,-0.056 0.222,-0.056Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,867.426,29.709)">
<path d="M0.067,-0.641L0.067,-0.725L0.155,-0.725L0.155,-0.641L0.067,-0.641ZM0.067,0L0.067,-0.528L0.155,-0.528L0.155,0L0.067,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,876.535,29.709)">
<rect x="0.067" y="-0.725" width="0.088" height="0.725" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,885.644,29.709)">
<path d="M0.135,-0.246C0.135,-0.218 0.138,-0.192 0.143,-0.169C0.149,-0.146 0.158,-0.126 0.17,-0.109C0.182,-0.092 0.197,-0.079 0.215,-0.07C0.234,-0.061 0.256,-0.056 0.282,-0.056C0.32,-0.056 0.351,-0.064 0.374,-0.079C0.397,-0.094 0.412,-0.114 0.42,-0.137L0.498,-0.115C0.492,-0.101 0.484,-0.086 0.474,-0.071C0.464,-0.056 0.451,-0.043 0.435,-0.031C0.418,-0.019 0.397,-0.009 0.372,-0.002C0.347,0.006 0.317,0.01 0.282,0.01C0.204,0.01 0.145,-0.014 0.104,-0.06C0.063,-0.107 0.042,-0.176 0.042,-0.268C0.042,-0.317 0.049,-0.359 0.061,-0.393C0.073,-0.428 0.09,-0.456 0.112,-0.477C0.133,-0.499 0.158,-0.514 0.187,-0.524C0.216,-0.533 0.246,-0.538 0.279,-0.538C0.323,-0.538 0.36,-0.531 0.39,-0.517C0.42,-0.502 0.444,-0.483 0.462,-0.457C0.48,-0.432 0.493,-0.402 0.5,-0.368C0.508,-0.334 0.512,-0.297 0.512,-0.257L0.512,-0.246L0.135,-0.246ZM0.421,-0.313C0.416,-0.369 0.402,-0.409 0.378,-0.435C0.355,-0.46 0.321,-0.473 0.277,-0.473C0.263,-0.473 0.247,-0.471 0.231,-0.466C0.215,-0.461 0.2,-0.453 0.187,-0.441C0.173,-0.429 0.161,-0.413 0.152,-0.392C0.142,-0.371 0.137,-0.345 0.136,-0.313L0.421,-0.313Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,908.446,29.709)">
<path d="M0.069,0L0.069,-0.405C0.069,-0.416 0.069,-0.428 0.069,-0.439C0.069,-0.451 0.069,-0.462 0.068,-0.473C0.068,-0.483 0.068,-0.493 0.067,-0.503C0.067,-0.512 0.067,-0.521 0.066,-0.528L0.149,-0.528L0.152,-0.473C0.153,-0.463 0.153,-0.453 0.153,-0.444C0.153,-0.435 0.153,-0.427 0.153,-0.42L0.155,-0.42C0.161,-0.441 0.168,-0.458 0.175,-0.473C0.182,-0.488 0.19,-0.5 0.2,-0.51C0.209,-0.519 0.22,-0.526 0.233,-0.531C0.246,-0.536 0.262,-0.538 0.281,-0.538C0.288,-0.538 0.295,-0.538 0.301,-0.536C0.308,-0.535 0.313,-0.534 0.316,-0.533L0.316,-0.453C0.311,-0.454 0.304,-0.455 0.296,-0.456C0.288,-0.457 0.279,-0.458 0.27,-0.458C0.249,-0.458 0.232,-0.453 0.218,-0.444C0.204,-0.435 0.192,-0.422 0.183,-0.406C0.174,-0.39 0.168,-0.371 0.164,-0.348C0.159,-0.326 0.157,-0.302 0.157,-0.275L0.157,0L0.069,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,922.1,29.709)">
<path d="M0,0.01L0.201,-0.725L0.278,-0.725L0.079,0.01L0,0.01Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,933.491,29.709)">
<path d="M0.614,-0.481C0.614,-0.451 0.609,-0.423 0.599,-0.397C0.589,-0.371 0.575,-0.349 0.555,-0.33C0.535,-0.311 0.511,-0.296 0.481,-0.285C0.451,-0.274 0.417,-0.268 0.377,-0.268L0.175,-0.268L0.175,0L0.082,0L0.082,-0.688L0.372,-0.688C0.412,-0.688 0.448,-0.683 0.478,-0.673C0.508,-0.663 0.534,-0.649 0.554,-0.631C0.574,-0.613 0.589,-0.591 0.599,-0.566C0.609,-0.54 0.614,-0.512 0.614,-0.481ZM0.521,-0.48C0.521,-0.524 0.507,-0.557 0.48,-0.579C0.454,-0.602 0.414,-0.613 0.36,-0.613L0.175,-0.613L0.175,-0.342L0.364,-0.342C0.418,-0.342 0.457,-0.354 0.483,-0.377C0.508,-0.401 0.521,-0.435 0.521,-0.48Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,960.837,29.709)">
<path d="M0.547,0L0.547,-0.319L0.175,-0.319L0.175,0L0.082,0L0.082,-0.688L0.175,-0.688L0.175,-0.397L0.547,-0.397L0.547,-0.688L0.641,-0.688L0.641,0L0.547,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,990.446,29.709)">
<path d="M0.614,-0.481C0.614,-0.451 0.609,-0.423 0.599,-0.397C0.589,-0.371 0.575,-0.349 0.555,-0.33C0.535,-0.311 0.511,-0.296 0.481,-0.285C0.451,-0.274 0.417,-0.268 0.377,-0.268L0.175,-0.268L0.175,0L0.082,0L0.082,-0.688L0.372,-0.688C0.412,-0.688 0.448,-0.683 0.478,-0.673C0.508,-0.663 0.534,-0.649 0.554,-0.631C0.574,-0.613 0.589,-0.591 0.599,-0.566C0.609,-0.54 0.614,-0.512 0.614,-0.481ZM0.521,-0.48C0.521,-0.524 0.507,-0.557 0.48,-0.579C0.454,-0.602 0.414,-0.613 0.36,-0.613L0.175,-0.613L0.175,-0.342L0.364,-0.342C0.418,-0.342 0.457,-0.354 0.483,-0.377C0.508,-0.401 0.521,-0.435 0.521,-0.48Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,1017.79,29.709)">
<path d="M0.667,0L0.667,-0.459C0.667,-0.476 0.667,-0.493 0.667,-0.51C0.668,-0.527 0.668,-0.543 0.669,-0.557C0.67,-0.574 0.67,-0.59 0.671,-0.605C0.667,-0.589 0.662,-0.572 0.657,-0.556C0.653,-0.542 0.648,-0.527 0.643,-0.511C0.638,-0.496 0.633,-0.481 0.628,-0.469L0.451,0L0.385,0L0.205,-0.469C0.203,-0.474 0.201,-0.479 0.199,-0.486L0.185,-0.529C0.182,-0.537 0.18,-0.544 0.178,-0.552C0.172,-0.569 0.167,-0.587 0.162,-0.605C0.162,-0.587 0.162,-0.569 0.163,-0.551C0.164,-0.536 0.164,-0.52 0.165,-0.503C0.165,-0.486 0.165,-0.472 0.165,-0.459L0.165,0L0.082,0L0.082,-0.688L0.205,-0.688L0.388,-0.211C0.39,-0.204 0.393,-0.196 0.396,-0.186C0.399,-0.176 0.402,-0.165 0.405,-0.154C0.408,-0.144 0.411,-0.133 0.413,-0.124C0.416,-0.114 0.417,-0.107 0.418,-0.102C0.419,-0.107 0.421,-0.114 0.424,-0.124C0.426,-0.134 0.429,-0.144 0.433,-0.155C0.436,-0.166 0.44,-0.176 0.443,-0.186C0.446,-0.196 0.449,-0.204 0.452,-0.211L0.631,-0.688L0.751,-0.688L0.751,0L0.667,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,1051.95,29.709)">
<path d="M0.202,0.01C0.149,0.01 0.109,-0.004 0.083,-0.032C0.056,-0.06 0.042,-0.099 0.042,-0.147C0.042,-0.182 0.049,-0.211 0.062,-0.233C0.075,-0.255 0.093,-0.273 0.114,-0.286C0.135,-0.298 0.16,-0.307 0.187,-0.312C0.214,-0.317 0.242,-0.32 0.271,-0.32L0.389,-0.322L0.389,-0.351C0.389,-0.373 0.387,-0.391 0.382,-0.407C0.378,-0.422 0.371,-0.434 0.361,-0.444C0.352,-0.453 0.34,-0.46 0.326,-0.465C0.312,-0.469 0.295,-0.471 0.276,-0.471C0.259,-0.471 0.244,-0.47 0.23,-0.468C0.216,-0.465 0.204,-0.461 0.194,-0.454C0.184,-0.448 0.176,-0.439 0.17,-0.428C0.164,-0.418 0.16,-0.404 0.158,-0.387L0.066,-0.396C0.069,-0.416 0.075,-0.435 0.084,-0.453C0.094,-0.47 0.107,-0.485 0.123,-0.498C0.14,-0.511 0.161,-0.521 0.186,-0.528C0.212,-0.535 0.242,-0.538 0.278,-0.538C0.344,-0.538 0.394,-0.523 0.428,-0.492C0.461,-0.462 0.478,-0.418 0.478,-0.36L0.478,-0.133C0.478,-0.107 0.481,-0.087 0.488,-0.074C0.495,-0.061 0.508,-0.054 0.527,-0.054C0.532,-0.054 0.537,-0.055 0.542,-0.055C0.547,-0.056 0.552,-0.057 0.556,-0.058L0.556,-0.003C0.545,0 0.534,0.002 0.523,0.003C0.512,0.004 0.501,0.005 0.488,0.005C0.472,0.005 0.457,0.003 0.446,-0.002C0.434,-0.006 0.424,-0.013 0.417,-0.022C0.409,-0.031 0.403,-0.042 0.399,-0.055C0.396,-0.068 0.393,-0.083 0.392,-0.101L0.389,-0.101C0.38,-0.084 0.369,-0.069 0.358,-0.055C0.347,-0.042 0.334,-0.03 0.319,-0.02C0.304,-0.011 0.287,-0.003 0.268,0.002C0.249,0.007 0.227,0.01 0.202,0.01ZM0.222,-0.056C0.25,-0.056 0.275,-0.061 0.296,-0.072C0.317,-0.082 0.334,-0.095 0.348,-0.111C0.362,-0.127 0.372,-0.144 0.379,-0.163C0.386,-0.182 0.389,-0.2 0.389,-0.217L0.389,-0.261L0.293,-0.259C0.271,-0.258 0.251,-0.257 0.232,-0.254C0.212,-0.251 0.195,-0.246 0.181,-0.238C0.166,-0.23 0.154,-0.218 0.146,-0.204C0.137,-0.189 0.133,-0.17 0.133,-0.146C0.133,-0.117 0.141,-0.095 0.156,-0.08C0.171,-0.064 0.194,-0.056 0.222,-0.056Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,1074.75,29.709)">
<path d="M0.067,-0.641L0.067,-0.725L0.155,-0.725L0.155,-0.641L0.067,-0.641ZM0.067,0L0.067,-0.528L0.155,-0.528L0.155,0L0.067,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,1083.86,29.709)">
<rect x="0.067" y="-0.725" width="0.088" height="0.725" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,1092.97,29.709)">
<path d="M0.135,-0.246C0.135,-0.218 0.138,-0.192 0.143,-0.169C0.149,-0.146 0.158,-0.126 0.17,-0.109C0.182,-0.092 0.197,-0.079 0.215,-0.07C0.234,-0.061 0.256,-0.056 0.282,-0.056C0.32,-0.056 0.351,-0.064 0.374,-0.079C0.397,-0.094 0.412,-0.114 0.42,-0.137L0.498,-0.115C0.492,-0.101 0.484,-0.086 0.474,-0.071C0.464,-0.056 0.451,-0.043 0.435,-0.031C0.418,-0.019 0.397,-0.009 0.372,-0.002C0.347,0.006 0.317,0.01 0.282,0.01C0.204,0.01 0.145,-0.014 0.104,-0.06C0.063,-0.107 0.042,-0.176 0.042,-0.268C0.042,-0.317 0.049,-0.359 0.061,-0.393C0.073,-0.428 0.09,-0.456 0.112,-0.477C0.133,-0.499 0.158,-0.514 0.187,-0.524C0.216,-0.533 0.246,-0.538 0.279,-0.538C0.323,-0.538 0.36,-0.531 0.39,-0.517C0.42,-0.502 0.444,-0.483 0.462,-0.457C0.48,-0.432 0.493,-0.402 0.5,-0.368C0.508,-0.334 0.512,-0.297 0.512,-0.257L0.512,-0.246L0.135,-0.246ZM0.421,-0.313C0.416,-0.369 0.402,-0.409 0.378,-0.435C0.355,-0.46 0.321,-0.473 0.277,-0.473C0.263,-0.473 0.247,-0.471 0.231,-0.466C0.215,-0.461 0.2,-0.453 0.187,-0.441C0.173,-0.429 0.161,-0.413 0.152,-0.392C0.142,-0.371 0.137,-0.345 0.136,-0.313L0.421,-0.313Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
<g transform="matrix(41,0,0,41,1115.77,29.709)">
<path d="M0.069,0L0.069,-0.405C0.069,-0.416 0.069,-0.428 0.069,-0.439C0.069,-0.451 0.069,-0.462 0.068,-0.473C0.068,-0.483 0.068,-0.493 0.067,-0.503C0.067,-0.512 0.067,-0.521 0.066,-0.528L0.149,-0.528L0.152,-0.473C0.153,-0.463 0.153,-0.453 0.153,-0.444C0.153,-0.435 0.153,-0.427 0.153,-0.42L0.155,-0.42C0.161,-0.441 0.168,-0.458 0.175,-0.473C0.182,-0.488 0.19,-0.5 0.2,-0.51C0.209,-0.519 0.22,-0.526 0.233,-0.531C0.246,-0.536 0.262,-0.538 0.281,-0.538C0.288,-0.538 0.295,-0.538 0.301,-0.536C0.308,-0.535 0.313,-0.534 0.316,-0.533L0.316,-0.453C0.311,-0.454 0.304,-0.455 0.296,-0.456C0.288,-0.457 0.279,-0.458 0.27,-0.458C0.249,-0.458 0.232,-0.453 0.218,-0.444C0.204,-0.435 0.192,-0.422 0.183,-0.406C0.174,-0.39 0.168,-0.371 0.164,-0.348C0.159,-0.326 0.157,-0.302 0.157,-0.275L0.157,0L0.069,0Z" style="fill:rgb(255,254,254);fill-rule:nonzero;"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -1,48 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>PHPMailer Examples</title>
</head>
<body>
<h1>PHPMailer code examples<a href="https://github.com/PHPMailer/PHPMailer"><img src="images/phpmailer.png" style="float:right; border:0;" alt="PHPMailer logo"></a></h1>
<p>This folder contains a collection of examples of using <a href="https://github.com/PHPMailer/PHPMailer">PHPMailer</a>.</p>
<h2>About testing email sending</h2>
<p>When working on email sending code you'll find yourself worrying about what might happen if all these test emails got sent to your mailing list. The solution is to use a fake mail server, one that acts just like the real thing, but just doesn't actually send anything out. Some offer web interfaces, feedback, logging, the ability to return specific error codes, all things that are useful for testing error handling, authentication etc. Here's a selection of mail testing tools you might like to try:</p>
<ul>
<li><a href="https://github.com/Nilhcem/FakeSMTP">FakeSMTP</a>, a Java desktop app with the ability to show an SMTP log and save messages to a folder. </li>
<li><a href="https://github.com/isotoma/FakeEmail">FakeEmail</a>, a Python-based fake mail server with a web interface.</li>
<li><a href="http://www.postfix.org/smtp-sink.1.html">smtp-sink</a>, part of the Postfix mail server, so you probably already have this installed. This is used in the Travis-CI configuration to run PHPMailer's unit tests.</li>
<li><a href="http://smtp4dev.codeplex.com">smtp4dev</a>, a dummy SMTP server for Windows.</li>
<li><a href="https://github.com/PHPMailer/PHPMailer/blob/master/test/fakesendmail.sh">fakesendmail.sh</a>, part of PHPMailer's test setup, this is a shell script that emulates sendmail for testing 'mail' or 'sendmail' methods in PHPMailer.</li>
<li><a href="http://tools.ietf.org/tools/msglint/">msglint</a>, not a mail server, the IETF's MIME structure analyser checks the formatting of your messages.</li>
</ul>
<div style="padding: 8px; color: #333333; background-color: #dc8b92">
<h2>Security note</h2>
<p>Before running these examples you'll need to rename them with '.php' extensions. They are supplied as '.phps' files which will usually be displayed with syntax highlighting by PHP instead of running them. This prevents potential security issues with running potential spam-gateway code if you happen to deploy these code examples on a live site - <em>please don't do that!</em> Similarly, don't leave your passwords in these files as they will be visible to the world!</p>
</div>
<h2><a href="code_generator.phps">code_generator.phps</a></h2>
<p>This script is a simple code generator - fill in the form and hit submit, and it will use when you entered to email you a message, and will also generate PHP code using your settings that you can copy and paste to use in your own apps. If you need to get going quickly, this is probably the best place to start.</p>
<h2><a href="mail.phps">mail.phps</a></h2>
<p>This script is a basic example which creates an email message from an external HTML file, creates a plain text body, sets various addresses, adds an attachment and sends the message. It uses PHP's built-in mail() function which is the simplest to use, but relies on the presence of a local mail server, something which is not usually available on Windows. If you find yourself in that situation, either install a local mail server, or use a remote one and send using SMTP instead.</p>
<h2><a href="exceptions.phps">exceptions.phps</a></h2>
<p>The same as the mail example, but shows how to use PHPMailer's optional exceptions for error handling.</p>
<h2><a href="smtp.phps">smtp.phps</a></h2>
<p>A simple example sending using SMTP with authentication.</p>
<h2><a href="smtp_no_auth.phps">smtp_no_auth.phps</a></h2>
<p>A simple example sending using SMTP without authentication.</p>
<h2><a href="sendmail.phps">sendmail.phps</a></h2>
<p>A simple example using sendmail. Sendmail is a program (usually found on Linux/BSD, OS X and other UNIX-alikes) that can be used to submit messages to a local mail server without a lengthy SMTP conversation. It's probably the fastest sending mechanism, but lacks some error reporting features. There are sendmail emulators for most popular mail servers including postfix, qmail, exim etc.</p>
<h2><a href="gmail.phps">gmail.phps</a></h2>
<p>Submitting email via Google's Gmail service is a popular use of PHPMailer. It's much the same as normal SMTP sending, just with some specific settings, namely using TLS encryption, authentication is enabled, and it connects to the SMTP submission port 587 on the smtp.gmail.com host. This example does all that.</p>
<h2><a href="pop_before_smtp.phps">pop_before_smtp.phps</a></h2>
<p>Before effective SMTP authentication mechanisms were available, it was common for ISPs to use POP-before-SMTP authentication. As it implies, you authenticate using the POP3 protocol (an older protocol now mostly replaced by the far superior IMAP), and then the SMTP server will allow send access from your IP address for a short while, usually 5-15 minutes. PHPMailer includes a POP3 protocol client, so it can carry out this sequence - it's just like a normal SMTP conversation (without authentication), but connects via POP first.</p>
<h2><a href="mailing_list.phps">mailing_list.phps</a></h2>
<p>This is a somewhat naïve example of sending similar emails to a list of different addresses. It sets up a PHPMailer instance using SMTP, then connects to a MySQL database to retrieve a list of recipients. The code loops over this list, sending email to each person using their info and marks them as sent in the database. It makes use of SMTP keepalive which saves reconnecting and re-authenticating between each message.</p>
<hr>
<h2><a href="smtp_check.phps">smtp_check.phps</a></h2>
<p>This is an example showing how to use the SMTP class by itself (without PHPMailer) to check an SMTP connection.</p>
<hr>
<p>Most of these examples use the 'example.com' domain. This domain is reserved by IANA for illustrative purposes, as documented in <a href="http://tools.ietf.org/html/rfc2606">RFC 2606</a>. Don't use made-up domains like 'mydomain.com' or 'somedomain.com' in examples as someone, somewhere, probably owns them!</p>
</body>
</html>

View File

@ -1,12 +1,16 @@
<?php
/**
* This example shows sending a message using PHP's mail() function.
*/
require '../PHPMailerAutoload.php';
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
$mail = new PHPMailer();
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
@ -17,7 +21,7 @@ $mail->addAddress('whoto@example.com', 'John Doe');
$mail->Subject = 'PHPMailer mail() test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
@ -25,7 +29,7 @@ $mail->addAttachment('images/phpmailer_mini.png');
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo "Message sent!";
echo 'Message sent!';
}

View File

@ -1,26 +1,38 @@
<?php
error_reporting(E_STRICT | E_ALL);
/**
* This example shows how to send a message to a whole list of recipients efficiently.
*/
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
error_reporting(E_ALL);
date_default_timezone_set('Etc/UTC');
require '../PHPMailerAutoload.php';
require '../vendor/autoload.php';
$mail = new PHPMailer;
//Passing `true` enables PHPMailer exceptions
$mail = new PHPMailer(true);
$body = file_get_contents('contents.html');
$mail->isSMTP();
$mail->Host = 'smtp.example.com';
$mail->SMTPAuth = true;
$mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent, reduces SMTP overhead
$mail->SMTPKeepAlive = true; //SMTP connection will not close after each email sent, reduces SMTP overhead
$mail->Port = 25;
$mail->Username = 'yourname@example.com';
$mail->Password = 'yourpassword';
$mail->setFrom('list@example.com', 'List manager');
$mail->addReplyTo('list@example.com', 'List manager');
$mail->Subject = "PHPMailer Simple database mailing list test";
$mail->addCustomHeader(
'List-Unsubscribe',
'<mailto:unsubscribes@example.com>, <https://www.example.com/unsubscribe.php>'
);
$mail->Subject = 'PHPMailer Simple database mailing list test';
//Same body for all messages, so set this before the sending loop
//If you generate a different body for each recipient (e.g. you're using a templating system),
@ -33,27 +45,52 @@ $mail->AltBody = 'To view the message, please use an HTML compatible email viewe
//You'll need to alter this to match your database
$mysql = mysqli_connect('localhost', 'username', 'password');
mysqli_select_db($mysql, 'mydb');
$result = mysqli_query($mysql, 'SELECT full_name, email, photo FROM mailinglist WHERE sent = false');
$result = mysqli_query($mysql, 'SELECT full_name, email, photo FROM mailinglist WHERE sent = FALSE');
foreach ($result as $row) { //This iterator syntax only works in PHP 5.4+
$mail->addAddress($row['email'], $row['full_name']);
if (!empty($row['photo'])) {
$mail->addStringAttachment($row['photo'], 'YourPhoto.jpg'); //Assumes the image data is stored in the DB
foreach ($result as $row) {
try {
$mail->addAddress($row['email'], $row['full_name']);
} catch (Exception $e) {
printf(
'Invalid address skipped: %s<br>',
htmlspecialchars($row['email'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401)
);
continue;
}
if (!empty($row['photo'])) {
//Assumes the image data is stored in the DB
$mail->addStringAttachment($row['photo'], 'YourPhoto.jpg');
}
$mail->replaceCustomHeader(
'List-Unsubscribe',
'<mailto:unsubscribes@example.com>, <https://www.example.com/unsubscribe.php?email=' .
rawurlencode($row['email']) . '>'
);
if (!$mail->send()) {
echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br />';
break; //Abandon sending
} else {
echo "Message sent to :" . $row['full_name'] . ' (' . str_replace("@", "&#64;", $row['email']) . ')<br />';
try {
$mail->send();
printf(
'Message sent to : %s (%s)<br>',
htmlspecialchars($row['full_name'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401),
htmlspecialchars($row['email'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401)
);
//Mark it as sent in the DB
mysqli_query(
$mysql,
"UPDATE mailinglist SET sent = true WHERE email = '" .
"UPDATE mailinglist SET sent = TRUE WHERE email = '" .
mysqli_real_escape_string($mysql, $row['email']) . "'"
);
} catch (Exception $e) {
printf(
'Mailer Error (%s) %s<br>',
htmlspecialchars($row['email'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401),
$mail->ErrorInfo
);
//Reset the connection to abort sending this message
//The loop will continue trying to send to the rest of the list
$mail->getSMTPInstance()->reset();
}
// Clear all addresses and attachments for next loop
//Clear all addresses and attachments for the next iteration
$mail->clearAddresses();
$mail->clearAttachments();
}

View File

@ -1,12 +1,20 @@
<?php
/**
* This example shows how to use POP-before-SMTP for authentication.
* POP-before-SMTP is a very old technology that is hardly used any more.
*/
require '../PHPMailerAutoload.php';
//Import PHPMailer classes into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\POP3;
use PHPMailer\PHPMailer\SMTP;
require '../vendor/autoload.php';
//Authenticate via POP3.
//After this you should be allowed to submit messages over SMTP for a while.
//After this you should be allowed to submit messages over SMTP for a few minutes.
//Only applies if your host supports POP-before-SMTP.
$pop = POP3::popBeforeSmtp('pop3.example.com', 110, 30, 'username', 'password', 1);
@ -16,14 +24,12 @@ $mail = new PHPMailer(true);
try {
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//SMTP::DEBUG_OFF = off (for production use)
//SMTP::DEBUG_CLIENT = client messages
//SMTP::DEBUG_SERVER = client and server messages
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
//Set the hostname of the mail server
$mail->Host = "mail.example.com";
$mail->Host = 'mail.example.com';
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port = 25;
//Whether to use SMTP authentication
@ -38,7 +44,7 @@ try {
$mail->Subject = 'PHPMailer POP-before-SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//and convert the HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
@ -46,9 +52,9 @@ try {
//send the message
//Note that we don't need check the response from this because it will throw an exception if it has trouble
$mail->send();
echo "Message sent!";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
echo 'Message sent!';
} catch (Exception $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (\Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}

View File

@ -1,664 +0,0 @@
// XRegExp 1.5.1
// (c) 2007-2012 Steven Levithan
// MIT License
// <http://xregexp.com>
// Provides an augmented, extensible, cross-browser implementation of regular expressions,
// including support for additional syntax, flags, and methods
var XRegExp;
if (XRegExp) {
// Avoid running twice, since that would break references to native globals
throw Error("can't load XRegExp twice in the same frame");
}
// Run within an anonymous function to protect variables and avoid new globals
(function (undefined) {
//---------------------------------
// Constructor
//---------------------------------
// Accepts a pattern and flags; returns a new, extended `RegExp` object. Differs from a native
// regular expression in that additional syntax and flags are supported and cross-browser
// syntax inconsistencies are ameliorated. `XRegExp(/regex/)` clones an existing regex and
// converts to type XRegExp
XRegExp = function (pattern, flags) {
var output = [],
currScope = XRegExp.OUTSIDE_CLASS,
pos = 0,
context, tokenResult, match, chr, regex;
if (XRegExp.isRegExp(pattern)) {
if (flags !== undefined)
throw TypeError("can't supply flags when constructing one RegExp from another");
return clone(pattern);
}
// Tokens become part of the regex construction process, so protect against infinite
// recursion when an XRegExp is constructed within a token handler or trigger
if (isInsideConstructor)
throw Error("can't call the XRegExp constructor within token definition functions");
flags = flags || "";
context = { // `this` object for custom tokens
hasNamedCapture: false,
captureNames: [],
hasFlag: function (flag) {return flags.indexOf(flag) > -1;},
setFlag: function (flag) {flags += flag;}
};
while (pos < pattern.length) {
// Check for custom tokens at the current position
tokenResult = runTokens(pattern, pos, currScope, context);
if (tokenResult) {
output.push(tokenResult.output);
pos += (tokenResult.match[0].length || 1);
} else {
// Check for native multicharacter metasequences (excluding character classes) at
// the current position
if (match = nativ.exec.call(nativeTokens[currScope], pattern.slice(pos))) {
output.push(match[0]);
pos += match[0].length;
} else {
chr = pattern.charAt(pos);
if (chr === "[")
currScope = XRegExp.INSIDE_CLASS;
else if (chr === "]")
currScope = XRegExp.OUTSIDE_CLASS;
// Advance position one character
output.push(chr);
pos++;
}
}
}
regex = RegExp(output.join(""), nativ.replace.call(flags, flagClip, ""));
regex._xregexp = {
source: pattern,
captureNames: context.hasNamedCapture ? context.captureNames : null
};
return regex;
};
//---------------------------------
// Public properties
//---------------------------------
XRegExp.version = "1.5.1";
// Token scope bitflags
XRegExp.INSIDE_CLASS = 1;
XRegExp.OUTSIDE_CLASS = 2;
//---------------------------------
// Private variables
//---------------------------------
var replacementToken = /\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g,
flagClip = /[^gimy]+|([\s\S])(?=[\s\S]*\1)/g, // Nonnative and duplicate flags
quantifier = /^(?:[?*+]|{\d+(?:,\d*)?})\??/,
isInsideConstructor = false,
tokens = [],
// Copy native globals for reference ("native" is an ES3 reserved keyword)
nativ = {
exec: RegExp.prototype.exec,
test: RegExp.prototype.test,
match: String.prototype.match,
replace: String.prototype.replace,
split: String.prototype.split
},
compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups
compliantLastIndexIncrement = function () {
var x = /^/g;
nativ.test.call(x, "");
return !x.lastIndex;
}(),
hasNativeY = RegExp.prototype.sticky !== undefined,
nativeTokens = {};
// `nativeTokens` match native multicharacter metasequences only (including deprecated octals,
// excluding character classes)
nativeTokens[XRegExp.INSIDE_CLASS] = /^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/;
nativeTokens[XRegExp.OUTSIDE_CLASS] = /^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/;
//---------------------------------
// Public methods
//---------------------------------
// Lets you extend or change XRegExp syntax and create custom flags. This is used internally by
// the XRegExp library and can be used to create XRegExp plugins. This function is intended for
// users with advanced knowledge of JavaScript's regular expression syntax and behavior. It can
// be disabled by `XRegExp.freezeTokens`
XRegExp.addToken = function (regex, handler, scope, trigger) {
tokens.push({
pattern: clone(regex, "g" + (hasNativeY ? "y" : "")),
handler: handler,
scope: scope || XRegExp.OUTSIDE_CLASS,
trigger: trigger || null
});
};
// Accepts a pattern and flags; returns an extended `RegExp` object. If the pattern and flag
// combination has previously been cached, the cached copy is returned; otherwise the newly
// created regex is cached
XRegExp.cache = function (pattern, flags) {
var key = pattern + "/" + (flags || "");
return XRegExp.cache[key] || (XRegExp.cache[key] = XRegExp(pattern, flags));
};
// Accepts a `RegExp` instance; returns a copy with the `/g` flag set. The copy has a fresh
// `lastIndex` (set to zero). If you want to copy a regex without forcing the `global`
// property, use `XRegExp(regex)`. Do not use `RegExp(regex)` because it will not preserve
// special properties required for named capture
XRegExp.copyAsGlobal = function (regex) {
return clone(regex, "g");
};
// Accepts a string; returns the string with regex metacharacters escaped. The returned string
// can safely be used at any point within a regex to match the provided literal string. Escaped
// characters are [ ] { } ( ) * + ? - . , \ ^ $ | # and whitespace
XRegExp.escape = function (str) {
return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
};
// Accepts a string to search, regex to search with, position to start the search within the
// string (default: 0), and an optional Boolean indicating whether matches must start at-or-
// after the position or at the specified position only. This function ignores the `lastIndex`
// of the provided regex in its own handling, but updates the property for compatibility
XRegExp.execAt = function (str, regex, pos, anchored) {
var r2 = clone(regex, "g" + ((anchored && hasNativeY) ? "y" : "")),
match;
r2.lastIndex = pos = pos || 0;
match = r2.exec(str); // Run the altered `exec` (required for `lastIndex` fix, etc.)
if (anchored && match && match.index !== pos)
match = null;
if (regex.global)
regex.lastIndex = match ? r2.lastIndex : 0;
return match;
};
// Breaks the unrestorable link to XRegExp's private list of tokens, thereby preventing
// syntax and flag changes. Should be run after XRegExp and any plugins are loaded
XRegExp.freezeTokens = function () {
XRegExp.addToken = function () {
throw Error("can't run addToken after freezeTokens");
};
};
// Accepts any value; returns a Boolean indicating whether the argument is a `RegExp` object.
// Note that this is also `true` for regex literals and regexes created by the `XRegExp`
// constructor. This works correctly for variables created in another frame, when `instanceof`
// and `constructor` checks would fail to work as intended
XRegExp.isRegExp = function (o) {
return Object.prototype.toString.call(o) === "[object RegExp]";
};
// Executes `callback` once per match within `str`. Provides a simpler and cleaner way to
// iterate over regex matches compared to the traditional approaches of subverting
// `String.prototype.replace` or repeatedly calling `exec` within a `while` loop
XRegExp.iterate = function (str, regex, callback, context) {
var r2 = clone(regex, "g"),
i = -1, match;
while (match = r2.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.)
if (regex.global)
regex.lastIndex = r2.lastIndex; // Doing this to follow expectations if `lastIndex` is checked within `callback`
callback.call(context, match, ++i, str, regex);
if (r2.lastIndex === match.index)
r2.lastIndex++;
}
if (regex.global)
regex.lastIndex = 0;
};
// Accepts a string and an array of regexes; returns the result of using each successive regex
// to search within the matches of the previous regex. The array of regexes can also contain
// objects with `regex` and `backref` properties, in which case the named or numbered back-
// references specified are passed forward to the next regex or returned. E.g.:
// var xregexpImgFileNames = XRegExp.matchChain(html, [
// {regex: /<img\b([^>]+)>/i, backref: 1}, // <img> tag attributes
// {regex: XRegExp('(?ix) \\s src=" (?<src> [^"]+ )'), backref: "src"}, // src attribute values
// {regex: XRegExp("^http://xregexp\\.com(/[^#?]+)", "i"), backref: 1}, // xregexp.com paths
// /[^\/]+$/ // filenames (strip directory paths)
// ]);
XRegExp.matchChain = function (str, chain) {
return function recurseChain (values, level) {
var item = chain[level].regex ? chain[level] : {regex: chain[level]},
regex = clone(item.regex, "g"),
matches = [], i;
for (i = 0; i < values.length; i++) {
XRegExp.iterate(values[i], regex, function (match) {
matches.push(item.backref ? (match[item.backref] || "") : match[0]);
});
}
return ((level === chain.length - 1) || !matches.length) ?
matches : recurseChain(matches, level + 1);
}([str], 0);
};
//---------------------------------
// New RegExp prototype methods
//---------------------------------
// Accepts a context object and arguments array; returns the result of calling `exec` with the
// first value in the arguments array. the context is ignored but is accepted for congruity
// with `Function.prototype.apply`
RegExp.prototype.apply = function (context, args) {
return this.exec(args[0]);
};
// Accepts a context object and string; returns the result of calling `exec` with the provided
// string. the context is ignored but is accepted for congruity with `Function.prototype.call`
RegExp.prototype.call = function (context, str) {
return this.exec(str);
};
//---------------------------------
// Overridden native methods
//---------------------------------
// Adds named capture support (with backreferences returned as `result.name`), and fixes two
// cross-browser issues per ES3:
// - Captured values for nonparticipating capturing groups should be returned as `undefined`,
// rather than the empty string.
// - `lastIndex` should not be incremented after zero-length matches.
RegExp.prototype.exec = function (str) {
var match, name, r2, origLastIndex;
if (!this.global)
origLastIndex = this.lastIndex;
match = nativ.exec.apply(this, arguments);
if (match) {
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
r2 = RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", ""));
// Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed
// matching due to characters outside the match
nativ.replace.call((str + "").slice(match.index), r2, function () {
for (var i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined)
match[i] = undefined;
}
});
}
// Attach named capture properties
if (this._xregexp && this._xregexp.captureNames) {
for (var i = 1; i < match.length; i++) {
name = this._xregexp.captureNames[i - 1];
if (name)
match[name] = match[i];
}
}
// Fix browsers that increment `lastIndex` after zero-length matches
if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
this.lastIndex--;
}
if (!this.global)
this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows)
return match;
};
// Fix browser bugs in native method
RegExp.prototype.test = function (str) {
// Use the native `exec` to skip some processing overhead, even though the altered
// `exec` would take care of the `lastIndex` fixes
var match, origLastIndex;
if (!this.global)
origLastIndex = this.lastIndex;
match = nativ.exec.call(this, str);
// Fix browsers that increment `lastIndex` after zero-length matches
if (match && !compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
this.lastIndex--;
if (!this.global)
this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows)
return !!match;
};
// Adds named capture support and fixes browser bugs in native method
String.prototype.match = function (regex) {
if (!XRegExp.isRegExp(regex))
regex = RegExp(regex); // Native `RegExp`
if (regex.global) {
var result = nativ.match.apply(this, arguments);
regex.lastIndex = 0; // Fix IE bug
return result;
}
return regex.exec(this); // Run the altered `exec`
};
// Adds support for `${n}` tokens for named and numbered backreferences in replacement text,
// and provides named backreferences to replacement functions as `arguments[0].name`. Also
// fixes cross-browser differences in replacement text syntax when performing a replacement
// using a nonregex search value, and the value of replacement regexes' `lastIndex` property
// during replacement iterations. Note that this doesn't support SpiderMonkey's proprietary
// third (`flags`) parameter
String.prototype.replace = function (search, replacement) {
var isRegex = XRegExp.isRegExp(search),
captureNames, result, str, origLastIndex;
// There are too many combinations of search/replacement types/values and browser bugs that
// preclude passing to native `replace`, so don't try
//if (...)
// return nativ.replace.apply(this, arguments);
if (isRegex) {
if (search._xregexp)
captureNames = search._xregexp.captureNames; // Array or `null`
if (!search.global)
origLastIndex = search.lastIndex;
} else {
search = search + ""; // Type conversion
}
if (Object.prototype.toString.call(replacement) === "[object Function]") {
result = nativ.replace.call(this + "", search, function () {
if (captureNames) {
// Change the `arguments[0]` string primitive to a String object which can store properties
arguments[0] = new String(arguments[0]);
// Store named backreferences on `arguments[0]`
for (var i = 0; i < captureNames.length; i++) {
if (captureNames[i])
arguments[0][captureNames[i]] = arguments[i + 1];
}
}
// Update `lastIndex` before calling `replacement` (fix browsers)
if (isRegex && search.global)
search.lastIndex = arguments[arguments.length - 2] + arguments[0].length;
return replacement.apply(null, arguments);
});
} else {
str = this + ""; // Type conversion, so `args[args.length - 1]` will be a string (given nonstring `this`)
result = nativ.replace.call(str, search, function () {
var args = arguments; // Keep this function's `arguments` available through closure
return nativ.replace.call(replacement + "", replacementToken, function ($0, $1, $2) {
// Numbered backreference (without delimiters) or special variable
if ($1) {
switch ($1) {
case "$": return "$";
case "&": return args[0];
case "`": return args[args.length - 1].slice(0, args[args.length - 2]);
case "'": return args[args.length - 1].slice(args[args.length - 2] + args[0].length);
// Numbered backreference
default:
// What does "$10" mean?
// - Backreference 10, if 10 or more capturing groups exist
// - Backreference 1 followed by "0", if 1-9 capturing groups exist
// - Otherwise, it's the string "$10"
// Also note:
// - Backreferences cannot be more than two digits (enforced by `replacementToken`)
// - "$01" is equivalent to "$1" if a capturing group exists, otherwise it's the string "$01"
// - There is no "$0" token ("$&" is the entire match)
var literalNumbers = "";
$1 = +$1; // Type conversion; drop leading zero
if (!$1) // `$1` was "0" or "00"
return $0;
while ($1 > args.length - 3) {
literalNumbers = String.prototype.slice.call($1, -1) + literalNumbers;
$1 = Math.floor($1 / 10); // Drop the last digit
}
return ($1 ? args[$1] || "" : "$") + literalNumbers;
}
// Named backreference or delimited numbered backreference
} else {
// What does "${n}" mean?
// - Backreference to numbered capture n. Two differences from "$n":
// - n can be more than two digits
// - Backreference 0 is allowed, and is the entire match
// - Backreference to named capture n, if it exists and is not a number overridden by numbered capture
// - Otherwise, it's the string "${n}"
var n = +$2; // Type conversion; drop leading zeros
if (n <= args.length - 3)
return args[n];
n = captureNames ? indexOf(captureNames, $2) : -1;
return n > -1 ? args[n + 1] : $0;
}
});
});
}
if (isRegex) {
if (search.global)
search.lastIndex = 0; // Fix IE, Safari bug (last tested IE 9.0.5, Safari 5.1.2 on Windows)
else
search.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows)
}
return result;
};
// A consistent cross-browser, ES3 compliant `split`
String.prototype.split = function (s /* separator */, limit) {
// If separator `s` is not a regex, use the native `split`
if (!XRegExp.isRegExp(s))
return nativ.split.apply(this, arguments);
var str = this + "", // Type conversion
output = [],
lastLastIndex = 0,
match, lastLength;
// Behavior for `limit`: if it's...
// - `undefined`: No limit
// - `NaN` or zero: Return an empty array
// - A positive number: Use `Math.floor(limit)`
// - A negative number: No limit
// - Other: Type-convert, then use the above rules
if (limit === undefined || +limit < 0) {
limit = Infinity;
} else {
limit = Math.floor(+limit);
if (!limit)
return [];
}
// This is required if not `s.global`, and it avoids needing to set `s.lastIndex` to zero
// and restore it to its original value when we're done using the regex
s = XRegExp.copyAsGlobal(s);
while (match = s.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.)
if (s.lastIndex > lastLastIndex) {
output.push(str.slice(lastLastIndex, match.index));
if (match.length > 1 && match.index < str.length)
Array.prototype.push.apply(output, match.slice(1));
lastLength = match[0].length;
lastLastIndex = s.lastIndex;
if (output.length >= limit)
break;
}
if (s.lastIndex === match.index)
s.lastIndex++;
}
if (lastLastIndex === str.length) {
if (!nativ.test.call(s, "") || lastLength)
output.push("");
} else {
output.push(str.slice(lastLastIndex));
}
return output.length > limit ? output.slice(0, limit) : output;
};
//---------------------------------
// Private helper functions
//---------------------------------
// Supporting function for `XRegExp`, `XRegExp.copyAsGlobal`, etc. Returns a copy of a `RegExp`
// instance with a fresh `lastIndex` (set to zero), preserving properties required for named
// capture. Also allows adding new flags in the process of copying the regex
function clone (regex, additionalFlags) {
if (!XRegExp.isRegExp(regex))
throw TypeError("type RegExp expected");
var x = regex._xregexp;
regex = XRegExp(regex.source, getNativeFlags(regex) + (additionalFlags || ""));
if (x) {
regex._xregexp = {
source: x.source,
captureNames: x.captureNames ? x.captureNames.slice(0) : null
};
}
return regex;
}
function getNativeFlags (regex) {
return (regex.global ? "g" : "") +
(regex.ignoreCase ? "i" : "") +
(regex.multiline ? "m" : "") +
(regex.extended ? "x" : "") + // Proposed for ES4; included in AS3
(regex.sticky ? "y" : "");
}
function runTokens (pattern, index, scope, context) {
var i = tokens.length,
result, match, t;
// Protect against constructing XRegExps within token handler and trigger functions
isInsideConstructor = true;
// Must reset `isInsideConstructor`, even if a `trigger` or `handler` throws
try {
while (i--) { // Run in reverse order
t = tokens[i];
if ((scope & t.scope) && (!t.trigger || t.trigger.call(context))) {
t.pattern.lastIndex = index;
match = t.pattern.exec(pattern); // Running the altered `exec` here allows use of named backreferences, etc.
if (match && match.index === index) {
result = {
output: t.handler.call(context, match, scope),
match: match
};
break;
}
}
}
} catch (err) {
throw err;
} finally {
isInsideConstructor = false;
}
return result;
}
function indexOf (array, item, from) {
if (Array.prototype.indexOf) // Use the native array method if available
return array.indexOf(item, from);
for (var i = from || 0; i < array.length; i++) {
if (array[i] === item)
return i;
}
return -1;
}
//---------------------------------
// Built-in tokens
//---------------------------------
// Augment XRegExp's regular expression syntax and flags. Note that when adding tokens, the
// third (`scope`) argument defaults to `XRegExp.OUTSIDE_CLASS`
// Comment pattern: (?# )
XRegExp.addToken(
/\(\?#[^)]*\)/,
function (match) {
// Keep tokens separated unless the following token is a quantifier
return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)";
}
);
// Capturing group (match the opening parenthesis only).
// Required for support of named capturing groups
XRegExp.addToken(
/\((?!\?)/,
function () {
this.captureNames.push(null);
return "(";
}
);
// Named capturing group (match the opening delimiter only): (?<name>
XRegExp.addToken(
/\(\?<([$\w]+)>/,
function (match) {
this.captureNames.push(match[1]);
this.hasNamedCapture = true;
return "(";
}
);
// Named backreference: \k<name>
XRegExp.addToken(
/\\k<([\w$]+)>/,
function (match) {
var index = indexOf(this.captureNames, match[1]);
// Keep backreferences separate from subsequent literal numbers. Preserve back-
// references to named groups that are undefined at this point as literal strings
return index > -1 ?
"\\" + (index + 1) + (isNaN(match.input.charAt(match.index + match[0].length)) ? "" : "(?:)") :
match[0];
}
);
// Empty character class: [] or [^]
XRegExp.addToken(
/\[\^?]/,
function (match) {
// For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S].
// (?!) should work like \b\B, but is unreliable in Firefox
return match[0] === "[]" ? "\\b\\B" : "[\\s\\S]";
}
);
// Mode modifier at the start of the pattern only, with any combination of flags imsx: (?imsx)
// Does not support x(?i), (?-i), (?i-m), (?i: ), (?i)(?m), etc.
XRegExp.addToken(
/^\(\?([imsx]+)\)/,
function (match) {
this.setFlag(match[1]);
return "";
}
);
// Whitespace and comments, in free-spacing (aka extended) mode only
XRegExp.addToken(
/(?:\s+|#.*)+/,
function (match) {
// Keep tokens separated unless the following token is a quantifier
return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)";
},
XRegExp.OUTSIDE_CLASS,
function () {return this.hasFlag("x");}
);
// Dot, in dotall (aka singleline) mode only
XRegExp.addToken(
/\./,
function () {return "[\\s\\S]";},
XRegExp.OUTSIDE_CLASS,
function () {return this.hasFlag("s");}
);
//---------------------------------
// Backward compatibility
//---------------------------------
// Uncomment the following block for compatibility with XRegExp 1.0-1.2:
/*
XRegExp.matchWithinChain = XRegExp.matchChain;
RegExp.prototype.addFlags = function (s) {return clone(this, s);};
RegExp.prototype.execAll = function (s) {var r = []; XRegExp.iterate(s, this, function (m) {r.push(m);}); return r;};
RegExp.prototype.forEachExec = function (s, f, c) {return XRegExp.iterate(s, this, f, c);};
RegExp.prototype.validate = function (s) {var r = RegExp("^(?:" + this.source + ")$(?!\\s)", getNativeFlags(this)); if (this.global) this.lastIndex = 0; return s.search(r) === 0;};
*/
})();

View File

@ -1,122 +0,0 @@
(function() {
var sh = SyntaxHighlighter;
/**
* Provides functionality to dynamically load only the brushes that a needed to render the current page.
*
* There are two syntaxes that autoload understands. For example:
*
* SyntaxHighlighter.autoloader(
* [ 'applescript', 'Scripts/shBrushAppleScript.js' ],
* [ 'actionscript3', 'as3', 'Scripts/shBrushAS3.js' ]
* );
*
* or a more easily comprehendable one:
*
* SyntaxHighlighter.autoloader(
* 'applescript Scripts/shBrushAppleScript.js',
* 'actionscript3 as3 Scripts/shBrushAS3.js'
* );
*/
sh.autoloader = function()
{
var list = arguments,
elements = sh.findElements(),
brushes = {},
scripts = {},
all = SyntaxHighlighter.all,
allCalled = false,
allParams = null,
i
;
SyntaxHighlighter.all = function(params)
{
allParams = params;
allCalled = true;
};
function addBrush(aliases, url)
{
for (var i = 0; i < aliases.length; i++)
brushes[aliases[i]] = url;
};
function getAliases(item)
{
return item.pop
? item
: item.split(/\s+/)
;
}
// create table of aliases and script urls
for (i = 0; i < list.length; i++)
{
var aliases = getAliases(list[i]),
url = aliases.pop()
;
addBrush(aliases, url);
}
// dynamically add <script /> tags to the document body
for (i = 0; i < elements.length; i++)
{
var url = brushes[elements[i].params.brush];
if(url && scripts[url] === undefined)
{
if(elements[i].params['html-script'] === 'true')
{
if(scripts[brushes['xml']] === undefined) {
loadScript(brushes['xml']);
scripts[url] = false;
}
}
scripts[url] = false;
loadScript(url);
}
}
function loadScript(url)
{
var script = document.createElement('script'),
done = false
;
script.src = url;
script.type = 'text/javascript';
script.language = 'javascript';
script.onload = script.onreadystatechange = function()
{
if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'))
{
done = true;
scripts[url] = true;
checkAll();
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
script.parentNode.removeChild(script);
}
};
// sync way of adding script tags to the page
document.body.appendChild(script);
};
function checkAll()
{
for(var url in scripts)
if (scripts[url] == false)
return;
if (allCalled)
SyntaxHighlighter.highlight(allParams);
};
};
})();

View File

@ -1,72 +0,0 @@
;(function()
{
// CommonJS
SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
function Brush()
{
var funcs = 'abs acos acosh addcslashes addslashes ' +
'array_change_key_case array_chunk array_combine array_count_values array_diff '+
'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
'array_push array_rand array_reduce array_reverse array_search array_shift '+
'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+
'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
'strtoupper strtr strval substr substr_compare';
var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' +
'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' +
'function global goto if implements include include_once interface instanceof insteadof namespace new ' +
'old_function or private protected public return require require_once static switch ' +
'trait throw try use var while xor ';
var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\$\w+/g, css: 'variable' }, // variables
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions
{ regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword
];
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['php'];
SyntaxHighlighter.brushes.Php = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

File diff suppressed because one or more lines are too long

View File

@ -1,140 +0,0 @@
var dp = {
SyntaxHighlighter : {}
};
dp.SyntaxHighlighter = {
parseParams: function(
input,
showGutter,
showControls,
collapseAll,
firstLine,
showColumns
)
{
function getValue(list, name)
{
var regex = new XRegExp('^' + name + '\\[(?<value>\\w+)\\]$', 'gi'),
match = null
;
for (var i = 0; i < list.length; i++)
if ((match = regex.exec(list[i])) != null)
return match.value;
return null;
}
function defaultValue(value, def)
{
return value != null ? value : def;
}
function asString(value)
{
return value != null ? value.toString() : null;
}
var parts = input.split(':'),
brushName = parts[0],
options = {},
straight = { 'true' : true },
reverse = { 'true' : false },
defaults = SyntaxHighlighter.defaults
;
for (var i in parts)
options[parts[i]] = 'true';
showGutter = asString(defaultValue(showGutter, defaults.gutter));
showControls = asString(defaultValue(showControls, defaults.toolbar));
collapseAll = asString(defaultValue(collapseAll, defaults.collapse));
showColumns = asString(defaultValue(showColumns, defaults.ruler));
firstLine = asString(defaultValue(firstLine, defaults['first-line']));
return {
brush : brushName,
gutter : defaultValue(reverse[options.nogutter], showGutter),
toolbar : defaultValue(reverse[options.nocontrols], showControls),
collapse : defaultValue(straight[options.collapse], collapseAll),
// ruler : defaultValue(straight[options.showcolumns], showColumns),
'first-line' : defaultValue(getValue(parts, 'firstline'), firstLine)
};
},
HighlightAll: function(
name,
showGutter /* optional */,
showControls /* optional */,
collapseAll /* optional */,
firstLine /* optional */,
showColumns /* optional */
)
{
function findValue()
{
var a = arguments;
for (var i = 0; i < a.length; i++)
{
if (a[i] === null)
continue;
if (typeof(a[i]) == 'string' && a[i] != '')
return a[i] + '';
if (typeof(a[i]) == 'object' && a[i].value != '')
return a[i].value + '';
}
return null;
}
function findTagsByName(list, name, tagName)
{
var tags = document.getElementsByTagName(tagName);
for (var i = 0; i < tags.length; i++)
if (tags[i].getAttribute('name') == name)
list.push(tags[i]);
}
var elements = [],
highlighter = null,
registered = {},
propertyName = 'innerHTML'
;
// for some reason IE doesn't find <pre/> by name, however it does see them just fine by tag name...
findTagsByName(elements, name, 'pre');
findTagsByName(elements, name, 'textarea');
if (elements.length === 0)
return;
for (var i = 0; i < elements.length; i++)
{
var element = elements[i],
params = findValue(
element.attributes['class'], element.className,
element.attributes['language'], element.language
),
language = ''
;
if (params === null)
continue;
params = dp.SyntaxHighlighter.parseParams(
params,
showGutter,
showControls,
collapseAll,
firstLine,
showColumns
);
SyntaxHighlighter.highlight(params, element);
}
}
};

View File

@ -1,29 +1,40 @@
<?php
/**
* PHPMailer simple file upload and send example
* PHPMailer simple file upload and send example.
*/
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
require '../vendor/autoload.php';
$msg = '';
if (array_key_exists('userfile', $_FILES)) {
// First handle the upload
// Don't trust provided filename - same goes for MIME types
// See http://php.net/manual/en/features.file-upload.php#114004 for more thorough upload validation
$uploadfile = tempnam(sys_get_temp_dir(), sha1($_FILES['userfile']['name']));
//First handle the upload
//Don't trust provided filename - same goes for MIME types
//See https://www.php.net/manual/en/features.file-upload.php#114004 for more thorough upload validation
//Extract an extension from the provided filename
$ext = PHPMailer::mb_pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION);
//Define a safe location to move the uploaded file to, preserving the extension
$uploadfile = tempnam(sys_get_temp_dir(), hash('sha256', $_FILES['userfile']['name'])) . '.' . $ext;
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
// Upload handled successfully
// Now create a message
// This should be somewhere in your include_path
require '../PHPMailerAutoload.php';
$mail = new PHPMailer;
//Upload handled successfully
//Now create a message
$mail = new PHPMailer();
$mail->setFrom('from@example.com', 'First Last');
$mail->addAddress('whoto@example.com', 'John Doe');
$mail->Subject = 'PHPMailer file sender';
$mail->Body = 'My message body';
// Attach the uploaded file
$mail->addAttachment($uploadfile, 'My uploaded file');
//Attach the uploaded file
if (!$mail->addAttachment($uploadfile, 'My uploaded file')) {
$msg .= 'Failed to attach file ' . $_FILES['userfile']['name'];
}
if (!$mail->send()) {
$msg .= "Mailer Error: " . $mail->ErrorInfo;
$msg .= 'Mailer Error: ' . $mail->ErrorInfo;
} else {
$msg .= "Message sent!";
$msg .= 'Message sent!';
}
} else {
$msg .= 'Failed to move file to ' . $uploadfile;
@ -31,7 +42,7 @@ if (array_key_exists('userfile', $_FILES)) {
}
?>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHPMailer Upload</title>
@ -43,7 +54,7 @@ if (array_key_exists('userfile', $_FILES)) {
<input type="submit" value="Send File">
</form>
<?php } else {
echo $msg;
echo htmlspecialchars($msg, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401);
} ?>
</body>
</html>
</html>

View File

@ -1,37 +1,46 @@
<?php
/**
* PHPMailer multiple files upload and send example
*/
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
require '../vendor/autoload.php';
$msg = '';
if (array_key_exists('userfile', $_FILES)) {
// Create a message
// This should be somewhere in your include_path
require '../PHPMailerAutoload.php';
$mail = new PHPMailer;
//Create a message
$mail = new PHPMailer();
$mail->setFrom('from@example.com', 'First Last');
$mail->addAddress('whoto@example.com', 'John Doe');
$mail->Subject = 'PHPMailer file sender';
$mail->Body = 'My message body';
//Attach multiple files one by one
for ($ct = 0; $ct < count($_FILES['userfile']['tmp_name']); $ct++) {
$uploadfile = tempnam(sys_get_temp_dir(), sha1($_FILES['userfile']['name'][$ct]));
for ($ct = 0, $ctMax = count($_FILES['userfile']['tmp_name']); $ct < $ctMax; $ct++) {
//Extract an extension from the provided filename
$ext = PHPMailer::mb_pathinfo($_FILES['userfile']['name'][$ct], PATHINFO_EXTENSION);
//Define a safe location to move the uploaded file to, preserving the extension
$uploadfile = tempnam(sys_get_temp_dir(), hash('sha256', $_FILES['userfile']['name'][$ct])) . '.' . $ext;
$filename = $_FILES['userfile']['name'][$ct];
if (move_uploaded_file($_FILES['userfile']['tmp_name'][$ct], $uploadfile)) {
$mail->addAttachment($uploadfile, $filename);
if (!$mail->addAttachment($uploadfile, $filename)) {
$msg .= 'Failed to attach file ' . $filename;
}
} else {
$msg .= 'Failed to move file to ' . $uploadfile;
}
}
if (!$mail->send()) {
$msg .= "Mailer Error: " . $mail->ErrorInfo;
$msg .= 'Mailer Error: ' . $mail->ErrorInfo;
} else {
$msg .= "Message sent!";
$msg .= 'Message sent!';
}
}
?>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHPMailer Upload</title>
@ -45,7 +54,7 @@ if (array_key_exists('userfile', $_FILES)) {
<input type="submit" value="Send Files">
</form>
<?php } else {
echo $msg;
echo htmlspecialchars($msg, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401);
} ?>
</body>
</html>

View File

@ -1,13 +1,17 @@
<?php
/**
* This example shows sending a message using a local sendmail binary.
*/
require '../PHPMailerAutoload.php';
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
// Set PHPMailer to use the sendmail transport
$mail = new PHPMailer();
//Set PHPMailer to use the sendmail transport
$mail->isSendmail();
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
@ -19,7 +23,7 @@ $mail->addAddress('whoto@example.com', 'John Doe');
$mail->Subject = 'PHPMailer sendmail test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
@ -27,7 +31,7 @@ $mail->addAttachment('images/phpmailer_mini.png');
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo "Message sent!";
echo 'Message sent!';
}

100
examples/sendoauth2.phps Normal file
View File

@ -0,0 +1,100 @@
<?php
/**
* The SendOauth2 wrapper supports OAuth2 and Basic authorization/authentication for
* Microsoft 365 Exchange email and Google Gmail. Both TheLeague's Google provider + client
* and Google's 'official' GoogleAPI client are supported. The wrapper supports any authentication
* mechanism provided by these systems: authorization_code grant and client_credentials grant
* (aka Google 'service accounts'), client secrets and X.509 certificates, $_SESSION 'state'
* and PKCE code exchanges, and creation on the fly of GoogleAPI's .json credentials files.
* Appropriate scopes (client permissions) and 'provider' overrides are added automatically.
*
* The wrapper is installed with Composer from the decomplexity/SendOauth2 repo; see its README.
*
* The wrapper can also be invoked using fewer (or even no) arguments; this is for those websites
* that use PHPMailer in several places. See the repo for details.
*/
// Import PHPMailer classes
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
// Import SendOauth2B class
use decomplexity\SendOauth2\SendOauth2B;
// Uncomment the next two lines to display PHP errors
// error_reporting(E_ALL);
// ini_set("display_errors", 1);
// Load Composer's autoloader
require 'vendor/autoload.php';
// Set timezone for SMTP
date_default_timezone_set('Etc/UTC');
// Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);
try {
// Server settings
$mail->isSMTP(); // Use SMTP
$mail->SMTPDebug = SMTP::DEBUG_OFF; // Set DEBUG_LOWLEVEL for SMTP diagnostics
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable implicit TLS encryption
$mail->Port = 587; // TCP port; MSFT doesn't like 465
$mail->AuthType = 'XOAUTH2'; // Set AuthType to use XOAUTH2 ('LOGIN' for Basic auth)
// Sender and recipients
$mail->setFrom('from@example.com', 'Mailer'); // 'Header' From address with optional sender name
$mail->addAddress('joe@example.net', 'Joe User'); // Add a To: recipient
/**
* Authenticate
* Note that any ClientCertificatePrivateKey should include the -----BEGIN PRIVATE KEY----- and
* -----END PRIVATE KEY-----
*/
$oauthTokenProvider = new SendOauth2B(
[
'mail' => $mail, // PHPMailer instance
'clientId' => 'long string', // for Google service account, Unique ID
'clientSecret' => 'long string', // or null if using a certificate
'clientCertificatePrivateKey' => 'ultra long string', // or null if using a clientSecret
'clientCertificateThumbprint' => 'long string', // or null if using a clientSecret
'serviceProvider' => 'Microsoft', // literal: also 'Google' or 'GoogleAPI'
'authTypeSetting' => $mail->AuthType, // is set above - or insert here as 'XOAUTH2'
'mailSMTPAddress' => 'me@mydomain.com', // Envelope/mailFrom/reverse-path From address
'refreshToken' => 'very long string', // null if grantType is 'client_credentials'
'grantType' => 'authorization_code', // or 'client_credentials'
'tenant' => 'long string', // MSFT tenant GUID. Null for Gmail
'hostedDomain' => 'mydomain.com', // Any Google (and optional). Null for MSFT
'projectID' => 'string', // GoogleAPI only. Else null
'serviceAccountName' => 'string', // GoogleAPI service account only. Else null
'impersonate' => 'you@mydomain.com', // Google API service account only. Else null
// default to 'mailSMTPAddress', must be
// a Google Wspace email adddress, not @gmail
'gmailXoauth2Credentials' => 'your credentials.json', // File name - defaults to:
// gmail-xoauth2-credentials.json
'writeGmailCredentialsFile' => 'yes' or 'no', // Defaults to 'yes'; meaning the
// credentials json is dynamically created
]
);
$mail->setOAuth($oauthTokenProvider); // Pass OAuthTokenProvider to PHPMailer
$mail->Host = 'smtp.office365.com'; // Set SMTP server (smtp.gmail.com for Gmail)
// Content
$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';
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ' . htmlspecialchars($mail->ErrorInfo, ENT_QUOTES);
}

View File

@ -0,0 +1,102 @@
<?php
/**
* PHPMailer simple contact form example.
* If you want to accept and send uploads in your form, look at the send_file_upload example.
*/
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
require '../vendor/autoload.php';
if (array_key_exists('email', $_POST)) {
$err = false;
$msg = '';
$email = '';
//Apply some basic validation and filtering to the subject
if (array_key_exists('subject', $_POST)) {
$subject = substr(strip_tags($_POST['subject']), 0, 255);
} else {
$subject = 'No subject given';
}
//Apply some basic validation and filtering to the query
if (array_key_exists('query', $_POST)) {
//Limit length and strip HTML tags
$query = substr(strip_tags($_POST['query']), 0, 16384);
} else {
$query = '';
$msg = 'No query provided!';
$err = true;
}
//Apply some basic validation and filtering to the name
if (array_key_exists('name', $_POST)) {
//Limit length and strip HTML tags
$name = substr(strip_tags($_POST['name']), 0, 255);
} else {
$name = '';
}
//Validate to address
//Never allow arbitrary input for the 'to' address as it will turn your form into a spam gateway!
//Substitute appropriate addresses from your own domain, or simply use a single, fixed address
if (array_key_exists('to', $_POST) && in_array($_POST['to'], ['sales', 'support', 'accounts'], true)) {
$to = $_POST['to'] . '@example.com';
} else {
$to = 'support@example.com';
}
//Make sure the address they provided is valid before trying to use it
if (PHPMailer::validateAddress($_POST['email'])) {
$email = $_POST['email'];
} else {
$msg .= 'Error: invalid email address provided';
$err = true;
}
if (!$err) {
$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = 'localhost';
$mail->Port = 25;
$mail->CharSet = PHPMailer::CHARSET_UTF8;
//It's important not to use the submitter's address as the from address as it's forgery,
//which will cause your messages to fail SPF checks.
//Use an address in your own domain as the from address, put the submitter's address in a reply-to
$mail->setFrom('contact@example.com', (empty($name) ? 'Contact form' : $name));
$mail->addAddress($to);
$mail->addReplyTo($email, $name);
$mail->Subject = 'Contact form: ' . $subject;
$mail->Body = "Contact form submission\n\n" . $query;
if (!$mail->send()) {
$msg .= 'Mailer Error: ' . $mail->ErrorInfo;
} else {
$msg .= 'Message sent!';
}
}
} ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHPMailer Contact Form</title>
</head>
<body>
<h1>Contact us</h1>
<?php if (empty($msg)) { ?>
<form method="post">
<label for="to">Send to:</label>
<select name="to" id="to">
<option value="sales">Sales</option>
<option value="support" selected="selected">Support</option>
<option value="accounts">Accounts</option>
</select><br>
<label for="subject">Subject: <input type="text" name="subject" id="subject" maxlength="255"></label><br>
<label for="name">Your name: <input type="text" name="name" id="name" maxlength="255"></label><br>
<label for="email">Your email address: <input type="email" name="email" id="email" maxlength="255"></label><br>
<label for="query">Your question:</label><br>
<textarea cols="30" rows="8" name="query" id="query" placeholder="Your question"></textarea><br>
<input type="submit" value="Submit">
</form>
<?php } else {
echo $msg;
} ?>
</body>
</html>

View File

@ -1,36 +1,40 @@
<?php
/**
* This example shows signing a message and then sending it via the mail() function of PHP.
*
* This PHPMailer example shows S/MIME signing a message and then sending.
*
* Before you can sign the mail certificates are needed.
*
*
* STEP 1 - Creating a certificate:
* You can either use a self signed certificate, pay for a signed one or use free alternatives such as StartSSL/Comodo etc.
* Check out this link for more providers: http://kb.mozillazine.org/Getting_an_SMIME_certificate
* You can either use a self-signed certificate, pay for a signed one,
* or use free alternatives such as StartSSL, Comodo etc.
* Check out this link for more providers: https://kb.mozillazine.org/Getting_an_SMIME_certificate
* In this example I am using Comodo.
* The form is directly available via https://secure.comodo.com/products/frontpage?area=SecureEmailCertificate
* Fill it out and you'll get an email with a link to download your certificate.
* Usually the certificate will be directly installed into your browser (FireFox/Chrome).
*
*
*
* STEP 2 - Exporting the certificate
* This is specific to your browser, however, most browsers will give you the option to export your recently added certificate in PKCS12 (.pfx)
* This is specific to your browser, however, most browsers will give you the option
* to export your recently added certificate in PKCS12 (.pfx)
* Include your private key if you are asked for it.
* Set up a password to protect your exported file.
*
*
* STEP 3 - Splitting the .pfx into a private key and the certificate.
* I use openssl for this. You only need two commands. In my case the certificate file is called 'exported-cert.pfx'
* To create the private key do the following:
*
* openssl pkcs12 -in exported-cert.pfx -nocerts -out cert.key
*
*
* Of course the way you name your file (-out) is up to you.
* You will be asked for a password for the Import password. This is the password you just set while exporting the certificate into the pfx file.
* You will be asked for a password for the Import password. This is the password you
* set while exporting the certificate into the pfx file.
* Afterwards, you can password protect your private key (recommended)
* Also make sure to set the permissions to a minimum level and suitable for your application.
* To create the certificate file use the following command:
*
*
* openssl pkcs12 -in exported-cert.pfx -clcerts -nokeys -out cert.crt
*
* Again, the way you name your certificate is up to you. You will be also asked for the Import Password.
@ -44,13 +48,17 @@
* STEP 3 - Code
*/
require '../PHPMailerAutoload.php';
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer();
//Set who the message is to be sent from
//IMPORTANT: This must match the email address of your certificate.
//Although the certificate will be valid, an error will be thrown since it cannot be verified that the sender and the signer are the same person.
//Although the certificate will be valid, an error will be thrown since it cannot be verified
//that the sender and the signer are the same person.
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@example.com', 'First Last');
@ -60,7 +68,7 @@ $mail->addAddress('whoto@example.com', 'John Doe');
$mail->Subject = 'PHPMailer mail() test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//Convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
@ -70,20 +78,22 @@ $mail->addAttachment('images/phpmailer_mini.png');
$mail->sign(
'/path/to/cert.crt', //The location of your certificate file
'/path/to/cert.key', //The location of your private key file
'yourSecretPrivateKeyPassword', //The password you protected your private key with (not the Import Password! may be empty but parameter must not be omitted!)
//The password you protected your private key with (not the Import Password!
//May be empty but the parameter must not be omitted!
'yourSecretPrivateKeyPassword',
'/path/to/certchain.pem' //The location of your chain file
);
//Send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo "Message sent!";
echo 'Message sent!';
}
/**
/*
* REMARKS:
* If your email client does not support S/MIME it will most likely just show an attachment smime.p7s which is the signature contained in the email.
* Other clients, such as Thunderbird support S/MIME natively and will validate the signature automatically and report the result in some way.
* If your email client does not support S/MIME it will most likely just show an attachment smime.p7s,
* which is the signature contained in the email.
* Other clients, such as Thunderbird support S/MIME natively and will validate the signature
* automatically and report the result in some way.
*/
?>

View File

@ -1,35 +1,38 @@
<?php
/**
* This example shows making an SMTP connection with authentication.
*/
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
require '../PHPMailerAutoload.php';
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
$mail = new PHPMailer();
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//SMTP::DEBUG_OFF = off (for production use)
//SMTP::DEBUG_CLIENT = client messages
//SMTP::DEBUG_SERVER = client and server messages
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
//Set the hostname of the mail server
$mail->Host = "mail.example.com";
$mail->Host = 'mail.example.com';
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port = 25;
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication
$mail->Username = "yourname@example.com";
$mail->Username = 'yourname@example.com';
//Password to use for SMTP authentication
$mail->Password = "yourpassword";
$mail->Password = 'yourpassword';
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
@ -40,15 +43,20 @@ $mail->addAddress('whoto@example.com', 'John Doe');
$mail->Subject = 'PHPMailer SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');
//SMTP XCLIENT attributes can be passed with setSMTPXclientAttribute method
//$mail->setSMTPXclientAttribute('LOGIN', 'yourname@example.com');
//$mail->setSMTPXclientAttribute('ADDR', '10.10.10.10');
//$mail->setSMTPXclientAttribute('HELO', 'test.example.com');
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo "Message sent!";
echo 'Message sent!';
}

View File

@ -1,17 +1,22 @@
<?php
/**
* This uses the SMTP class alone to check that a connection can be made to an SMTP server,
* authenticate, then disconnect
*/
//Import the PHPMailer SMTP class into the global namespace
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
require '../vendor/autoload.php';
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
require '../PHPMailerAutoload.php';
//Create a new SMTP instance
$smtp = new SMTP;
$smtp = new SMTP();
//Enable connection-level debug output
$smtp->do_debug = SMTP::DEBUG_CONNECTION;
@ -43,7 +48,7 @@ try {
//If server supports authentication, do it (even if no encryption)
if (is_array($e) && array_key_exists('AUTH', $e)) {
if ($smtp->authenticate('username', 'password')) {
echo "Connected ok!";
echo 'Connected ok!';
} else {
throw new Exception('Authentication failed: ' . $smtp->getError()['error']);
}
@ -52,4 +57,4 @@ try {
echo 'SMTP error: ' . $e->getMessage(), "\n";
}
//Whatever happened, close the connection.
$smtp->quit(true);
$smtp->quit();

View File

@ -0,0 +1,117 @@
<?php
/**
* SMTP low memory example.
*/
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
/**
* This class demonstrates sending an already-built RFC822 message via SMTP
* by extending PHPMailer's SMTP class.
* It uses less memory than PHPMailer's usual approach because it keeps
* the message as a single string rather than splitting its lines into
* an array, which can consume very large amounts of memory if you have
* large attachments. The downside is that it's somewhat slower.
* This is mainly of academic interest, but shows how you can change how
* core classes work without having to alter the library itself.
*/
class SMTPLowMemory extends SMTP
{
public function data($msg_data)
{
//This will use the standard timelimit
if (!$this->sendCommand('DATA', 'DATA', 354)) {
return false;
}
/* The server is ready to accept data!
* According to rfc821 we should not send more than 1000 characters on a single line (including the LE)
* so we will break the data up into lines by \r and/or \n then if needed we will break each of those into
* smaller lines to fit within the limit.
* We will also look for lines that start with a '.' and prepend an additional '.' (which does not count
* towards the line-length limit), in order to implement the "dot stuffing" required by RFC5321 sections:
* https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.2
* https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.3.1.6.
*/
//Normalize line breaks
$msg_data = str_replace(["\r\n", "\r"], "\n", $msg_data);
/* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
* of the first line (':' separated) does not contain a space then it _should_ be a header and we will
* process all lines before a blank line as headers.
*/
$firstline = substr($msg_data, 0, strcspn($msg_data, "\n", 0));
$field = substr($firstline, 0, strpos($firstline, ':'));
$in_headers = false;
if (!empty($field) && strpos($field, ' ') === false) {
$in_headers = true;
}
$offset = 0;
$len = strlen($msg_data);
while ($offset < $len) {
//Get position of next line break
$linelen = strcspn($msg_data, "\n", $offset);
//Get the next line
$line = substr($msg_data, $offset, $linelen);
//Remember where we have got to
$offset += ($linelen + 1);
$lines_out = [];
if ($in_headers && $line === '') {
$in_headers = false;
}
//We need to break this line up into several smaller lines
//This is a small micro-optimisation: isset($str[$len]) is equivalent to (strlen($str) > $len)
while (isset($line[self::MAX_LINE_LENGTH])) {
//Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on
//so as to avoid breaking in the middle of a word
$pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' ');
//Deliberately matches both false and 0
if (!$pos) {
//No nice break found, add a hard break
$pos = self::MAX_LINE_LENGTH - 1;
$lines_out[] = substr($line, 0, $pos);
$line = substr($line, $pos);
} else {
//Break at the found point
$lines_out[] = substr($line, 0, $pos);
//Move along by the amount we dealt with
$line = substr($line, $pos + 1);
}
//If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1
if ($in_headers) {
$line = "\t" . $line;
}
}
$lines_out[] = $line;
//Send the lines to the server
foreach ($lines_out as $line_out) {
//RFC2821 section 4.5.2
if (!empty($line_out) && $line_out[0] === '.') {
$line_out = '.' . $line_out;
}
$this->client_send($line_out . self::LE);
}
}
//Message data has been sent, complete the command
//Increase timelimit for end of DATA command
$savetimelimit = $this->Timelimit;
$this->Timelimit *= 2;
$result = $this->sendCommand('DATA END', '.', 250);
//Restore timelimit
$this->Timelimit = $savetimelimit;
return $result;
}
}
//To make PHPMailer use our custom SMTP class, we need to give it an instance
$mail = new PHPMailer(true);
$mail->setSMTPInstance(new SMTPLowMemory());
//Now carry on as normal

View File

@ -1,31 +1,34 @@
<?php
/**
* This example shows making an SMTP connection without using authentication.
*/
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
require_once '../PHPMailerAutoload.php';
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
$mail = new PHPMailer();
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//SMTP::DEBUG_OFF = off (for production use)
//SMTP::DEBUG_CLIENT = client messages
//SMTP::DEBUG_SERVER = client and server messages
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
//Set the hostname of the mail server
$mail->Host = "mail.example.com";
$mail->Host = 'mail.example.com';
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port = 25;
//Whether to use SMTP authentication
$mail->SMTPAuth = false;
//We don't need to set this as it's the default value
//$mail->SMTPAuth = false;
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
@ -36,7 +39,7 @@ $mail->addAddress('whoto@example.com', 'John Doe');
$mail->Subject = 'PHPMailer SMTP without auth test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
@ -44,7 +47,7 @@ $mail->addAttachment('images/phpmailer_mini.png');
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo "Message sent!";
echo 'Message sent!';
}

View File

@ -1,57 +1,64 @@
<?php
/**
* This example shows settings to use when sending over SMTP with TLS and custom connection options.
*/
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
require '../PHPMailerAutoload.php';
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
$mail = new PHPMailer();
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//SMTP::DEBUG_OFF = off (for production use)
//SMTP::DEBUG_CLIENT = client messages
//SMTP::DEBUG_SERVER = client and server messages
$mail->SMTPDebug = SMTP::DEBUG_CONNECTION;
//Set the hostname of the mail server
$mail->Host = 'smtp.example.com';
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the SMTP port number:
// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or
// - 587 for SMTP+STARTTLS
$mail->Port = 465;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Set the encryption mechanism to use:
// - SMTPS (implicit TLS on port 465) or
// - STARTTLS (explicit TLS on port 587)
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
//Custom connection options
$mail->SMTPOptions = array (
'ssl' => array(
'verify_peer' => true,
//Note that these settings are INSECURE
$mail->SMTPOptions = array(
'ssl' => [
'verify_peer' => true,
'verify_depth' => 3,
'allow_self_signed' => true,
'peer_name' => 'smtp.example.com',
'cafile' => '/etc/ssl/ca_cert.pem',
)
],
);
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = "username@example.com";
$mail->Username = 'username@example.com';
//Password to use for SMTP authentication
$mail->Password = "yourpassword";
$mail->Password = 'yourpassword';
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
@ -64,11 +71,11 @@ $mail->Subject = 'PHPMailer SMTP options test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//send the message, check for errors
//Send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo "Message sent!";
echo 'Message sent!';
}

View File

@ -1,46 +0,0 @@
.syntaxhighlighter a,.syntaxhighlighter div,.syntaxhighlighter code,.syntaxhighlighter table,.syntaxhighlighter table td,.syntaxhighlighter table tr,.syntaxhighlighter table tbody,.syntaxhighlighter table thead,.syntaxhighlighter table caption,.syntaxhighlighter textarea{-moz-border-radius:0 0 0 0 !important;-webkit-border-radius:0 0 0 0 !important;background:none !important;border:0 !important;bottom:auto !important;float:none !important;height:auto !important;left:auto !important;line-height:1.1em !important;margin:0 !important;outline:0 !important;overflow:visible !important;padding:0 !important;position:static !important;right:auto !important;text-align:left !important;top:auto !important;vertical-align:baseline !important;width:auto !important;box-sizing:content-box !important;font-family:"Consolas","Bitstream Vera Sans Mono","Courier New",Courier,monospace !important;font-weight:normal !important;font-style:normal !important;font-size:1em !important;min-height:inherit !important;min-height:auto !important;}
.syntaxhighlighter{width:100% !important;margin:1em 0 1em 0 !important;position:relative !important;overflow:auto !important;font-size:1em !important;}
.syntaxhighlighter.source{overflow:hidden !important;}
.syntaxhighlighter .bold{font-weight:bold !important;}
.syntaxhighlighter .italic{font-style:italic !important;}
.syntaxhighlighter .line{white-space:pre !important;}
.syntaxhighlighter table{width:100% !important;}
.syntaxhighlighter table caption{text-align:left !important;padding:.5em 0 0.5em 1em !important;}
.syntaxhighlighter table td.code{width:100% !important;}
.syntaxhighlighter table td.code .container{position:relative !important;}
.syntaxhighlighter table td.code .container textarea{box-sizing:border-box !important;position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;border:none !important;background:white !important;padding-left:1em !important;overflow:hidden !important;white-space:pre !important;}
.syntaxhighlighter table td.gutter .line{text-align:right !important;padding:0 0.5em 0 1em !important;}
.syntaxhighlighter table td.code .line{padding:0 1em !important;}
.syntaxhighlighter.nogutter td.code .container textarea,.syntaxhighlighter.nogutter td.code .line{padding-left:0em !important;}
.syntaxhighlighter.show{display:block !important;}
.syntaxhighlighter.collapsed table{display:none !important;}
.syntaxhighlighter.collapsed .toolbar{padding:0.1em 0.8em 0em 0.8em !important;font-size:1em !important;position:static !important;width:auto !important;height:auto !important;}
.syntaxhighlighter.collapsed .toolbar span{display:inline !important;margin-right:1em !important;}
.syntaxhighlighter.collapsed .toolbar span a{padding:0 !important;display:none !important;}
.syntaxhighlighter.collapsed .toolbar span a.expandSource{display:inline !important;}
.syntaxhighlighter .toolbar{position:absolute !important;right:1px !important;top:1px !important;width:11px !important;height:11px !important;font-size:10px !important;z-index:10 !important;}
.syntaxhighlighter .toolbar span.title{display:inline !important;}
.syntaxhighlighter .toolbar a{display:block !important;text-align:center !important;text-decoration:none !important;padding-top:1px !important;}
.syntaxhighlighter .toolbar a.expandSource{display:none !important;}
.syntaxhighlighter.ie{font-size:.9em !important;padding:1px 0 1px 0 !important;}
.syntaxhighlighter.ie .toolbar{line-height:8px !important;}
.syntaxhighlighter.ie .toolbar a{padding-top:0px !important;}
.syntaxhighlighter.printing .line.alt1 .content,.syntaxhighlighter.printing .line.alt2 .content,.syntaxhighlighter.printing .line.highlighted .number,.syntaxhighlighter.printing .line.highlighted.alt1 .content,.syntaxhighlighter.printing .line.highlighted.alt2 .content{background:none !important;}
.syntaxhighlighter.printing .line .number{color:#bbbbbb !important;}
.syntaxhighlighter.printing .line .content{color:black !important;}
.syntaxhighlighter.printing .toolbar{display:none !important;}
.syntaxhighlighter.printing a{text-decoration:none !important;}
.syntaxhighlighter.printing .plain,.syntaxhighlighter.printing .plain a{color:black !important;}
.syntaxhighlighter.printing .comments,.syntaxhighlighter.printing .comments a{color:#008200 !important;}
.syntaxhighlighter.printing .string,.syntaxhighlighter.printing .string a{color:blue !important;}
.syntaxhighlighter.printing .keyword{color:#006699 !important;font-weight:bold !important;}
.syntaxhighlighter.printing .preprocessor{color:gray !important;}
.syntaxhighlighter.printing .variable{color:#aa7700 !important;}
.syntaxhighlighter.printing .value{color:#009900 !important;}
.syntaxhighlighter.printing .functions{color:#ff1493 !important;}
.syntaxhighlighter.printing .constants{color:#0066cc !important;}
.syntaxhighlighter.printing .script{font-weight:bold !important;}
.syntaxhighlighter.printing .color1,.syntaxhighlighter.printing .color1 a{color:gray !important;}
.syntaxhighlighter.printing .color2,.syntaxhighlighter.printing .color2 a{color:#ff1493 !important;}
.syntaxhighlighter.printing .color3,.syntaxhighlighter.printing .color3 a{color:red !important;}
.syntaxhighlighter.printing .break,.syntaxhighlighter.printing .break a{color:black !important;}

View File

@ -1,77 +0,0 @@
.syntaxhighlighter a,.syntaxhighlighter div,.syntaxhighlighter code,.syntaxhighlighter table,.syntaxhighlighter table td,.syntaxhighlighter table tr,.syntaxhighlighter table tbody,.syntaxhighlighter table thead,.syntaxhighlighter table caption,.syntaxhighlighter textarea{-moz-border-radius:0 0 0 0 !important;-webkit-border-radius:0 0 0 0 !important;background:none !important;border:0 !important;bottom:auto !important;float:none !important;height:auto !important;left:auto !important;line-height:1.1em !important;margin:0 !important;outline:0 !important;overflow:visible !important;padding:0 !important;position:static !important;right:auto !important;text-align:left !important;top:auto !important;vertical-align:baseline !important;width:auto !important;box-sizing:content-box !important;font-family:"Consolas","Bitstream Vera Sans Mono","Courier New",Courier,monospace !important;font-weight:normal !important;font-style:normal !important;font-size:1em !important;min-height:inherit !important;min-height:auto !important;}
.syntaxhighlighter{width:100% !important;margin:1em 0 1em 0 !important;position:relative !important;overflow:auto !important;font-size:1em !important;}
.syntaxhighlighter.source{overflow:hidden !important;}
.syntaxhighlighter .bold{font-weight:bold !important;}
.syntaxhighlighter .italic{font-style:italic !important;}
.syntaxhighlighter .line{white-space:pre !important;}
.syntaxhighlighter table{width:100% !important;}
.syntaxhighlighter table caption{text-align:left !important;padding:.5em 0 0.5em 1em !important;}
.syntaxhighlighter table td.code{width:100% !important;}
.syntaxhighlighter table td.code .container{position:relative !important;}
.syntaxhighlighter table td.code .container textarea{box-sizing:border-box !important;position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;border:none !important;background:white !important;padding-left:1em !important;overflow:hidden !important;white-space:pre !important;}
.syntaxhighlighter table td.gutter .line{text-align:right !important;padding:0 0.5em 0 1em !important;}
.syntaxhighlighter table td.code .line{padding:0 1em !important;}
.syntaxhighlighter.nogutter td.code .container textarea,.syntaxhighlighter.nogutter td.code .line{padding-left:0em !important;}
.syntaxhighlighter.show{display:block !important;}
.syntaxhighlighter.collapsed table{display:none !important;}
.syntaxhighlighter.collapsed .toolbar{padding:0.1em 0.8em 0em 0.8em !important;font-size:1em !important;position:static !important;width:auto !important;height:auto !important;}
.syntaxhighlighter.collapsed .toolbar span{display:inline !important;margin-right:1em !important;}
.syntaxhighlighter.collapsed .toolbar span a{padding:0 !important;display:none !important;}
.syntaxhighlighter.collapsed .toolbar span a.expandSource{display:inline !important;}
.syntaxhighlighter .toolbar{position:absolute !important;right:1px !important;top:1px !important;width:11px !important;height:11px !important;font-size:10px !important;z-index:10 !important;}
.syntaxhighlighter .toolbar span.title{display:inline !important;}
.syntaxhighlighter .toolbar a{display:block !important;text-align:center !important;text-decoration:none !important;padding-top:1px !important;}
.syntaxhighlighter .toolbar a.expandSource{display:none !important;}
.syntaxhighlighter.ie{font-size:.9em !important;padding:1px 0 1px 0 !important;}
.syntaxhighlighter.ie .toolbar{line-height:8px !important;}
.syntaxhighlighter.ie .toolbar a{padding-top:0px !important;}
.syntaxhighlighter.printing .line.alt1 .content,.syntaxhighlighter.printing .line.alt2 .content,.syntaxhighlighter.printing .line.highlighted .number,.syntaxhighlighter.printing .line.highlighted.alt1 .content,.syntaxhighlighter.printing .line.highlighted.alt2 .content{background:none !important;}
.syntaxhighlighter.printing .line .number{color:#bbbbbb !important;}
.syntaxhighlighter.printing .line .content{color:black !important;}
.syntaxhighlighter.printing .toolbar{display:none !important;}
.syntaxhighlighter.printing a{text-decoration:none !important;}
.syntaxhighlighter.printing .plain,.syntaxhighlighter.printing .plain a{color:black !important;}
.syntaxhighlighter.printing .comments,.syntaxhighlighter.printing .comments a{color:#008200 !important;}
.syntaxhighlighter.printing .string,.syntaxhighlighter.printing .string a{color:blue !important;}
.syntaxhighlighter.printing .keyword{color:#006699 !important;font-weight:bold !important;}
.syntaxhighlighter.printing .preprocessor{color:gray !important;}
.syntaxhighlighter.printing .variable{color:#aa7700 !important;}
.syntaxhighlighter.printing .value{color:#009900 !important;}
.syntaxhighlighter.printing .functions{color:#ff1493 !important;}
.syntaxhighlighter.printing .constants{color:#0066cc !important;}
.syntaxhighlighter.printing .script{font-weight:bold !important;}
.syntaxhighlighter.printing .color1,.syntaxhighlighter.printing .color1 a{color:gray !important;}
.syntaxhighlighter.printing .color2,.syntaxhighlighter.printing .color2 a{color:#ff1493 !important;}
.syntaxhighlighter.printing .color3,.syntaxhighlighter.printing .color3 a{color:red !important;}
.syntaxhighlighter.printing .break,.syntaxhighlighter.printing .break a{color:black !important;}
.syntaxhighlighter{background-color:white !important;}
.syntaxhighlighter .line.alt1{background-color:white !important;}
.syntaxhighlighter .line.alt2{background-color:white !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#e0e0e0 !important;}
.syntaxhighlighter .line.highlighted.number{color:black !important;}
.syntaxhighlighter table caption{color:black !important;}
.syntaxhighlighter .gutter{color:#afafaf !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #6ce26c !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#6ce26c !important;color:white !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:blue !important;background:white !important;border:1px solid #6ce26c !important;}
.syntaxhighlighter.collapsed .toolbar a{color:blue !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:red !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#6ce26c !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:black !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:black !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#008200 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:blue !important;}
.syntaxhighlighter .keyword{color:#006699 !important;}
.syntaxhighlighter .preprocessor{color:gray !important;}
.syntaxhighlighter .variable{color:#aa7700 !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#ff1493 !important;}
.syntaxhighlighter .constants{color:#0066cc !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#006699 !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:gray !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff1493 !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:red !important;}
.syntaxhighlighter .keyword{font-weight:bold !important;}

View File

@ -1,78 +0,0 @@
.syntaxhighlighter a,.syntaxhighlighter div,.syntaxhighlighter code,.syntaxhighlighter table,.syntaxhighlighter table td,.syntaxhighlighter table tr,.syntaxhighlighter table tbody,.syntaxhighlighter table thead,.syntaxhighlighter table caption,.syntaxhighlighter textarea{-moz-border-radius:0 0 0 0 !important;-webkit-border-radius:0 0 0 0 !important;background:none !important;border:0 !important;bottom:auto !important;float:none !important;height:auto !important;left:auto !important;line-height:1.1em !important;margin:0 !important;outline:0 !important;overflow:visible !important;padding:0 !important;position:static !important;right:auto !important;text-align:left !important;top:auto !important;vertical-align:baseline !important;width:auto !important;box-sizing:content-box !important;font-family:"Consolas","Bitstream Vera Sans Mono","Courier New",Courier,monospace !important;font-weight:normal !important;font-style:normal !important;font-size:1em !important;min-height:inherit !important;min-height:auto !important;}
.syntaxhighlighter{width:100% !important;margin:1em 0 1em 0 !important;position:relative !important;overflow:auto !important;font-size:1em !important;}
.syntaxhighlighter.source{overflow:hidden !important;}
.syntaxhighlighter .bold{font-weight:bold !important;}
.syntaxhighlighter .italic{font-style:italic !important;}
.syntaxhighlighter .line{white-space:pre !important;}
.syntaxhighlighter table{width:100% !important;}
.syntaxhighlighter table caption{text-align:left !important;padding:.5em 0 0.5em 1em !important;}
.syntaxhighlighter table td.code{width:100% !important;}
.syntaxhighlighter table td.code .container{position:relative !important;}
.syntaxhighlighter table td.code .container textarea{box-sizing:border-box !important;position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;border:none !important;background:white !important;padding-left:1em !important;overflow:hidden !important;white-space:pre !important;}
.syntaxhighlighter table td.gutter .line{text-align:right !important;padding:0 0.5em 0 1em !important;}
.syntaxhighlighter table td.code .line{padding:0 1em !important;}
.syntaxhighlighter.nogutter td.code .container textarea,.syntaxhighlighter.nogutter td.code .line{padding-left:0em !important;}
.syntaxhighlighter.show{display:block !important;}
.syntaxhighlighter.collapsed table{display:none !important;}
.syntaxhighlighter.collapsed .toolbar{padding:0.1em 0.8em 0em 0.8em !important;font-size:1em !important;position:static !important;width:auto !important;height:auto !important;}
.syntaxhighlighter.collapsed .toolbar span{display:inline !important;margin-right:1em !important;}
.syntaxhighlighter.collapsed .toolbar span a{padding:0 !important;display:none !important;}
.syntaxhighlighter.collapsed .toolbar span a.expandSource{display:inline !important;}
.syntaxhighlighter .toolbar{position:absolute !important;right:1px !important;top:1px !important;width:11px !important;height:11px !important;font-size:10px !important;z-index:10 !important;}
.syntaxhighlighter .toolbar span.title{display:inline !important;}
.syntaxhighlighter .toolbar a{display:block !important;text-align:center !important;text-decoration:none !important;padding-top:1px !important;}
.syntaxhighlighter .toolbar a.expandSource{display:none !important;}
.syntaxhighlighter.ie{font-size:.9em !important;padding:1px 0 1px 0 !important;}
.syntaxhighlighter.ie .toolbar{line-height:8px !important;}
.syntaxhighlighter.ie .toolbar a{padding-top:0px !important;}
.syntaxhighlighter.printing .line.alt1 .content,.syntaxhighlighter.printing .line.alt2 .content,.syntaxhighlighter.printing .line.highlighted .number,.syntaxhighlighter.printing .line.highlighted.alt1 .content,.syntaxhighlighter.printing .line.highlighted.alt2 .content{background:none !important;}
.syntaxhighlighter.printing .line .number{color:#bbbbbb !important;}
.syntaxhighlighter.printing .line .content{color:black !important;}
.syntaxhighlighter.printing .toolbar{display:none !important;}
.syntaxhighlighter.printing a{text-decoration:none !important;}
.syntaxhighlighter.printing .plain,.syntaxhighlighter.printing .plain a{color:black !important;}
.syntaxhighlighter.printing .comments,.syntaxhighlighter.printing .comments a{color:#008200 !important;}
.syntaxhighlighter.printing .string,.syntaxhighlighter.printing .string a{color:blue !important;}
.syntaxhighlighter.printing .keyword{color:#006699 !important;font-weight:bold !important;}
.syntaxhighlighter.printing .preprocessor{color:gray !important;}
.syntaxhighlighter.printing .variable{color:#aa7700 !important;}
.syntaxhighlighter.printing .value{color:#009900 !important;}
.syntaxhighlighter.printing .functions{color:#ff1493 !important;}
.syntaxhighlighter.printing .constants{color:#0066cc !important;}
.syntaxhighlighter.printing .script{font-weight:bold !important;}
.syntaxhighlighter.printing .color1,.syntaxhighlighter.printing .color1 a{color:gray !important;}
.syntaxhighlighter.printing .color2,.syntaxhighlighter.printing .color2 a{color:#ff1493 !important;}
.syntaxhighlighter.printing .color3,.syntaxhighlighter.printing .color3 a{color:red !important;}
.syntaxhighlighter.printing .break,.syntaxhighlighter.printing .break a{color:black !important;}
.syntaxhighlighter{background-color:#0a2b1d !important;}
.syntaxhighlighter .line.alt1{background-color:#0a2b1d !important;}
.syntaxhighlighter .line.alt2{background-color:#0a2b1d !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#233729 !important;}
.syntaxhighlighter .line.highlighted.number{color:white !important;}
.syntaxhighlighter table caption{color:#f8f8f8 !important;}
.syntaxhighlighter .gutter{color:#497958 !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #41a83e !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#41a83e !important;color:#0a2b1d !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#96dd3b !important;background:black !important;border:1px solid #41a83e !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#96dd3b !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:white !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#41a83e !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:#ffe862 !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#f8f8f8 !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#336442 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#9df39f !important;}
.syntaxhighlighter .keyword{color:#96dd3b !important;}
.syntaxhighlighter .preprocessor{color:#91bb9e !important;}
.syntaxhighlighter .variable{color:#ffaa3e !important;}
.syntaxhighlighter .value{color:#f7e741 !important;}
.syntaxhighlighter .functions{color:#ffaa3e !important;}
.syntaxhighlighter .constants{color:#e0e8ff !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#96dd3b !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#eb939a !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#91bb9e !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#edef7d !important;}
.syntaxhighlighter .comments{font-style:italic !important;}
.syntaxhighlighter .keyword{font-weight:bold !important;}

View File

@ -1,80 +0,0 @@
.syntaxhighlighter a,.syntaxhighlighter div,.syntaxhighlighter code,.syntaxhighlighter table,.syntaxhighlighter table td,.syntaxhighlighter table tr,.syntaxhighlighter table tbody,.syntaxhighlighter table thead,.syntaxhighlighter table caption,.syntaxhighlighter textarea{-moz-border-radius:0 0 0 0 !important;-webkit-border-radius:0 0 0 0 !important;background:none !important;border:0 !important;bottom:auto !important;float:none !important;height:auto !important;left:auto !important;line-height:1.1em !important;margin:0 !important;outline:0 !important;overflow:visible !important;padding:0 !important;position:static !important;right:auto !important;text-align:left !important;top:auto !important;vertical-align:baseline !important;width:auto !important;box-sizing:content-box !important;font-family:"Consolas","Bitstream Vera Sans Mono","Courier New",Courier,monospace !important;font-weight:normal !important;font-style:normal !important;font-size:1em !important;min-height:inherit !important;min-height:auto !important;}
.syntaxhighlighter{width:100% !important;margin:1em 0 1em 0 !important;position:relative !important;overflow:auto !important;font-size:1em !important;}
.syntaxhighlighter.source{overflow:hidden !important;}
.syntaxhighlighter .bold{font-weight:bold !important;}
.syntaxhighlighter .italic{font-style:italic !important;}
.syntaxhighlighter .line{white-space:pre !important;}
.syntaxhighlighter table{width:100% !important;}
.syntaxhighlighter table caption{text-align:left !important;padding:.5em 0 0.5em 1em !important;}
.syntaxhighlighter table td.code{width:100% !important;}
.syntaxhighlighter table td.code .container{position:relative !important;}
.syntaxhighlighter table td.code .container textarea{box-sizing:border-box !important;position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;border:none !important;background:white !important;padding-left:1em !important;overflow:hidden !important;white-space:pre !important;}
.syntaxhighlighter table td.gutter .line{text-align:right !important;padding:0 0.5em 0 1em !important;}
.syntaxhighlighter table td.code .line{padding:0 1em !important;}
.syntaxhighlighter.nogutter td.code .container textarea,.syntaxhighlighter.nogutter td.code .line{padding-left:0em !important;}
.syntaxhighlighter.show{display:block !important;}
.syntaxhighlighter.collapsed table{display:none !important;}
.syntaxhighlighter.collapsed .toolbar{padding:0.1em 0.8em 0em 0.8em !important;font-size:1em !important;position:static !important;width:auto !important;height:auto !important;}
.syntaxhighlighter.collapsed .toolbar span{display:inline !important;margin-right:1em !important;}
.syntaxhighlighter.collapsed .toolbar span a{padding:0 !important;display:none !important;}
.syntaxhighlighter.collapsed .toolbar span a.expandSource{display:inline !important;}
.syntaxhighlighter .toolbar{position:absolute !important;right:1px !important;top:1px !important;width:11px !important;height:11px !important;font-size:10px !important;z-index:10 !important;}
.syntaxhighlighter .toolbar span.title{display:inline !important;}
.syntaxhighlighter .toolbar a{display:block !important;text-align:center !important;text-decoration:none !important;padding-top:1px !important;}
.syntaxhighlighter .toolbar a.expandSource{display:none !important;}
.syntaxhighlighter.ie{font-size:.9em !important;padding:1px 0 1px 0 !important;}
.syntaxhighlighter.ie .toolbar{line-height:8px !important;}
.syntaxhighlighter.ie .toolbar a{padding-top:0px !important;}
.syntaxhighlighter.printing .line.alt1 .content,.syntaxhighlighter.printing .line.alt2 .content,.syntaxhighlighter.printing .line.highlighted .number,.syntaxhighlighter.printing .line.highlighted.alt1 .content,.syntaxhighlighter.printing .line.highlighted.alt2 .content{background:none !important;}
.syntaxhighlighter.printing .line .number{color:#bbbbbb !important;}
.syntaxhighlighter.printing .line .content{color:black !important;}
.syntaxhighlighter.printing .toolbar{display:none !important;}
.syntaxhighlighter.printing a{text-decoration:none !important;}
.syntaxhighlighter.printing .plain,.syntaxhighlighter.printing .plain a{color:black !important;}
.syntaxhighlighter.printing .comments,.syntaxhighlighter.printing .comments a{color:#008200 !important;}
.syntaxhighlighter.printing .string,.syntaxhighlighter.printing .string a{color:blue !important;}
.syntaxhighlighter.printing .keyword{color:#006699 !important;font-weight:bold !important;}
.syntaxhighlighter.printing .preprocessor{color:gray !important;}
.syntaxhighlighter.printing .variable{color:#aa7700 !important;}
.syntaxhighlighter.printing .value{color:#009900 !important;}
.syntaxhighlighter.printing .functions{color:#ff1493 !important;}
.syntaxhighlighter.printing .constants{color:#0066cc !important;}
.syntaxhighlighter.printing .script{font-weight:bold !important;}
.syntaxhighlighter.printing .color1,.syntaxhighlighter.printing .color1 a{color:gray !important;}
.syntaxhighlighter.printing .color2,.syntaxhighlighter.printing .color2 a{color:#ff1493 !important;}
.syntaxhighlighter.printing .color3,.syntaxhighlighter.printing .color3 a{color:red !important;}
.syntaxhighlighter.printing .break,.syntaxhighlighter.printing .break a{color:black !important;}
.syntaxhighlighter{background-color:white !important;}
.syntaxhighlighter .line.alt1{background-color:white !important;}
.syntaxhighlighter .line.alt2{background-color:white !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#c3defe !important;}
.syntaxhighlighter .line.highlighted.number{color:white !important;}
.syntaxhighlighter table caption{color:black !important;}
.syntaxhighlighter .gutter{color:#787878 !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #d4d0c8 !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#d4d0c8 !important;color:white !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#3f5fbf !important;background:white !important;border:1px solid #d4d0c8 !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#3f5fbf !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#aa7700 !important;}
.syntaxhighlighter .toolbar{color:#a0a0a0 !important;background:#d4d0c8 !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:#a0a0a0 !important;}
.syntaxhighlighter .toolbar a:hover{color:red !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:black !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#3f5fbf !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#2a00ff !important;}
.syntaxhighlighter .keyword{color:#7f0055 !important;}
.syntaxhighlighter .preprocessor{color:#646464 !important;}
.syntaxhighlighter .variable{color:#aa7700 !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#ff1493 !important;}
.syntaxhighlighter .constants{color:#0066cc !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#7f0055 !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:gray !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff1493 !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:red !important;}
.syntaxhighlighter .keyword{font-weight:bold !important;}
.syntaxhighlighter .xml .keyword{color:#3f7f7f !important;font-weight:normal !important;}
.syntaxhighlighter .xml .color1,.syntaxhighlighter .xml .color1 a{color:#7f007f !important;}
.syntaxhighlighter .xml .string{font-style:italic !important;color:#2a00ff !important;}

View File

@ -1,76 +0,0 @@
.syntaxhighlighter a,.syntaxhighlighter div,.syntaxhighlighter code,.syntaxhighlighter table,.syntaxhighlighter table td,.syntaxhighlighter table tr,.syntaxhighlighter table tbody,.syntaxhighlighter table thead,.syntaxhighlighter table caption,.syntaxhighlighter textarea{-moz-border-radius:0 0 0 0 !important;-webkit-border-radius:0 0 0 0 !important;background:none !important;border:0 !important;bottom:auto !important;float:none !important;height:auto !important;left:auto !important;line-height:1.1em !important;margin:0 !important;outline:0 !important;overflow:visible !important;padding:0 !important;position:static !important;right:auto !important;text-align:left !important;top:auto !important;vertical-align:baseline !important;width:auto !important;box-sizing:content-box !important;font-family:"Consolas","Bitstream Vera Sans Mono","Courier New",Courier,monospace !important;font-weight:normal !important;font-style:normal !important;font-size:1em !important;min-height:inherit !important;min-height:auto !important;}
.syntaxhighlighter{width:100% !important;margin:1em 0 1em 0 !important;position:relative !important;overflow:auto !important;font-size:1em !important;}
.syntaxhighlighter.source{overflow:hidden !important;}
.syntaxhighlighter .bold{font-weight:bold !important;}
.syntaxhighlighter .italic{font-style:italic !important;}
.syntaxhighlighter .line{white-space:pre !important;}
.syntaxhighlighter table{width:100% !important;}
.syntaxhighlighter table caption{text-align:left !important;padding:.5em 0 0.5em 1em !important;}
.syntaxhighlighter table td.code{width:100% !important;}
.syntaxhighlighter table td.code .container{position:relative !important;}
.syntaxhighlighter table td.code .container textarea{box-sizing:border-box !important;position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;border:none !important;background:white !important;padding-left:1em !important;overflow:hidden !important;white-space:pre !important;}
.syntaxhighlighter table td.gutter .line{text-align:right !important;padding:0 0.5em 0 1em !important;}
.syntaxhighlighter table td.code .line{padding:0 1em !important;}
.syntaxhighlighter.nogutter td.code .container textarea,.syntaxhighlighter.nogutter td.code .line{padding-left:0em !important;}
.syntaxhighlighter.show{display:block !important;}
.syntaxhighlighter.collapsed table{display:none !important;}
.syntaxhighlighter.collapsed .toolbar{padding:0.1em 0.8em 0em 0.8em !important;font-size:1em !important;position:static !important;width:auto !important;height:auto !important;}
.syntaxhighlighter.collapsed .toolbar span{display:inline !important;margin-right:1em !important;}
.syntaxhighlighter.collapsed .toolbar span a{padding:0 !important;display:none !important;}
.syntaxhighlighter.collapsed .toolbar span a.expandSource{display:inline !important;}
.syntaxhighlighter .toolbar{position:absolute !important;right:1px !important;top:1px !important;width:11px !important;height:11px !important;font-size:10px !important;z-index:10 !important;}
.syntaxhighlighter .toolbar span.title{display:inline !important;}
.syntaxhighlighter .toolbar a{display:block !important;text-align:center !important;text-decoration:none !important;padding-top:1px !important;}
.syntaxhighlighter .toolbar a.expandSource{display:none !important;}
.syntaxhighlighter.ie{font-size:.9em !important;padding:1px 0 1px 0 !important;}
.syntaxhighlighter.ie .toolbar{line-height:8px !important;}
.syntaxhighlighter.ie .toolbar a{padding-top:0px !important;}
.syntaxhighlighter.printing .line.alt1 .content,.syntaxhighlighter.printing .line.alt2 .content,.syntaxhighlighter.printing .line.highlighted .number,.syntaxhighlighter.printing .line.highlighted.alt1 .content,.syntaxhighlighter.printing .line.highlighted.alt2 .content{background:none !important;}
.syntaxhighlighter.printing .line .number{color:#bbbbbb !important;}
.syntaxhighlighter.printing .line .content{color:black !important;}
.syntaxhighlighter.printing .toolbar{display:none !important;}
.syntaxhighlighter.printing a{text-decoration:none !important;}
.syntaxhighlighter.printing .plain,.syntaxhighlighter.printing .plain a{color:black !important;}
.syntaxhighlighter.printing .comments,.syntaxhighlighter.printing .comments a{color:#008200 !important;}
.syntaxhighlighter.printing .string,.syntaxhighlighter.printing .string a{color:blue !important;}
.syntaxhighlighter.printing .keyword{color:#006699 !important;font-weight:bold !important;}
.syntaxhighlighter.printing .preprocessor{color:gray !important;}
.syntaxhighlighter.printing .variable{color:#aa7700 !important;}
.syntaxhighlighter.printing .value{color:#009900 !important;}
.syntaxhighlighter.printing .functions{color:#ff1493 !important;}
.syntaxhighlighter.printing .constants{color:#0066cc !important;}
.syntaxhighlighter.printing .script{font-weight:bold !important;}
.syntaxhighlighter.printing .color1,.syntaxhighlighter.printing .color1 a{color:gray !important;}
.syntaxhighlighter.printing .color2,.syntaxhighlighter.printing .color2 a{color:#ff1493 !important;}
.syntaxhighlighter.printing .color3,.syntaxhighlighter.printing .color3 a{color:red !important;}
.syntaxhighlighter.printing .break,.syntaxhighlighter.printing .break a{color:black !important;}
.syntaxhighlighter{background-color:black !important;}
.syntaxhighlighter .line.alt1{background-color:black !important;}
.syntaxhighlighter .line.alt2{background-color:black !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#2a3133 !important;}
.syntaxhighlighter .line.highlighted.number{color:white !important;}
.syntaxhighlighter table caption{color:#d3d3d3 !important;}
.syntaxhighlighter .gutter{color:#d3d3d3 !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #990000 !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#990000 !important;color:black !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#ebdb8d !important;background:black !important;border:1px solid #990000 !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#ebdb8d !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#ff7d27 !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#990000 !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:#9ccff4 !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#d3d3d3 !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#ff7d27 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#ff9e7b !important;}
.syntaxhighlighter .keyword{color:aqua !important;}
.syntaxhighlighter .preprocessor{color:#aec4de !important;}
.syntaxhighlighter .variable{color:#ffaa3e !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#81cef9 !important;}
.syntaxhighlighter .constants{color:#ff9e7b !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:aqua !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#ebdb8d !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff7d27 !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#aec4de !important;}

View File

@ -1,77 +0,0 @@
.syntaxhighlighter a,.syntaxhighlighter div,.syntaxhighlighter code,.syntaxhighlighter table,.syntaxhighlighter table td,.syntaxhighlighter table tr,.syntaxhighlighter table tbody,.syntaxhighlighter table thead,.syntaxhighlighter table caption,.syntaxhighlighter textarea{-moz-border-radius:0 0 0 0 !important;-webkit-border-radius:0 0 0 0 !important;background:none !important;border:0 !important;bottom:auto !important;float:none !important;height:auto !important;left:auto !important;line-height:1.1em !important;margin:0 !important;outline:0 !important;overflow:visible !important;padding:0 !important;position:static !important;right:auto !important;text-align:left !important;top:auto !important;vertical-align:baseline !important;width:auto !important;box-sizing:content-box !important;font-family:"Consolas","Bitstream Vera Sans Mono","Courier New",Courier,monospace !important;font-weight:normal !important;font-style:normal !important;font-size:1em !important;min-height:inherit !important;min-height:auto !important;}
.syntaxhighlighter{width:100% !important;margin:1em 0 1em 0 !important;position:relative !important;overflow:auto !important;font-size:1em !important;}
.syntaxhighlighter.source{overflow:hidden !important;}
.syntaxhighlighter .bold{font-weight:bold !important;}
.syntaxhighlighter .italic{font-style:italic !important;}
.syntaxhighlighter .line{white-space:pre !important;}
.syntaxhighlighter table{width:100% !important;}
.syntaxhighlighter table caption{text-align:left !important;padding:.5em 0 0.5em 1em !important;}
.syntaxhighlighter table td.code{width:100% !important;}
.syntaxhighlighter table td.code .container{position:relative !important;}
.syntaxhighlighter table td.code .container textarea{box-sizing:border-box !important;position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;border:none !important;background:white !important;padding-left:1em !important;overflow:hidden !important;white-space:pre !important;}
.syntaxhighlighter table td.gutter .line{text-align:right !important;padding:0 0.5em 0 1em !important;}
.syntaxhighlighter table td.code .line{padding:0 1em !important;}
.syntaxhighlighter.nogutter td.code .container textarea,.syntaxhighlighter.nogutter td.code .line{padding-left:0em !important;}
.syntaxhighlighter.show{display:block !important;}
.syntaxhighlighter.collapsed table{display:none !important;}
.syntaxhighlighter.collapsed .toolbar{padding:0.1em 0.8em 0em 0.8em !important;font-size:1em !important;position:static !important;width:auto !important;height:auto !important;}
.syntaxhighlighter.collapsed .toolbar span{display:inline !important;margin-right:1em !important;}
.syntaxhighlighter.collapsed .toolbar span a{padding:0 !important;display:none !important;}
.syntaxhighlighter.collapsed .toolbar span a.expandSource{display:inline !important;}
.syntaxhighlighter .toolbar{position:absolute !important;right:1px !important;top:1px !important;width:11px !important;height:11px !important;font-size:10px !important;z-index:10 !important;}
.syntaxhighlighter .toolbar span.title{display:inline !important;}
.syntaxhighlighter .toolbar a{display:block !important;text-align:center !important;text-decoration:none !important;padding-top:1px !important;}
.syntaxhighlighter .toolbar a.expandSource{display:none !important;}
.syntaxhighlighter.ie{font-size:.9em !important;padding:1px 0 1px 0 !important;}
.syntaxhighlighter.ie .toolbar{line-height:8px !important;}
.syntaxhighlighter.ie .toolbar a{padding-top:0px !important;}
.syntaxhighlighter.printing .line.alt1 .content,.syntaxhighlighter.printing .line.alt2 .content,.syntaxhighlighter.printing .line.highlighted .number,.syntaxhighlighter.printing .line.highlighted.alt1 .content,.syntaxhighlighter.printing .line.highlighted.alt2 .content{background:none !important;}
.syntaxhighlighter.printing .line .number{color:#bbbbbb !important;}
.syntaxhighlighter.printing .line .content{color:black !important;}
.syntaxhighlighter.printing .toolbar{display:none !important;}
.syntaxhighlighter.printing a{text-decoration:none !important;}
.syntaxhighlighter.printing .plain,.syntaxhighlighter.printing .plain a{color:black !important;}
.syntaxhighlighter.printing .comments,.syntaxhighlighter.printing .comments a{color:#008200 !important;}
.syntaxhighlighter.printing .string,.syntaxhighlighter.printing .string a{color:blue !important;}
.syntaxhighlighter.printing .keyword{color:#006699 !important;font-weight:bold !important;}
.syntaxhighlighter.printing .preprocessor{color:gray !important;}
.syntaxhighlighter.printing .variable{color:#aa7700 !important;}
.syntaxhighlighter.printing .value{color:#009900 !important;}
.syntaxhighlighter.printing .functions{color:#ff1493 !important;}
.syntaxhighlighter.printing .constants{color:#0066cc !important;}
.syntaxhighlighter.printing .script{font-weight:bold !important;}
.syntaxhighlighter.printing .color1,.syntaxhighlighter.printing .color1 a{color:gray !important;}
.syntaxhighlighter.printing .color2,.syntaxhighlighter.printing .color2 a{color:#ff1493 !important;}
.syntaxhighlighter.printing .color3,.syntaxhighlighter.printing .color3 a{color:red !important;}
.syntaxhighlighter.printing .break,.syntaxhighlighter.printing .break a{color:black !important;}
.syntaxhighlighter{background-color:#121212 !important;}
.syntaxhighlighter .line.alt1{background-color:#121212 !important;}
.syntaxhighlighter .line.alt2{background-color:#121212 !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#2c2c29 !important;}
.syntaxhighlighter .line.highlighted.number{color:white !important;}
.syntaxhighlighter table caption{color:white !important;}
.syntaxhighlighter .gutter{color:#afafaf !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #3185b9 !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#3185b9 !important;color:#121212 !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#3185b9 !important;background:black !important;border:1px solid #3185b9 !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#3185b9 !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#d01d33 !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#3185b9 !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:#96daff !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:white !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#696854 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#e3e658 !important;}
.syntaxhighlighter .keyword{color:#d01d33 !important;}
.syntaxhighlighter .preprocessor{color:#435a5f !important;}
.syntaxhighlighter .variable{color:#898989 !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#aaaaaa !important;}
.syntaxhighlighter .constants{color:#96daff !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#d01d33 !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#ffc074 !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#4a8cdb !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#96daff !important;}
.syntaxhighlighter .functions{font-weight:bold !important;}

View File

@ -1,76 +0,0 @@
.syntaxhighlighter a,.syntaxhighlighter div,.syntaxhighlighter code,.syntaxhighlighter table,.syntaxhighlighter table td,.syntaxhighlighter table tr,.syntaxhighlighter table tbody,.syntaxhighlighter table thead,.syntaxhighlighter table caption,.syntaxhighlighter textarea{-moz-border-radius:0 0 0 0 !important;-webkit-border-radius:0 0 0 0 !important;background:none !important;border:0 !important;bottom:auto !important;float:none !important;height:auto !important;left:auto !important;line-height:1.1em !important;margin:0 !important;outline:0 !important;overflow:visible !important;padding:0 !important;position:static !important;right:auto !important;text-align:left !important;top:auto !important;vertical-align:baseline !important;width:auto !important;box-sizing:content-box !important;font-family:"Consolas","Bitstream Vera Sans Mono","Courier New",Courier,monospace !important;font-weight:normal !important;font-style:normal !important;font-size:1em !important;min-height:inherit !important;min-height:auto !important;}
.syntaxhighlighter{width:100% !important;margin:1em 0 1em 0 !important;position:relative !important;overflow:auto !important;font-size:1em !important;}
.syntaxhighlighter.source{overflow:hidden !important;}
.syntaxhighlighter .bold{font-weight:bold !important;}
.syntaxhighlighter .italic{font-style:italic !important;}
.syntaxhighlighter .line{white-space:pre !important;}
.syntaxhighlighter table{width:100% !important;}
.syntaxhighlighter table caption{text-align:left !important;padding:.5em 0 0.5em 1em !important;}
.syntaxhighlighter table td.code{width:100% !important;}
.syntaxhighlighter table td.code .container{position:relative !important;}
.syntaxhighlighter table td.code .container textarea{box-sizing:border-box !important;position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;border:none !important;background:white !important;padding-left:1em !important;overflow:hidden !important;white-space:pre !important;}
.syntaxhighlighter table td.gutter .line{text-align:right !important;padding:0 0.5em 0 1em !important;}
.syntaxhighlighter table td.code .line{padding:0 1em !important;}
.syntaxhighlighter.nogutter td.code .container textarea,.syntaxhighlighter.nogutter td.code .line{padding-left:0em !important;}
.syntaxhighlighter.show{display:block !important;}
.syntaxhighlighter.collapsed table{display:none !important;}
.syntaxhighlighter.collapsed .toolbar{padding:0.1em 0.8em 0em 0.8em !important;font-size:1em !important;position:static !important;width:auto !important;height:auto !important;}
.syntaxhighlighter.collapsed .toolbar span{display:inline !important;margin-right:1em !important;}
.syntaxhighlighter.collapsed .toolbar span a{padding:0 !important;display:none !important;}
.syntaxhighlighter.collapsed .toolbar span a.expandSource{display:inline !important;}
.syntaxhighlighter .toolbar{position:absolute !important;right:1px !important;top:1px !important;width:11px !important;height:11px !important;font-size:10px !important;z-index:10 !important;}
.syntaxhighlighter .toolbar span.title{display:inline !important;}
.syntaxhighlighter .toolbar a{display:block !important;text-align:center !important;text-decoration:none !important;padding-top:1px !important;}
.syntaxhighlighter .toolbar a.expandSource{display:none !important;}
.syntaxhighlighter.ie{font-size:.9em !important;padding:1px 0 1px 0 !important;}
.syntaxhighlighter.ie .toolbar{line-height:8px !important;}
.syntaxhighlighter.ie .toolbar a{padding-top:0px !important;}
.syntaxhighlighter.printing .line.alt1 .content,.syntaxhighlighter.printing .line.alt2 .content,.syntaxhighlighter.printing .line.highlighted .number,.syntaxhighlighter.printing .line.highlighted.alt1 .content,.syntaxhighlighter.printing .line.highlighted.alt2 .content{background:none !important;}
.syntaxhighlighter.printing .line .number{color:#bbbbbb !important;}
.syntaxhighlighter.printing .line .content{color:black !important;}
.syntaxhighlighter.printing .toolbar{display:none !important;}
.syntaxhighlighter.printing a{text-decoration:none !important;}
.syntaxhighlighter.printing .plain,.syntaxhighlighter.printing .plain a{color:black !important;}
.syntaxhighlighter.printing .comments,.syntaxhighlighter.printing .comments a{color:#008200 !important;}
.syntaxhighlighter.printing .string,.syntaxhighlighter.printing .string a{color:blue !important;}
.syntaxhighlighter.printing .keyword{color:#006699 !important;font-weight:bold !important;}
.syntaxhighlighter.printing .preprocessor{color:gray !important;}
.syntaxhighlighter.printing .variable{color:#aa7700 !important;}
.syntaxhighlighter.printing .value{color:#009900 !important;}
.syntaxhighlighter.printing .functions{color:#ff1493 !important;}
.syntaxhighlighter.printing .constants{color:#0066cc !important;}
.syntaxhighlighter.printing .script{font-weight:bold !important;}
.syntaxhighlighter.printing .color1,.syntaxhighlighter.printing .color1 a{color:gray !important;}
.syntaxhighlighter.printing .color2,.syntaxhighlighter.printing .color2 a{color:#ff1493 !important;}
.syntaxhighlighter.printing .color3,.syntaxhighlighter.printing .color3 a{color:red !important;}
.syntaxhighlighter.printing .break,.syntaxhighlighter.printing .break a{color:black !important;}
.syntaxhighlighter{background-color:#222222 !important;}
.syntaxhighlighter .line.alt1{background-color:#222222 !important;}
.syntaxhighlighter .line.alt2{background-color:#222222 !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#253e5a !important;}
.syntaxhighlighter .line.highlighted.number{color:white !important;}
.syntaxhighlighter table caption{color:lime !important;}
.syntaxhighlighter .gutter{color:#38566f !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #435a5f !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#435a5f !important;color:#222222 !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#428bdd !important;background:black !important;border:1px solid #435a5f !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#428bdd !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:lime !important;}
.syntaxhighlighter .toolbar{color:#aaaaff !important;background:#435a5f !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:#aaaaff !important;}
.syntaxhighlighter .toolbar a:hover{color:#9ccff4 !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:lime !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#428bdd !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:lime !important;}
.syntaxhighlighter .keyword{color:#aaaaff !important;}
.syntaxhighlighter .preprocessor{color:#8aa6c1 !important;}
.syntaxhighlighter .variable{color:aqua !important;}
.syntaxhighlighter .value{color:#f7e741 !important;}
.syntaxhighlighter .functions{color:#ff8000 !important;}
.syntaxhighlighter .constants{color:yellow !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#aaaaff !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:red !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:yellow !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#ffaa3e !important;}

View File

@ -1,76 +0,0 @@
.syntaxhighlighter a,.syntaxhighlighter div,.syntaxhighlighter code,.syntaxhighlighter table,.syntaxhighlighter table td,.syntaxhighlighter table tr,.syntaxhighlighter table tbody,.syntaxhighlighter table thead,.syntaxhighlighter table caption,.syntaxhighlighter textarea{-moz-border-radius:0 0 0 0 !important;-webkit-border-radius:0 0 0 0 !important;background:none !important;border:0 !important;bottom:auto !important;float:none !important;height:auto !important;left:auto !important;line-height:1.1em !important;margin:0 !important;outline:0 !important;overflow:visible !important;padding:0 !important;position:static !important;right:auto !important;text-align:left !important;top:auto !important;vertical-align:baseline !important;width:auto !important;box-sizing:content-box !important;font-family:"Consolas","Bitstream Vera Sans Mono","Courier New",Courier,monospace !important;font-weight:normal !important;font-style:normal !important;font-size:1em !important;min-height:inherit !important;min-height:auto !important;}
.syntaxhighlighter{width:100% !important;margin:1em 0 1em 0 !important;position:relative !important;overflow:auto !important;font-size:1em !important;}
.syntaxhighlighter.source{overflow:hidden !important;}
.syntaxhighlighter .bold{font-weight:bold !important;}
.syntaxhighlighter .italic{font-style:italic !important;}
.syntaxhighlighter .line{white-space:pre !important;}
.syntaxhighlighter table{width:100% !important;}
.syntaxhighlighter table caption{text-align:left !important;padding:.5em 0 0.5em 1em !important;}
.syntaxhighlighter table td.code{width:100% !important;}
.syntaxhighlighter table td.code .container{position:relative !important;}
.syntaxhighlighter table td.code .container textarea{box-sizing:border-box !important;position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;border:none !important;background:white !important;padding-left:1em !important;overflow:hidden !important;white-space:pre !important;}
.syntaxhighlighter table td.gutter .line{text-align:right !important;padding:0 0.5em 0 1em !important;}
.syntaxhighlighter table td.code .line{padding:0 1em !important;}
.syntaxhighlighter.nogutter td.code .container textarea,.syntaxhighlighter.nogutter td.code .line{padding-left:0em !important;}
.syntaxhighlighter.show{display:block !important;}
.syntaxhighlighter.collapsed table{display:none !important;}
.syntaxhighlighter.collapsed .toolbar{padding:0.1em 0.8em 0em 0.8em !important;font-size:1em !important;position:static !important;width:auto !important;height:auto !important;}
.syntaxhighlighter.collapsed .toolbar span{display:inline !important;margin-right:1em !important;}
.syntaxhighlighter.collapsed .toolbar span a{padding:0 !important;display:none !important;}
.syntaxhighlighter.collapsed .toolbar span a.expandSource{display:inline !important;}
.syntaxhighlighter .toolbar{position:absolute !important;right:1px !important;top:1px !important;width:11px !important;height:11px !important;font-size:10px !important;z-index:10 !important;}
.syntaxhighlighter .toolbar span.title{display:inline !important;}
.syntaxhighlighter .toolbar a{display:block !important;text-align:center !important;text-decoration:none !important;padding-top:1px !important;}
.syntaxhighlighter .toolbar a.expandSource{display:none !important;}
.syntaxhighlighter.ie{font-size:.9em !important;padding:1px 0 1px 0 !important;}
.syntaxhighlighter.ie .toolbar{line-height:8px !important;}
.syntaxhighlighter.ie .toolbar a{padding-top:0px !important;}
.syntaxhighlighter.printing .line.alt1 .content,.syntaxhighlighter.printing .line.alt2 .content,.syntaxhighlighter.printing .line.highlighted .number,.syntaxhighlighter.printing .line.highlighted.alt1 .content,.syntaxhighlighter.printing .line.highlighted.alt2 .content{background:none !important;}
.syntaxhighlighter.printing .line .number{color:#bbbbbb !important;}
.syntaxhighlighter.printing .line .content{color:black !important;}
.syntaxhighlighter.printing .toolbar{display:none !important;}
.syntaxhighlighter.printing a{text-decoration:none !important;}
.syntaxhighlighter.printing .plain,.syntaxhighlighter.printing .plain a{color:black !important;}
.syntaxhighlighter.printing .comments,.syntaxhighlighter.printing .comments a{color:#008200 !important;}
.syntaxhighlighter.printing .string,.syntaxhighlighter.printing .string a{color:blue !important;}
.syntaxhighlighter.printing .keyword{color:#006699 !important;font-weight:bold !important;}
.syntaxhighlighter.printing .preprocessor{color:gray !important;}
.syntaxhighlighter.printing .variable{color:#aa7700 !important;}
.syntaxhighlighter.printing .value{color:#009900 !important;}
.syntaxhighlighter.printing .functions{color:#ff1493 !important;}
.syntaxhighlighter.printing .constants{color:#0066cc !important;}
.syntaxhighlighter.printing .script{font-weight:bold !important;}
.syntaxhighlighter.printing .color1,.syntaxhighlighter.printing .color1 a{color:gray !important;}
.syntaxhighlighter.printing .color2,.syntaxhighlighter.printing .color2 a{color:#ff1493 !important;}
.syntaxhighlighter.printing .color3,.syntaxhighlighter.printing .color3 a{color:red !important;}
.syntaxhighlighter.printing .break,.syntaxhighlighter.printing .break a{color:black !important;}
.syntaxhighlighter{background-color:#0f192a !important;}
.syntaxhighlighter .line.alt1{background-color:#0f192a !important;}
.syntaxhighlighter .line.alt2{background-color:#0f192a !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#253e5a !important;}
.syntaxhighlighter .line.highlighted.number{color:#38566f !important;}
.syntaxhighlighter table caption{color:#d1edff !important;}
.syntaxhighlighter .gutter{color:#afafaf !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #435a5f !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#435a5f !important;color:#0f192a !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#428bdd !important;background:black !important;border:1px solid #435a5f !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#428bdd !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#1dc116 !important;}
.syntaxhighlighter .toolbar{color:#d1edff !important;background:#435a5f !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:#d1edff !important;}
.syntaxhighlighter .toolbar a:hover{color:#8aa6c1 !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#d1edff !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#428bdd !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#1dc116 !important;}
.syntaxhighlighter .keyword{color:#b43d3d !important;}
.syntaxhighlighter .preprocessor{color:#8aa6c1 !important;}
.syntaxhighlighter .variable{color:#ffaa3e !important;}
.syntaxhighlighter .value{color:#f7e741 !important;}
.syntaxhighlighter .functions{color:#ffaa3e !important;}
.syntaxhighlighter .constants{color:#e0e8ff !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#b43d3d !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#f8bb00 !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:white !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#ffaa3e !important;}

View File

@ -1,76 +0,0 @@
.syntaxhighlighter a,.syntaxhighlighter div,.syntaxhighlighter code,.syntaxhighlighter table,.syntaxhighlighter table td,.syntaxhighlighter table tr,.syntaxhighlighter table tbody,.syntaxhighlighter table thead,.syntaxhighlighter table caption,.syntaxhighlighter textarea{-moz-border-radius:0 0 0 0 !important;-webkit-border-radius:0 0 0 0 !important;background:none !important;border:0 !important;bottom:auto !important;float:none !important;height:auto !important;left:auto !important;line-height:1.1em !important;margin:0 !important;outline:0 !important;overflow:visible !important;padding:0 !important;position:static !important;right:auto !important;text-align:left !important;top:auto !important;vertical-align:baseline !important;width:auto !important;box-sizing:content-box !important;font-family:"Consolas","Bitstream Vera Sans Mono","Courier New",Courier,monospace !important;font-weight:normal !important;font-style:normal !important;font-size:1em !important;min-height:inherit !important;min-height:auto !important;}
.syntaxhighlighter{width:100% !important;margin:1em 0 1em 0 !important;position:relative !important;overflow:auto !important;font-size:1em !important;}
.syntaxhighlighter.source{overflow:hidden !important;}
.syntaxhighlighter .bold{font-weight:bold !important;}
.syntaxhighlighter .italic{font-style:italic !important;}
.syntaxhighlighter .line{white-space:pre !important;}
.syntaxhighlighter table{width:100% !important;}
.syntaxhighlighter table caption{text-align:left !important;padding:.5em 0 0.5em 1em !important;}
.syntaxhighlighter table td.code{width:100% !important;}
.syntaxhighlighter table td.code .container{position:relative !important;}
.syntaxhighlighter table td.code .container textarea{box-sizing:border-box !important;position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;border:none !important;background:white !important;padding-left:1em !important;overflow:hidden !important;white-space:pre !important;}
.syntaxhighlighter table td.gutter .line{text-align:right !important;padding:0 0.5em 0 1em !important;}
.syntaxhighlighter table td.code .line{padding:0 1em !important;}
.syntaxhighlighter.nogutter td.code .container textarea,.syntaxhighlighter.nogutter td.code .line{padding-left:0em !important;}
.syntaxhighlighter.show{display:block !important;}
.syntaxhighlighter.collapsed table{display:none !important;}
.syntaxhighlighter.collapsed .toolbar{padding:0.1em 0.8em 0em 0.8em !important;font-size:1em !important;position:static !important;width:auto !important;height:auto !important;}
.syntaxhighlighter.collapsed .toolbar span{display:inline !important;margin-right:1em !important;}
.syntaxhighlighter.collapsed .toolbar span a{padding:0 !important;display:none !important;}
.syntaxhighlighter.collapsed .toolbar span a.expandSource{display:inline !important;}
.syntaxhighlighter .toolbar{position:absolute !important;right:1px !important;top:1px !important;width:11px !important;height:11px !important;font-size:10px !important;z-index:10 !important;}
.syntaxhighlighter .toolbar span.title{display:inline !important;}
.syntaxhighlighter .toolbar a{display:block !important;text-align:center !important;text-decoration:none !important;padding-top:1px !important;}
.syntaxhighlighter .toolbar a.expandSource{display:none !important;}
.syntaxhighlighter.ie{font-size:.9em !important;padding:1px 0 1px 0 !important;}
.syntaxhighlighter.ie .toolbar{line-height:8px !important;}
.syntaxhighlighter.ie .toolbar a{padding-top:0px !important;}
.syntaxhighlighter.printing .line.alt1 .content,.syntaxhighlighter.printing .line.alt2 .content,.syntaxhighlighter.printing .line.highlighted .number,.syntaxhighlighter.printing .line.highlighted.alt1 .content,.syntaxhighlighter.printing .line.highlighted.alt2 .content{background:none !important;}
.syntaxhighlighter.printing .line .number{color:#bbbbbb !important;}
.syntaxhighlighter.printing .line .content{color:black !important;}
.syntaxhighlighter.printing .toolbar{display:none !important;}
.syntaxhighlighter.printing a{text-decoration:none !important;}
.syntaxhighlighter.printing .plain,.syntaxhighlighter.printing .plain a{color:black !important;}
.syntaxhighlighter.printing .comments,.syntaxhighlighter.printing .comments a{color:#008200 !important;}
.syntaxhighlighter.printing .string,.syntaxhighlighter.printing .string a{color:blue !important;}
.syntaxhighlighter.printing .keyword{color:#006699 !important;font-weight:bold !important;}
.syntaxhighlighter.printing .preprocessor{color:gray !important;}
.syntaxhighlighter.printing .variable{color:#aa7700 !important;}
.syntaxhighlighter.printing .value{color:#009900 !important;}
.syntaxhighlighter.printing .functions{color:#ff1493 !important;}
.syntaxhighlighter.printing .constants{color:#0066cc !important;}
.syntaxhighlighter.printing .script{font-weight:bold !important;}
.syntaxhighlighter.printing .color1,.syntaxhighlighter.printing .color1 a{color:gray !important;}
.syntaxhighlighter.printing .color2,.syntaxhighlighter.printing .color2 a{color:#ff1493 !important;}
.syntaxhighlighter.printing .color3,.syntaxhighlighter.printing .color3 a{color:red !important;}
.syntaxhighlighter.printing .break,.syntaxhighlighter.printing .break a{color:black !important;}
.syntaxhighlighter{background-color:#1b2426 !important;}
.syntaxhighlighter .line.alt1{background-color:#1b2426 !important;}
.syntaxhighlighter .line.alt2{background-color:#1b2426 !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#323e41 !important;}
.syntaxhighlighter .line.highlighted.number{color:#b9bdb6 !important;}
.syntaxhighlighter table caption{color:#b9bdb6 !important;}
.syntaxhighlighter .gutter{color:#afafaf !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #435a5f !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#435a5f !important;color:#1b2426 !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#5ba1cf !important;background:black !important;border:1px solid #435a5f !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#5ba1cf !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#5ce638 !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#435a5f !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:#e0e8ff !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#b9bdb6 !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#878a85 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#5ce638 !important;}
.syntaxhighlighter .keyword{color:#5ba1cf !important;}
.syntaxhighlighter .preprocessor{color:#435a5f !important;}
.syntaxhighlighter .variable{color:#ffaa3e !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#ffaa3e !important;}
.syntaxhighlighter .constants{color:#e0e8ff !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#5ba1cf !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#e0e8ff !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:white !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#ffaa3e !important;}

View File

@ -1,21 +0,0 @@
.syntaxhighlighter.applescript{background:white;font-size:1em;color:black;}
.syntaxhighlighter.applescript div,.syntaxhighlighter.applescript code{font:1em/1.25 Verdana,sans-serif !important;}
.syntaxhighlighter.applescript .code .line{overflow:hidden !important;}
.syntaxhighlighter.applescript .code .line.highlighted{background:#b5d5ff !important;}
.syntaxhighlighter.applescript .color1{color:#000000 !important;}
.syntaxhighlighter.applescript .color2{color:#000000 !important;}
.syntaxhighlighter.applescript .color3{color:#000000 !important;font-weight:bold !important;}
.syntaxhighlighter.applescript .keyword{color:#000000 !important;font-weight:bold !important;}
.syntaxhighlighter.applescript .color4{color:#0000ff !important;font-style:italic !important;}
.syntaxhighlighter.applescript .comments{color:#4c4d4d !important;}
.syntaxhighlighter.applescript .plain{color:#408000 !important;}
.syntaxhighlighter.applescript .string{color:#000000 !important;}
.syntaxhighlighter.applescript .commandNames{color:#0000ff !important;font-weight:bold !important;}
.syntaxhighlighter.applescript .parameterNames{color:#0000ff !important;}
.syntaxhighlighter.applescript .classes{color:#0000ff !important;font-style:italic !important;}
.syntaxhighlighter.applescript .properties{color:#6c04d4 !important;}
.syntaxhighlighter.applescript .enumeratedValues{color:#4a1e7f !important;}
.syntaxhighlighter.applescript .additionCommandNames{color:#0016b0 !important;font-weight:bold !important;}
.syntaxhighlighter.applescript .additionParameterNames{color:#0016b0 !important;}
.syntaxhighlighter.applescript .additionClasses{color:#0016b0 !important;font-style:italic !important;}
.syntaxhighlighter.applescript .spaces{display:inline-block;height:0 !important;font-size:1.75em !important;line-height:0 !important;}

View File

@ -1,31 +0,0 @@
.syntaxhighlighter{background-color:white !important;}
.syntaxhighlighter .line.alt1{background-color:white !important;}
.syntaxhighlighter .line.alt2{background-color:white !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#e0e0e0 !important;}
.syntaxhighlighter .line.highlighted.number{color:black !important;}
.syntaxhighlighter table caption{color:black !important;}
.syntaxhighlighter .gutter{color:#afafaf !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #6ce26c !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#6ce26c !important;color:white !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:blue !important;background:white !important;border:1px solid #6ce26c !important;}
.syntaxhighlighter.collapsed .toolbar a{color:blue !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:red !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#6ce26c !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:black !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:black !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#008200 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:blue !important;}
.syntaxhighlighter .keyword{color:#006699 !important;}
.syntaxhighlighter .preprocessor{color:gray !important;}
.syntaxhighlighter .variable{color:#aa7700 !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#ff1493 !important;}
.syntaxhighlighter .constants{color:#0066cc !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#006699 !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:gray !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff1493 !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:red !important;}
.syntaxhighlighter .keyword{font-weight:bold !important;}

View File

@ -1,32 +0,0 @@
.syntaxhighlighter{background-color:#0a2b1d !important;}
.syntaxhighlighter .line.alt1{background-color:#0a2b1d !important;}
.syntaxhighlighter .line.alt2{background-color:#0a2b1d !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#233729 !important;}
.syntaxhighlighter .line.highlighted.number{color:white !important;}
.syntaxhighlighter table caption{color:#f8f8f8 !important;}
.syntaxhighlighter .gutter{color:#497958 !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #41a83e !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#41a83e !important;color:#0a2b1d !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#96dd3b !important;background:black !important;border:1px solid #41a83e !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#96dd3b !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:white !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#41a83e !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:#ffe862 !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#f8f8f8 !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#336442 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#9df39f !important;}
.syntaxhighlighter .keyword{color:#96dd3b !important;}
.syntaxhighlighter .preprocessor{color:#91bb9e !important;}
.syntaxhighlighter .variable{color:#ffaa3e !important;}
.syntaxhighlighter .value{color:#f7e741 !important;}
.syntaxhighlighter .functions{color:#ffaa3e !important;}
.syntaxhighlighter .constants{color:#e0e8ff !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#96dd3b !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#eb939a !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#91bb9e !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#edef7d !important;}
.syntaxhighlighter .comments{font-style:italic !important;}
.syntaxhighlighter .keyword{font-weight:bold !important;}

View File

@ -1,34 +0,0 @@
.syntaxhighlighter{background-color:white !important;}
.syntaxhighlighter .line.alt1{background-color:white !important;}
.syntaxhighlighter .line.alt2{background-color:white !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#c3defe !important;}
.syntaxhighlighter .line.highlighted.number{color:white !important;}
.syntaxhighlighter table caption{color:black !important;}
.syntaxhighlighter .gutter{color:#787878 !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #d4d0c8 !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#d4d0c8 !important;color:white !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#3f5fbf !important;background:white !important;border:1px solid #d4d0c8 !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#3f5fbf !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#aa7700 !important;}
.syntaxhighlighter .toolbar{color:#a0a0a0 !important;background:#d4d0c8 !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:#a0a0a0 !important;}
.syntaxhighlighter .toolbar a:hover{color:red !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:black !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#3f5fbf !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#2a00ff !important;}
.syntaxhighlighter .keyword{color:#7f0055 !important;}
.syntaxhighlighter .preprocessor{color:#646464 !important;}
.syntaxhighlighter .variable{color:#aa7700 !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#ff1493 !important;}
.syntaxhighlighter .constants{color:#0066cc !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#7f0055 !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:gray !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff1493 !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:red !important;}
.syntaxhighlighter .keyword{font-weight:bold !important;}
.syntaxhighlighter .xml .keyword{color:#3f7f7f !important;font-weight:normal !important;}
.syntaxhighlighter .xml .color1,.syntaxhighlighter .xml .color1 a{color:#7f007f !important;}
.syntaxhighlighter .xml .string{font-style:italic !important;color:#2a00ff !important;}

View File

@ -1,30 +0,0 @@
.syntaxhighlighter{background-color:black !important;}
.syntaxhighlighter .line.alt1{background-color:black !important;}
.syntaxhighlighter .line.alt2{background-color:black !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#2a3133 !important;}
.syntaxhighlighter .line.highlighted.number{color:white !important;}
.syntaxhighlighter table caption{color:#d3d3d3 !important;}
.syntaxhighlighter .gutter{color:#d3d3d3 !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #990000 !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#990000 !important;color:black !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#ebdb8d !important;background:black !important;border:1px solid #990000 !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#ebdb8d !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#ff7d27 !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#990000 !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:#9ccff4 !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#d3d3d3 !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#ff7d27 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#ff9e7b !important;}
.syntaxhighlighter .keyword{color:aqua !important;}
.syntaxhighlighter .preprocessor{color:#aec4de !important;}
.syntaxhighlighter .variable{color:#ffaa3e !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#81cef9 !important;}
.syntaxhighlighter .constants{color:#ff9e7b !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:aqua !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#ebdb8d !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff7d27 !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#aec4de !important;}

View File

@ -1,31 +0,0 @@
.syntaxhighlighter{background-color:#121212 !important;}
.syntaxhighlighter .line.alt1{background-color:#121212 !important;}
.syntaxhighlighter .line.alt2{background-color:#121212 !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#2c2c29 !important;}
.syntaxhighlighter .line.highlighted.number{color:white !important;}
.syntaxhighlighter table caption{color:white !important;}
.syntaxhighlighter .gutter{color:#afafaf !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #3185b9 !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#3185b9 !important;color:#121212 !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#3185b9 !important;background:black !important;border:1px solid #3185b9 !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#3185b9 !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#d01d33 !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#3185b9 !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:#96daff !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:white !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#696854 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#e3e658 !important;}
.syntaxhighlighter .keyword{color:#d01d33 !important;}
.syntaxhighlighter .preprocessor{color:#435a5f !important;}
.syntaxhighlighter .variable{color:#898989 !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#aaaaaa !important;}
.syntaxhighlighter .constants{color:#96daff !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#d01d33 !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#ffc074 !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#4a8cdb !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#96daff !important;}
.syntaxhighlighter .functions{font-weight:bold !important;}

View File

@ -1,30 +0,0 @@
.syntaxhighlighter{background-color:#222222 !important;}
.syntaxhighlighter .line.alt1{background-color:#222222 !important;}
.syntaxhighlighter .line.alt2{background-color:#222222 !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#253e5a !important;}
.syntaxhighlighter .line.highlighted.number{color:white !important;}
.syntaxhighlighter table caption{color:lime !important;}
.syntaxhighlighter .gutter{color:#38566f !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #435a5f !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#435a5f !important;color:#222222 !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#428bdd !important;background:black !important;border:1px solid #435a5f !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#428bdd !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:lime !important;}
.syntaxhighlighter .toolbar{color:#aaaaff !important;background:#435a5f !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:#aaaaff !important;}
.syntaxhighlighter .toolbar a:hover{color:#9ccff4 !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:lime !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#428bdd !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:lime !important;}
.syntaxhighlighter .keyword{color:#aaaaff !important;}
.syntaxhighlighter .preprocessor{color:#8aa6c1 !important;}
.syntaxhighlighter .variable{color:aqua !important;}
.syntaxhighlighter .value{color:#f7e741 !important;}
.syntaxhighlighter .functions{color:#ff8000 !important;}
.syntaxhighlighter .constants{color:yellow !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#aaaaff !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:red !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:yellow !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#ffaa3e !important;}

View File

@ -1,30 +0,0 @@
.syntaxhighlighter{background-color:#0f192a !important;}
.syntaxhighlighter .line.alt1{background-color:#0f192a !important;}
.syntaxhighlighter .line.alt2{background-color:#0f192a !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#253e5a !important;}
.syntaxhighlighter .line.highlighted.number{color:#38566f !important;}
.syntaxhighlighter table caption{color:#d1edff !important;}
.syntaxhighlighter .gutter{color:#afafaf !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #435a5f !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#435a5f !important;color:#0f192a !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#428bdd !important;background:black !important;border:1px solid #435a5f !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#428bdd !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#1dc116 !important;}
.syntaxhighlighter .toolbar{color:#d1edff !important;background:#435a5f !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:#d1edff !important;}
.syntaxhighlighter .toolbar a:hover{color:#8aa6c1 !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#d1edff !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#428bdd !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#1dc116 !important;}
.syntaxhighlighter .keyword{color:#b43d3d !important;}
.syntaxhighlighter .preprocessor{color:#8aa6c1 !important;}
.syntaxhighlighter .variable{color:#ffaa3e !important;}
.syntaxhighlighter .value{color:#f7e741 !important;}
.syntaxhighlighter .functions{color:#ffaa3e !important;}
.syntaxhighlighter .constants{color:#e0e8ff !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#b43d3d !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#f8bb00 !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:white !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#ffaa3e !important;}

View File

@ -1,30 +0,0 @@
.syntaxhighlighter{background-color:#1b2426 !important;}
.syntaxhighlighter .line.alt1{background-color:#1b2426 !important;}
.syntaxhighlighter .line.alt2{background-color:#1b2426 !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#323e41 !important;}
.syntaxhighlighter .line.highlighted.number{color:#b9bdb6 !important;}
.syntaxhighlighter table caption{color:#b9bdb6 !important;}
.syntaxhighlighter .gutter{color:#afafaf !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #435a5f !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#435a5f !important;color:#1b2426 !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#5ba1cf !important;background:black !important;border:1px solid #435a5f !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#5ba1cf !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#5ce638 !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#435a5f !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:#e0e8ff !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#b9bdb6 !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#878a85 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#5ce638 !important;}
.syntaxhighlighter .keyword{color:#5ba1cf !important;}
.syntaxhighlighter .preprocessor{color:#435a5f !important;}
.syntaxhighlighter .variable{color:#ffaa3e !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#ffaa3e !important;}
.syntaxhighlighter .constants{color:#e0e8ff !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#5ba1cf !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#e0e8ff !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:white !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#ffaa3e !important;}

View File

@ -1,31 +0,0 @@
.syntaxhighlighter{background-color:white !important;}
.syntaxhighlighter .line.alt1{background-color:white !important;}
.syntaxhighlighter .line.alt2{background-color:white !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#e0e0e0 !important;}
.syntaxhighlighter .line.highlighted.number{color:black !important;}
.syntaxhighlighter table caption{color:black !important;}
.syntaxhighlighter .gutter{color:#afafaf !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #6ce26c !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#6ce26c !important;color:white !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:blue !important;background:white !important;border:1px solid #6ce26c !important;}
.syntaxhighlighter.collapsed .toolbar a{color:blue !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:red !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#6ce26c !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:black !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:black !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#008200 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#d11010 !important;}
.syntaxhighlighter .keyword{color:#006699 !important;}
.syntaxhighlighter .preprocessor{color:gray !important;}
.syntaxhighlighter .variable{color:#aa7700 !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#ff1493 !important;}
.syntaxhighlighter .constants{color:#0066cc !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#006699 !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:gray !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff1493 !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:red !important;}
.syntaxhighlighter .keyword{font-weight:bold !important;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 B

View File

@ -1,148 +0,0 @@
<?php
/**
* EasyPeasyICS Simple ICS/vCal data generator.
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
* @author Manuel Reinhard <manu@sprain.ch>
*
* Built with inspiration from
* http://stackoverflow.com/questions/1463480/how-can-i-use-php-to-dynamically-publish-an-ical-file-to-be-read-by-google-calend/1464355#1464355
* History:
* 2010/12/17 - Manuel Reinhard - when it all started
* 2014 PHPMailer project becomes maintainer
*/
/**
* Class EasyPeasyICS.
* Simple ICS data generator
* @package phpmailer
* @subpackage easypeasyics
*/
class EasyPeasyICS
{
/**
* The name of the calendar
* @var string
*/
protected $calendarName;
/**
* The array of events to add to this calendar
* @var array
*/
protected $events = array();
/**
* Constructor
* @param string $calendarName
*/
public function __construct($calendarName = "")
{
$this->calendarName = $calendarName;
}
/**
* Add an event to this calendar.
* @param string $start The start date and time as a unix timestamp
* @param string $end The end date and time as a unix timestamp
* @param string $summary A summary or title for the event
* @param string $description A description of the event
* @param string $url A URL for the event
* @param string $uid A unique identifier for the event - generated automatically if not provided
* @return array An array of event details, including any generated UID
*/
public function addEvent($start, $end, $summary = '', $description = '', $url = '', $uid = '')
{
if (empty($uid)) {
$uid = md5(uniqid(mt_rand(), true)) . '@EasyPeasyICS';
}
$event = array(
'start' => gmdate('Ymd', $start) . 'T' . gmdate('His', $start) . 'Z',
'end' => gmdate('Ymd', $end) . 'T' . gmdate('His', $end) . 'Z',
'summary' => $summary,
'description' => $description,
'url' => $url,
'uid' => $uid
);
$this->events[] = $event;
return $event;
}
/**
* @return array Get the array of events.
*/
public function getEvents()
{
return $this->events;
}
/**
* Clear all events.
*/
public function clearEvents()
{
$this->events = array();
}
/**
* Get the name of the calendar.
* @return string
*/
public function getName()
{
return $this->calendarName;
}
/**
* Set the name of the calendar.
* @param $name
*/
public function setName($name)
{
$this->calendarName = $name;
}
/**
* Render and optionally output a vcal string.
* @param bool $output Whether to output the calendar data directly (the default).
* @return string The complete rendered vlal
*/
public function render($output = true)
{
//Add header
$ics = 'BEGIN:VCALENDAR
METHOD:PUBLISH
VERSION:2.0
X-WR-CALNAME:' . $this->calendarName . '
PRODID:-//hacksw/handcal//NONSGML v1.0//EN';
//Add events
foreach ($this->events as $event) {
$ics .= '
BEGIN:VEVENT
UID:' . $event['uid'] . '
DTSTAMP:' . gmdate('Ymd') . 'T' . gmdate('His') . 'Z
DTSTART:' . $event['start'] . '
DTEND:' . $event['end'] . '
SUMMARY:' . str_replace("\n", "\\n", $event['summary']) . '
DESCRIPTION:' . str_replace("\n", "\\n", $event['description']) . '
URL;VALUE=URI:' . $event['url'] . '
END:VEVENT';
}
//Add footer
$ics .= '
END:VCALENDAR';
if ($output) {
//Output
$filename = $this->calendarName;
//Filename needs quoting if it contains spaces
if (strpos($filename, ' ') !== false) {
$filename = '"'.$filename.'"';
}
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: inline; filename=' . $filename . '.ics');
echo $ics;
}
return $ics;
}
}

View File

@ -1,17 +0,0 @@
# PHPMailer Extras
These classes provide optional additional functions to PHPMailer.
These are not loaded by the PHPMailer autoloader, so in some cases you may need to `require` them yourself before using them.
## EasyPeasyICS
This class was originally written by Manuel Reinhard and provides a simple means of generating ICS/vCal files that are used in sending calendar events. PHPMailer does not use it directly, but you can use it to generate content appropriate for placing in the `Ical` property of PHPMailer. The PHPMailer project is now its official home as Manuel has given permission for that and is no longer maintaining it himself.
## htmlfilter
This class by Konstantin Riabitsev and Jim Jagielski implements HTML filtering to remove potentially malicious tags, such as `<script>` or `onclick=` attributes that can result in XSS attacks. This is a simple filter and is not as comprehensive as [HTMLawed](http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/) or [HTMLPurifier](http://htmlpurifier.org), but it's easier to use and considerably better than nothing! PHPMailer does not use it directly, but you may want to apply it to user-supplied HTML before using it as a message body.
## NTLM_SASL_client
This class by Manuel Lemos (bundled with permission) adds the ability to authenticate with Microsoft Windows mail servers that use NTLM-based authentication. It is used by PHPMailer if you send via SMTP and set the `AuthType` property to `NTLM`; you will also need to use the `Realm` and `Workstation` properties. The original source is [here](http://www.phpclasses.org/browse/file/7495.html).

Some files were not shown because too many files have changed in this diff Show More