Compare commits

...

603 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
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
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
wispas c3a51b1e93
Create phpmailer.lang-mgl.php
Translated to Mongolian language
2021-04-10 00:24:23 +08:00
114 changed files with 3643 additions and 1056 deletions

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

1
.gitattributes vendored
View File

@ -1,6 +1,7 @@
* text=auto
/.codecov.yml export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore

View File

@ -14,7 +14,7 @@ Please check these things before submitting your issue:
- [ ] 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**](http://stackoverflow.com/questions/tagged/phpmailer)!
- [ ] 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

View File

@ -8,7 +8,14 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
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"

View File

@ -3,20 +3,28 @@ 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@v3
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: maxheld83/ghpages@v0.3.0
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

View File

@ -6,142 +6,207 @@ on:
# Allow manually triggering the workflow.
workflow_dispatch:
permissions: {}
jobs:
coding-standard:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
name: Coding standards
permissions:
contents: read # to fetch code (actions/checkout)
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Set up PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: '8.1'
php-version: 'latest'
coverage: none
tools: cs2pr
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
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
continue-on-error: true
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-18.04
runs-on: ubuntu-22.04
strategy:
matrix:
php: ['5.5', '7.2', '8.0', '8.1']
php: ['5.5', '7.2', '8.0', '8.5']
experimental: [false]
include:
- php: '8.2'
- 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@v3
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install PHP
uses: shivammathur/setup-php@v2
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-composer-dependencies
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
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 != '8.2' }}
if: ${{ matrix.php != 'nightly' }}
run: composer lint -- --checkstyle | cs2pr
- name: Lint against future parse errors (PHP 8.2)
if: ${{ matrix.php == '8.2' }}
- name: Lint against future parse errors (PHP nightly)
if: ${{ matrix.php == 'nightly' }}
run: composer lint
test:
needs: ['coding-standard', 'lint']
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
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: '8.1'
- 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.2'
- php: '8.6'
extensions: 'optimal'
coverage: false
experimental: true
- php: '8.6'
extensions: 'minimal'
coverage: false
experimental: true
name: "Test: PHP ${{ matrix.php }}"
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@v3
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Set coverage variable
id: set_cov
# 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.coverage }} == "true" ]; then
echo '::set-output name=COV::xdebug'
if [[ "${{ matrix.extensions }}" == "optimal" ]]; then
# Optimal.
echo 'EXT=imap, mbstring, openssl, intl, ctype, filter, hash' >> $GITHUB_OUTPUT
echo 'COMPOSER_OPTIONS=' >> $GITHUB_OUTPUT
else
echo '::set-output name=COV::none'
# 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@v2
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: ${{ matrix.php }}
coverage: ${{ steps.set_cov.outputs.COV }}
ini-values: sendmail_path=/usr/sbin/sendmail -t -i, error_reporting=E_ALL, display_errors=On
extensions: imap, mbstring, intl, ctype, filter, hash
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-composer-dependencies
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install PHP packages - normal
if: ${{ matrix.php != '8.2' }}
uses: "ramsey/composer-install@v2"
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.2' }}
uses: "ramsey/composer-install@v2"
if: ${{ matrix.php == '8.6' }}
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
with:
composer-options: --ignore-platform-reqs
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@v2
uses: nick-invision/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 2
max_attempts: 3
retry_wait_seconds: 5
retry_wait_seconds: 8
command: |
sudo apt-get install -y -qq postfix qmail
sudo service postfix stop
sudo apt-get install --fix-broken -y libsqlite3-0 postfix
sudo systemctl stop postfix.service
- name: Set up sendmail
run: |
@ -162,8 +227,10 @@ jobs:
run: vendor/bin/phpunit
- name: Send coverage report to Codecov
if: ${{ success() && matrix.coverage == true }}
uses: codecov/codecov-action@v3
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

View File

@ -10,43 +10,45 @@
[![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 To, CC, BCC and Reply-to addresses
- 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, CRAM-MD5, and XOAUTH2 mechanisms over SMTPS and SMTP+STARTTLS transports
- 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.5 and later, including PHP 8.1
- 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 encryption, authentication, HTML messages, and attachments.
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.
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!
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.
*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](https://swiftmailer.symfony.com/)
, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail) etc.
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, 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.
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 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": "^6.5"
"phpmailer/phpmailer": "^7.0.0"
```
or run
@ -57,7 +59,8 @@ composer require phpmailer/phpmailer
Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer.
If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`.
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.
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:
@ -72,7 +75,7 @@ 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 the SMTP class. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally.
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.
@ -93,7 +96,7 @@ use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
//Load Composer's autoloader
//Load Composer's autoloader (created by composer, not included with PHPMailer)
require 'vendor/autoload.php';
//Create an instance; passing `true` enables exceptions
@ -135,21 +138,21 @@ try {
}
```
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.
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 many 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
$mail->setLanguage('fr', '/optional/path/to/language/directory/');
```
We welcome corrections and new languages if you're looking for corrections, 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.
@ -160,9 +163,9 @@ To reduce PHPMailer's deployed code footprint, examples are not included if you
Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/).
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](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good reference for 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.
@ -177,9 +180,9 @@ Please disclose any vulnerabilities found responsibly report 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.
@ -203,7 +206,7 @@ Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard c
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
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)
@ -211,7 +214,7 @@ use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-php
See [changelog](changelog.md).
## History
- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/).
- 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.
@ -221,9 +224,9 @@ See [changelog](changelog.md).
### What's changed since moving from SourceForge?
- Official successor to the SourceForge and Google Code projects.
- Test suite.
- Continuous integration with Github Actions.
- 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

@ -13,13 +13,13 @@ PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs
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 it 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.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.

View File

@ -6,7 +6,7 @@ If you're in doubt about how you should be using PHPMailer 6, take a look at the
## PHP Version
PHPMailer 6.0 requires PHP 5.5 or later, and is fully compatible with PHP 7.0. 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).
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
@ -38,7 +38,7 @@ require 'src/Exception.php';
```
## Namespace
PHPMailer 6 uses a [namespace](http://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.
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:
@ -91,7 +91,7 @@ try {
```
## OAuth2 Support
The OAuth2 implementation has been completely redesigned using the [OAuth2 packages](http://oauth2-client.thephpleague.com) from the [League of extraordinary packages](http://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).
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.

View File

@ -1 +1 @@
6.6.1
7.0.2

View File

@ -1,7 +1,139 @@
# PHPMailer Change Log
## Version 6.6.1 (June 14th, 2022)
* Don't clear errors on RSET, so they can be obtained when using keepalive
## 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!
@ -65,7 +197,7 @@ Many thanks to @jrfnl for all her work.
## 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
* 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
@ -144,7 +276,7 @@ Many thanks to @jrfnl for all her work.
## 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://tools.ietf.org/html/rfc2387#section-3.1) in `multipart/related` structures.
* 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
@ -219,7 +351,7 @@ Many thanks to @jrfnl for all her work.
* Update license doc
* Updated upgrading docs
* Clarify `addStringEmbeddedImage` docs
* Hide auth credentials in all but lowest level debug output, prevents leakage in bug reports
* 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)
@ -278,7 +410,7 @@ This is a major update that breaks backwards compatibility.
* 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
* 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()`.
@ -292,7 +424,7 @@ This is a major update that breaks backwards compatibility.
* 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.
@ -721,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
@ -809,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.
@ -926,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)

View File

@ -28,7 +28,8 @@
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"lock": false
},
"require": {
"php": ">=5.5.0",
@ -37,23 +38,29 @@
"ext-hash": "*"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"doctrine/annotations": "^1.2",
"php-parallel-lint/php-console-highlighter": "^0.5.0",
"php-parallel-lint/php-parallel-lint": "^1.3.1",
"phpcompatibility/php-compatibility": "^9.3.5",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.6.2",
"yoast/phpunit-polyfills": "^1.0.0"
"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": {
"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",
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
"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": {
"psr-4": {
"PHPMailer\\PHPMailer\\": "src/"
@ -67,10 +74,11 @@
"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 . -e php,phps --exclude vendor --exclude .git --exclude build"
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . --show-deprecated -e php,phps --exclude vendor --exclude .git --exclude build"
]
}
}

View File

@ -2,7 +2,7 @@
/**
* This example shows sending a DKIM-signed message with PHPMailer.
* More info about DKIM can be found here: http://www.dkim.org/info/dkim-faq.html
* 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,

View File

@ -8,14 +8,15 @@ This folder contains a collection of examples of using [PHPMailer](https://githu
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](http://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 Travis-CI configuration to run PHPMailer's unit tests.
* [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](http://tools.ietf.org/tools/msglint/), not a mail server, the IETF's MIME structure analyser checks the formatting of your messages.
* [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](http://tools.ietf.org/html/rfc2606). Don't use made-up domains like 'mydomain.com' or 'somedomain.com' in examples as someone, somewhere, probably owns them!
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!_

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!';
}

View File

@ -10,7 +10,7 @@
<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> with the UTF-8 unicode charset.</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>

View File

@ -83,26 +83,24 @@ if (!$mail->send()) {
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)
//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)
{
//You can change 'Sent Mail' to any other folder or tag
$path = '{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail';
$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

@ -88,7 +88,7 @@ $mail->setOAuth(
//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
//Then create the wrapper class that implements OAuthTokenProvider
$oauthTokenProvider = new MyOAuthTokenProvider(/* Email, ClientId, ClientSecret, etc. */);
//Pass the implementation of OAuthTokenProvider to PHPMailer
@ -113,9 +113,6 @@ $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;

View File

@ -8,7 +8,7 @@
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
error_reporting(E_STRICT | E_ALL);
error_reporting(E_ALL);
date_default_timezone_set('Etc/UTC');
@ -28,7 +28,10 @@ $mail->Username = 'yourname@example.com';
$mail->Password = 'yourpassword';
$mail->setFrom('list@example.com', 'List manager');
$mail->addReplyTo('list@example.com', 'List manager');
$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
@ -48,18 +51,29 @@ foreach ($result as $row) {
try {
$mail->addAddress($row['email'], $row['full_name']);
} catch (Exception $e) {
echo 'Invalid address skipped: ' . htmlspecialchars($row['email']) . '<br>';
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']) . '>'
);
try {
$mail->send();
echo 'Message sent to :' . htmlspecialchars($row['full_name']) . ' (' .
htmlspecialchars($row['email']) . ')<br>';
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,
@ -67,7 +81,11 @@ foreach ($result as $row) {
mysqli_real_escape_string($mysql, $row['email']) . "'"
);
} catch (Exception $e) {
echo 'Mailer Error (' . htmlspecialchars($row['email']) . ') ' . $mail->ErrorInfo . '<br>';
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();

View File

@ -13,7 +13,7 @@ $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
//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
@ -54,7 +54,7 @@ if (array_key_exists('userfile', $_FILES)) {
<input type="submit" value="Send File">
</form>
<?php } else {
echo htmlspecialchars($msg);
echo htmlspecialchars($msg, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401);
} ?>
</body>
</html>
</html>

View File

@ -54,7 +54,7 @@ if (array_key_exists('userfile', $_FILES)) {
<input type="submit" value="Send Files">
</form>
<?php } else {
echo htmlspecialchars($msg);
echo htmlspecialchars($msg, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401);
} ?>
</body>
</html>

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

@ -10,7 +10,7 @@ use PHPMailer\PHPMailer\PHPMailer;
require '../vendor/autoload.php';
if (array_key_exists('to', $_POST)) {
if (array_key_exists('email', $_POST)) {
$err = false;
$msg = '';
$email = '';
@ -45,7 +45,7 @@ if (array_key_exists('to', $_POST)) {
$to = 'support@example.com';
}
//Make sure the address they provided is valid before trying to use it
if (array_key_exists('email', $_POST) && PHPMailer::validateAddress($_POST['email'])) {
if (PHPMailer::validateAddress($_POST['email'])) {
$email = $_POST['email'];
} else {
$msg .= 'Error: invalid email address provided';
@ -99,4 +99,4 @@ if (array_key_exists('to', $_POST)) {
echo $msg;
} ?>
</body>
</html>
</html>

View File

@ -9,7 +9,7 @@
* 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
* 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.

View File

@ -49,6 +49,11 @@ $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;

View File

@ -4,9 +4,8 @@
* SMTP low memory example.
*/
namespace PHPMailer\PHPMailer;
require '../vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
/**
* This class demonstrates sending an already-built RFC822 message via SMTP
@ -31,8 +30,10 @@ class SMTPLowMemory extends SMTP
* 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 '.'.
* NOTE: this does not count towards line-length 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
@ -110,22 +111,7 @@ class SMTPLowMemory extends SMTP
}
}
/**
* We need to use a PHPMailer subclass to make it use our SMTP implementation.
* @package PHPMailer\PHPMailer
*/
class PHPMailerLowMemory extends PHPMailer
{
/**
* Patch in the new SMTP class.
* @return SMTP
*/
public function getSMTPInstance()
{
if (!is_object($this->smtp)) {
$this->smtp = new SMTPLowMemory();
}
return $this->smtp;
}
}
//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

@ -24,7 +24,7 @@ $mail->isSMTP();
//SMTP::DEBUG_OFF = off (for production use)
//SMTP::DEBUG_CLIENT = client messages
//SMTP::DEBUG_SERVER = client and server messages
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->SMTPDebug = SMTP::DEBUG_CONNECTION;
//Set the hostname of the mail server
$mail->Host = 'smtp.example.com';

View File

@ -12,7 +12,7 @@
* @copyright 2012 - 2020 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
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.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.
@ -36,7 +36,7 @@ namespace PHPMailer\PHPMailer;
* Aliases for League Provider Classes
* Make sure you have added these to your composer.json and run `composer install`
* Plenty to choose from here:
* @see http://oauth2-client.thephpleague.com/providers/thirdparty/
* @see https://oauth2-client.thephpleague.com/providers/thirdparty/
*/
//@see https://github.com/thephpleague/oauth2-google
use League\OAuth2\Client\Provider\Google;
@ -44,14 +44,31 @@ use League\OAuth2\Client\Provider\Google;
use Hayageek\OAuth2\Client\Provider\Yahoo;
//@see https://github.com/stevenmaguire/oauth2-microsoft
use Stevenmaguire\OAuth2\Client\Provider\Microsoft;
//@see https://github.com/greew/oauth2-azure-provider
use Greew\OAuth2\Client\Provider\Azure;
if (!isset($_GET['code']) && !isset($_GET['provider'])) {
if (!isset($_GET['code']) && !isset($_POST['provider'])) {
?>
<html>
<body>Select Provider:<br>
<a href='?provider=Google'>Google</a><br>
<a href='?provider=Yahoo'>Yahoo</a><br>
<a href='?provider=Microsoft'>Microsoft/Outlook/Hotmail/Live/Office365</a><br>
<body>
<form method="post">
<h1>Select Provider</h1>
<input type="radio" name="provider" value="Google" id="providerGoogle">
<label for="providerGoogle">Google</label><br>
<input type="radio" name="provider" value="Yahoo" id="providerYahoo">
<label for="providerYahoo">Yahoo</label><br>
<input type="radio" name="provider" value="Microsoft" id="providerMicrosoft">
<label for="providerMicrosoft">Microsoft</label><br>
<input type="radio" name="provider" value="Azure" id="providerAzure">
<label for="providerAzure">Azure</label><br>
<h1>Enter id and secret</h1>
<p>These details are obtained by setting up an app in your provider's developer console.
</p>
<p>ClientId: <input type="text" name="clientId"><p>
<p>ClientSecret: <input type="text" name="clientSecret"></p>
<p>TenantID (only relevant for Azure): <input type="text" name="tenantId"></p>
<input type="submit" value="Continue">
</form>
</body>
</html>
<?php
@ -63,21 +80,29 @@ require 'vendor/autoload.php';
session_start();
$providerName = '';
$clientId = '';
$clientSecret = '';
$tenantId = '';
if (array_key_exists('provider', $_GET)) {
$providerName = $_GET['provider'];
if (array_key_exists('provider', $_POST)) {
$providerName = $_POST['provider'];
$clientId = $_POST['clientId'];
$clientSecret = $_POST['clientSecret'];
$tenantId = $_POST['tenantId'];
$_SESSION['provider'] = $providerName;
$_SESSION['clientId'] = $clientId;
$_SESSION['clientSecret'] = $clientSecret;
$_SESSION['tenantId'] = $tenantId;
} elseif (array_key_exists('provider', $_SESSION)) {
$providerName = $_SESSION['provider'];
}
if (!in_array($providerName, ['Google', 'Microsoft', 'Yahoo'])) {
exit('Only Google, Microsoft and Yahoo OAuth2 providers are currently supported in this script.');
$clientId = $_SESSION['clientId'];
$clientSecret = $_SESSION['clientSecret'];
$tenantId = $_SESSION['tenantId'];
}
//These details are obtained by setting up an app in the Google developer console,
//or whichever provider you're using.
$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
//If you don't want to use the built-in form, set your client id and secret here
//$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
//$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
//If this automatic URL doesn't work, set it yourself manually to the URL of this script
$redirectUri = (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
@ -114,6 +139,17 @@ switch ($providerName) {
]
];
break;
case 'Azure':
$params['tenantId'] = $tenantId;
$provider = new Azure($params);
$options = [
'scope' => [
'https://outlook.office.com/SMTP.Send',
'offline_access'
]
];
break;
}
if (null === $provider) {
@ -142,5 +178,5 @@ if (!isset($_GET['code'])) {
);
//Use this to interact with an API on the users behalf
//Use this to get a new access token if the old one expires
echo 'Refresh Token: ', $token->getRefreshToken();
echo 'Refresh Token: ', htmlspecialchars($token->getRefreshToken(), ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401);
}

View File

@ -0,0 +1,35 @@
<?php
/**
* Assamese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Manish Sarkar <manish.n.manish@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP ত্ৰুটি: প্ৰমাণীকৰণ কৰিব নোৱাৰি';
$PHPMAILER_LANG['buggy_php'] = 'আপোনাৰ PHP সংস্কৰণ এটা বাগৰ দ্বাৰা প্ৰভাৱিত হয় যাৰ ফলত নষ্ট বাৰ্তা হব পাৰে । ইয়াক সমাধান কৰিবলে, প্ৰেৰণ কৰিবলে SMTP ব্যৱহাৰ কৰক, আপোনাৰ php.ini ত mail.add_x_header বিকল্প নিষ্ক্ৰিয় কৰক, MacOS বা Linux লৈ সলনি কৰক, বা আপোনাৰ PHP সংস্কৰণ 7.0.17+ বা 7.1.3+ লৈ সলনি কৰক ।';
$PHPMAILER_LANG['connect_host'] = 'SMTP ত্ৰুটি: SMTP চাৰ্ভাৰৰ সৈতে সংযোগ কৰিবলে অক্ষম';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP ত্ৰুটি: তথ্য গ্ৰহণ কৰা হোৱা নাই';
$PHPMAILER_LANG['empty_message'] = 'বাৰ্তাৰ মূখ্য অংশ খালী।';
$PHPMAILER_LANG['encoding'] = 'অজ্ঞাত এনকোডিং: ';
$PHPMAILER_LANG['execute'] = 'এক্সিকিউট কৰিব নোৱাৰি: ';
$PHPMAILER_LANG['extension_missing'] = 'সম্প্ৰসাৰণ নোহোৱা হৈছে: ';
$PHPMAILER_LANG['file_access'] = 'ফাইল অভিগম কৰিবলে অক্ষম: ';
$PHPMAILER_LANG['file_open'] = 'ফাইল ত্ৰুটি: ফাইল খোলিবলৈ অক্ষম: ';
$PHPMAILER_LANG['from_failed'] = 'নিম্নলিখিত প্ৰেৰকৰ ঠিকনা(সমূহ) ব্যৰ্থ: ';
$PHPMAILER_LANG['instantiate'] = 'মেইল ফাংচনৰ এটা উদাহৰণ সৃষ্টি কৰিবলে অক্ষম';
$PHPMAILER_LANG['invalid_address'] = 'প্ৰেৰণ কৰিব নোৱাৰি: অবৈধ ইমেইল ঠিকনা: ';
$PHPMAILER_LANG['invalid_header'] = 'অবৈধ হেডাৰৰ নাম বা মান';
$PHPMAILER_LANG['invalid_hostentry'] = 'অবৈধ হোষ্টেন্ট্ৰি: ';
$PHPMAILER_LANG['invalid_host'] = 'অবৈধ হস্ট:';
$PHPMAILER_LANG['mailer_not_supported'] = 'মেইলাৰ সমৰ্থিত নহয়।';
$PHPMAILER_LANG['provide_address'] = 'আপুনি অন্ততঃ এটা গন্তব্য ইমেইল ঠিকনা দিব লাগিব';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP ত্ৰুটি: নিম্নলিখিত গন্তব্যস্থানসমূহ ব্যৰ্থ: ';
$PHPMAILER_LANG['signing'] = 'স্বাক্ষৰ কৰাত ব্যৰ্থ: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP কড: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'অতিৰিক্ত SMTP তথ্য: ';
$PHPMAILER_LANG['smtp_detail'] = 'বিৱৰণ:';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP সংযোগ() ব্যৰ্থ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP চাৰ্ভাৰৰ ত্ৰুটি: ';
$PHPMAILER_LANG['variable_set'] = 'চলক নিৰ্ধাৰণ কৰিব পৰা নগল: ';
$PHPMAILER_LANG['extension_missing'] = 'অনুপস্থিত সম্প্ৰসাৰণ: ';

View File

@ -0,0 +1,35 @@
<?php
/**
* Bengali PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Manish Sarkar <manish.n.manish@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP ত্রুটি: প্রমাণীকরণ করতে অক্ষম৷';
$PHPMAILER_LANG['buggy_php'] = 'আপনার PHP সংস্করণ একটি বাগ দ্বারা প্রভাবিত হয় যার ফলে দূষিত বার্তা হতে পারে। এটি ঠিক করতে, পাঠাতে SMTP ব্যবহার করুন, আপনার php.ini এ mail.add_x_header বিকল্পটি নিষ্ক্রিয় করুন, MacOS বা Linux-এ স্যুইচ করুন, অথবা আপনার PHP সংস্করণকে 7.0.17+ বা 7.1.3+ এ পরিবর্তন করুন।';
$PHPMAILER_LANG['connect_host'] = 'SMTP ত্রুটি: SMTP সার্ভারের সাথে সংযোগ করতে অক্ষম৷';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP ত্রুটি: ডেটা গ্রহণ করা হয়নি৷';
$PHPMAILER_LANG['empty_message'] = 'বার্তার অংশটি খালি।';
$PHPMAILER_LANG['encoding'] = 'অজানা এনকোডিং: ';
$PHPMAILER_LANG['execute'] = 'নির্বাহ করতে অক্ষম: ';
$PHPMAILER_LANG['extension_missing'] = 'এক্সটেনশন অনুপস্থিত:';
$PHPMAILER_LANG['file_access'] = 'ফাইল অ্যাক্সেস করতে অক্ষম: ';
$PHPMAILER_LANG['file_open'] = 'ফাইল ত্রুটি: ফাইল খুলতে অক্ষম: ';
$PHPMAILER_LANG['from_failed'] = 'নিম্নলিখিত প্রেরকের ঠিকানা(গুলি) ব্যর্থ হয়েছে: ';
$PHPMAILER_LANG['instantiate'] = 'মেল ফাংশনের একটি উদাহরণ তৈরি করতে অক্ষম৷';
$PHPMAILER_LANG['invalid_address'] = 'পাঠাতে অক্ষম: অবৈধ ইমেল ঠিকানা: ';
$PHPMAILER_LANG['invalid_header'] = 'অবৈধ হেডার নাম বা মান';
$PHPMAILER_LANG['invalid_hostentry'] = 'অবৈধ হোস্টেন্ট্রি: ';
$PHPMAILER_LANG['invalid_host'] = 'অবৈধ হোস্ট:';
$PHPMAILER_LANG['mailer_not_supported'] = 'মেইলার সমর্থিত নয়।';
$PHPMAILER_LANG['provide_address'] = 'আপনাকে অবশ্যই অন্তত একটি গন্তব্য ইমেল ঠিকানা প্রদান করতে হবে৷';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP ত্রুটি: নিম্নলিখিত গন্তব্যগুলি ব্যর্থ হয়েছে: ';
$PHPMAILER_LANG['signing'] = 'স্বাক্ষর করতে ব্যর্থ হয়েছে: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP কোড: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'অতিরিক্ত SMTP তথ্য:';
$PHPMAILER_LANG['smtp_detail'] = 'বর্ণনা: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP সংযোগ() ব্যর্থ হয়েছে৷';
$PHPMAILER_LANG['smtp_error'] = 'SMTP সার্ভার ত্রুটি: ';
$PHPMAILER_LANG['variable_set'] = 'পরিবর্তনশীল সেট করা যায়নি: ';
$PHPMAILER_LANG['extension_missing'] = 'অনুপস্থিত এক্সটেনশন: ';

View File

@ -1,27 +0,0 @@
<?php
/**
* Chinese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author LiuXin <http://www.80x86.cn/blog/>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。';
$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = '未知编码:';
$PHPMAILER_LANG['execute'] = '不能执行: ';
$PHPMAILER_LANG['file_access'] = '不能访问文件:';
$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:';
$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: ';
$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。';
//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。';
$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';

View File

@ -9,21 +9,31 @@
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.';
$PHPMAILER_LANG['buggy_php'] = 'Din version af PHP er berørt af en fejl, som gør at dine beskeder muligvis vises forkert. For at rette dette kan du skifte til SMTP, slå mail.add_x_header headeren i din php.ini fil fra, skifte til MacOS eller Linux eller opgradere din version af PHP til 7.0.17+ eller 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.';
$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold';
$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: ';
$PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: ';
$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: ';
$PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: ';
$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: ';
$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: ';
$PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.';
$PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: ';
$PHPMAILER_LANG['invalid_header'] = 'Ugyldig header navn eller værdi';
$PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig hostentry: ';
$PHPMAILER_LANG['invalid_host'] = 'Ugyldig vært: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
$PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: ';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere fejlede: ';
$PHPMAILER_LANG['signing'] = 'Signeringsfejl: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP kode: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Yderligere SMTP info: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.';
$PHPMAILER_LANG['smtp_detail'] = 'Detalje: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: ';
$PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: ';
$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: ';
$PHPMAILER_LANG['no_smtputf8'] = 'Serveren understøtter ikke SMTPUTF8 som påkrævet for at sende til Unicode adresser';
$PHPMAILER_LANG['imap_recommended'] = 'Brug af forenklet adresseparser anbefales ikke. Installer PHP IMAP udvidelsen for fuld RFC822 parsing.';
$PHPMAILER_LANG['deprecated_argument'] = 'Udfaset argument: ';

View File

@ -5,22 +5,29 @@
* @package PHPMailer
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Σφάλμα: Αδυναμία πιστοποίησης (authentication).';
$PHPMAILER_LANG['connect_host'] = 'SMTP Σφάλμα: Αδυναμία σύνδεσης στον SMTP-Host.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Σφάλμα: Τα δεδομένα δεν έγιναν αποδεκτά.';
$PHPMAILER_LANG['empty_message'] = 'Το E-Mail δεν έχει περιεχόμενο .';
$PHPMAILER_LANG['encoding'] = 'Αγνωστο Encoding-Format: ';
$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης ακόλουθης εντολής: ';
$PHPMAILER_LANG['file_access'] = 'Αδυναμία προσπέλασης του αρχείου: ';
$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Δεν είναι δυνατό το άνοιγμα του ακόλουθου αρχείου: ';
$PHPMAILER_LANG['from_failed'] = 'Η παρακάτω διεύθυνση αποστολέα δεν είναι σωστή: ';
$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης Mail function.';
$PHPMAILER_LANG['invalid_address'] = 'Το μήνυμα δεν εστάλη, η διεύθυνση δεν είναι έγκυρη: ';
$PHPMAILER_LANG['authenticate'] = 'Σφάλμα SMTP: Αδυναμία πιστοποίησης.';
$PHPMAILER_LANG['buggy_php'] = 'Η έκδοση PHP που χρησιμοποιείτε παρουσιάζει σφάλμα που μπορεί να έχει ως αποτέλεσμα κατεστραμένα μηνύματα. Για να το διορθώσετε, αλλάξτε τον τρόπο αποστολής σε SMTP, απενεργοποιήστε την επιλογή mail.add_x_header στο αρχείο php.ini, αλλάξτε λειτουργικό σε MacOS ή Linux ή αναβαθμίστε την PHP σε έκδοση 7.0.17+ ή 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'Σφάλμα SMTP: Αδυναμία σύνδεσης με τον φιλοξενητή SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Σφάλμα SMTP: Μη αποδεκτά δεδομένα.';
$PHPMAILER_LANG['empty_message'] = 'Η ηλεκτρονική επιστολή δεν έχει περιεχόμενο.';
$PHPMAILER_LANG['encoding'] = 'Άγνωστη μορφή κωδικοποίησης: ';
$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης: ';
$PHPMAILER_LANG['extension_missing'] = 'Απουσία επέκτασης: ';
$PHPMAILER_LANG['file_access'] = 'Αδυναμία πρόσβασης στο αρχείο: ';
$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Αδυναμία ανοίγματος αρχείου: ';
$PHPMAILER_LANG['from_failed'] = 'Η ακόλουθη διεύθυνση αποστολέα δεν είναι σωστή: ';
$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης συνάρτησης Mail.';
$PHPMAILER_LANG['invalid_address'] = 'Μη έγκυρη διεύθυνση: ';
$PHPMAILER_LANG['invalid_header'] = 'Μη έγκυρο όνομα κεφαλίδας ή τιμή';
$PHPMAILER_LANG['invalid_hostentry'] = 'Μη έγκυρη εισαγωγή φιλοξενητή: ';
$PHPMAILER_LANG['invalid_host'] = 'Μη έγκυρος φιλοξενητής: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer δεν υποστηρίζεται.';
$PHPMAILER_LANG['provide_address'] = 'Παρακαλούμε δώστε τουλάχιστον μια e-mail διεύθυνση παραλήπτη.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Σφάλμα: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: ';
$PHPMAILER_LANG['provide_address'] = 'Δώστε τουλάχιστον μια ηλεκτρονική διεύθυνση παραλήπτη.';
$PHPMAILER_LANG['recipients_failed'] = 'Σφάλμα SMTP: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: ';
$PHPMAILER_LANG['signing'] = 'Σφάλμα υπογραφής: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης στον SMTP Server.';
$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα από τον SMTP Server: ';
$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή αρχικοποίησης μεταβλητής: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
$PHPMAILER_LANG['smtp_code'] = 'Κώδικάς SMTP: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Πρόσθετες πληροφορίες SMTP: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης SMTP.';
$PHPMAILER_LANG['smtp_detail'] = 'Λεπτομέρεια: ';
$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα με τον διακομιστή SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή επαναφοράς μεταβλητής: ';

View File

@ -3,24 +3,35 @@
/**
* Esperanto PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Robin van der Vliet <info@robinvandervliet.com>
*/
$PHPMAILER_LANG['authenticate'] = 'Eraro de servilo SMTP : aŭtentigo malsukcesis.';
$PHPMAILER_LANG['connect_host'] = 'Eraro de servilo SMTP : konektado al servilo malsukcesis.';
$PHPMAILER_LANG['data_not_accepted'] = 'Eraro de servilo SMTP : neĝustaj datumoj.';
$PHPMAILER_LANG['empty_message'] = 'Teksto de mesaĝo mankas.';
$PHPMAILER_LANG['authenticate'] = 'SMTP-eraro: Ne eblis aŭtentigi.';
$PHPMAILER_LANG['buggy_php'] = 'Via versio de PHP estas trafita de cimo, kiu povas kaŭzi difektitajn mesaĝojn. Por ripari tion, ŝanĝu al sendado per SMTP, malŝaltu la opcion mail.add_x_header en via php.ini, ŝanĝu al MacOS aŭ Linux, aŭ ĝisdatigu vian PHP al versio 7.0.17+ aŭ 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'SMTP-eraro: Ne eblis konektiĝi al la SMTP-gastiganto.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-eraro: Datumoj ne akceptitaj.';
$PHPMAILER_LANG['empty_message'] = 'Mesaĝokorpo malplena';
$PHPMAILER_LANG['encoding'] = 'Nekonata kodoprezento: ';
$PHPMAILER_LANG['execute'] = 'Lanĉi rulumadon ne eblis: ';
$PHPMAILER_LANG['file_access'] = 'Aliro al dosiero ne sukcesis: ';
$PHPMAILER_LANG['file_open'] = 'Eraro de dosiero: malfermo neeblas: ';
$PHPMAILER_LANG['from_failed'] = 'Jena adreso de sendinto malsukcesis: ';
$PHPMAILER_LANG['instantiate'] = 'Genero de retmesaĝa funkcio neeblis.';
$PHPMAILER_LANG['invalid_address'] = 'Retadreso ne validas: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mesaĝilo ne subtenata.';
$PHPMAILER_LANG['provide_address'] = 'Vi devas tajpi almenaŭ unu recevontan retadreson.';
$PHPMAILER_LANG['recipients_failed'] = 'Eraro de servilo SMTP : la jenaj poŝtrecivuloj kaŭzis eraron: ';
$PHPMAILER_LANG['signing'] = 'Eraro de subskribo: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP konektado malsukcesis.';
$PHPMAILER_LANG['smtp_error'] = 'Eraro de servilo SMTP : ';
$PHPMAILER_LANG['variable_set'] = 'Variablo ne pravalorizeblas aŭ ne repravalorizeblas: ';
$PHPMAILER_LANG['extension_missing'] = 'Mankas etendo: ';
$PHPMAILER_LANG['execute'] = 'Ne eblis plenumi: ';
$PHPMAILER_LANG['extension_missing'] = 'Kromprogramo mankas: ';
$PHPMAILER_LANG['file_access'] = 'Ne eblis aliri la dosieron: ';
$PHPMAILER_LANG['file_open'] = 'Dosiera eraro: Ne eblis malfermi la dosieron: ';
$PHPMAILER_LANG['from_failed'] = 'La sekva(j) sendinto(j) malsukcesis: ';
$PHPMAILER_LANG['instantiate'] = 'Ne eblis funkciigi la retpoŝtan funkcion.';
$PHPMAILER_LANG['invalid_address'] = 'Nevalida adreso: ';
$PHPMAILER_LANG['invalid_header'] = 'Nevalida kaplinia nomo aŭ valoro';
$PHPMAILER_LANG['invalid_hostentry'] = 'Nevalida enigo de gastiganto: ';
$PHPMAILER_LANG['invalid_host'] = 'Nevalida gastiganto: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' retpoŝtilo ne estas subtenata.';
$PHPMAILER_LANG['provide_address'] = 'Vi devas provizi almenaŭ unu retpoŝtadreson de ricevonto.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-eraro: La sekva(j) ricevonto(j) malsukcesis: ';
$PHPMAILER_LANG['signing'] = 'Subskriba eraro: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP-kodo: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Pliaj SMTP-informoj: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'La SMTP-konektiĝo malsukcesis.';
$PHPMAILER_LANG['smtp_detail'] = 'Informoj: ';
$PHPMAILER_LANG['smtp_error'] = 'Eraro de SMTP-servilo: ';
$PHPMAILER_LANG['variable_set'] = 'Ne eblas agordi aŭ reagordi la variablon: ';
$PHPMAILER_LANG['no_smtputf8'] = 'La servilo ne subtenas SMTPUTF8, kiu estas bezonata por sendi al Unicode-adresoj.';
$PHPMAILER_LANG['imap_recommended'] = 'Uzado de la simpligita adresanalizilo ne estas rekomendita. Instalu la IMAP-kromprogramon por PHP por plena RFC822-analizado.';
$PHPMAILER_LANG['deprecated_argument'] = 'Malrekomendita argumento: ';

View File

@ -4,24 +4,35 @@
* Spanish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Matt Sturdy <matt.sturdy@gmail.com>
* @author Crystopher Glodzienski Cardoso <crystopher.glodzienski@gmail.com>
* @author Daniel Cruz <danicruz0415@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.';
$PHPMAILER_LANG['buggy_php'] = 'Tu versión de PHP ha sido afectada por un bug que puede resultar en mensajes corruptos. Para arreglarlo, cambia a enviar usando SMTP, deshabilita la opción mail.add_x_header en tu php.ini, cambia a MacOS o Linux, o actualiza tu PHP a la versión 7.0.17+ o 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.';
$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.';
$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: ';
$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: ';
$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: ';
$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: ';
$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: ';
$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
$PHPMAILER_LANG['from_failed'] = 'La siguiente dirección de remitente falló: ';
$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.';
$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: ';
$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido';
$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry inválido: ';
$PHPMAILER_LANG['invalid_host'] = 'Host inválido: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.';
$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: ';
$PHPMAILER_LANG['signing'] = 'Error al firmar: ';
$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.';
$PHPMAILER_LANG['smtp_detail'] = 'Detalle: ';
$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: ';
$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: ';
$PHPMAILER_LANG['imap_recommended'] = 'No se recomienda usar el analizador de direcciones simplificado. Instala la extensión IMAP de PHP para un análisis RFC822 más completo.';
$PHPMAILER_LANG['deprecated_argument'] = 'Argumento obsoleto: ';

View File

@ -20,7 +20,6 @@ $PHPMAILER_LANG['instantiate'] = 'mail-funktion luonti epäonnistui.';
$PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.';
$PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähk&ouml;postiosoite.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';
$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';

View File

@ -6,7 +6,6 @@
* Some French punctuation requires a thin non-breaking space (U+202F) character before it,
* for example before a colon or exclamation mark.
* There is one of these characters between these quotes: ""
* @see http://unicode.org/udhr/n/notes_fra.html
*/
$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP: échec de lauthentification.';
@ -31,8 +30,7 @@ $PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP:les destinataires s
$PHPMAILER_LANG['signing'] = 'Erreur de signature: ';
$PHPMAILER_LANG['smtp_code'] = 'Code SMTP: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Informations supplémentaires SMTP: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échouée.';
$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échoué.';
$PHPMAILER_LANG['smtp_detail'] = 'Détails: ';
$PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Impossible dinitialiser ou de réinitialiser une variable: ';
$PHPMAILER_LANG['extension_missing'] = 'Extension manquante: ';

View File

@ -4,24 +4,32 @@
* Hindi PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Yash Karanke <mr.karanke@gmail.com>
* Rewrite and extension of the work by Jayanti Suthar <suthar.jayanti93@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। ';
$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.';
$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। ';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। ';
$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। ';
$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। ';
$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। ';
$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';
$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। ';
$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। ';
$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। ';
$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।';
$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। ';
$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान';
$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: ';
$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: ';
$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। ';
$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। ';
$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। ';
$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। ';
$PHPMAILER_LANG['smtp_detail'] = 'विवरण: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। ';
$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। ';
$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';

View File

@ -3,27 +3,35 @@
/**
* Japanese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Mitsuhiro Yoshida <http://mitstek.com/>
* @author Mitsuhiro Yoshida <https://mitstek.com>
* @author Yoshi Sakai <http://bluemooninc.jp/>
* @author Arisophy <https://github.com/arisophy/>
* @author ARAKI Musashi <https://github.com/arakim/>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。';
$PHPMAILER_LANG['buggy_php'] = 'ご利用のバージョンのPHPには不具合があり、メッセージが破損するおそれがあります。問題の解決は以下のいずれかを行ってください。SMTPでの送信に切り替える。php.iniのmail.add_x_headerをoffにする。MacOSまたはLinuxに切り替える。PHPバージョン7.0.17以降または7.1.3以降にアップグレードする。';
$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。';
$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。';
$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';
$PHPMAILER_LANG['execute'] = '実行できませんでした: ';
$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: ';
$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';
$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';
$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: ';
$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。';
$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: ';
$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
$PHPMAILER_LANG['invalid_header'] = '不正なヘッダー名またはその内容';
$PHPMAILER_LANG['invalid_hostentry'] = '不正なホストエントリー: ';
$PHPMAILER_LANG['invalid_host'] = '不正なホスト: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: ';
$PHPMAILER_LANG['signing'] = '署名エラー: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTPコード: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'SMTP追加情報: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。';
$PHPMAILER_LANG['smtp_detail'] = '詳細: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: ';
$PHPMAILER_LANG['variable_set'] = '変数が存在しません: ';
$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: ';

View File

@ -0,0 +1,27 @@
<?php
/**
* Kurdish (Sorani) PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Halo Salman <halo@home4t.com>
*/
$PHPMAILER_LANG['authenticate'] = 'هەڵەی SMTP : نەتوانرا کۆدەکە پشتڕاست بکرێتەوە ';
$PHPMAILER_LANG['connect_host'] = 'هەڵەی SMTP: نەتوانرا پەیوەندی بە سێرڤەرەوە بکات SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'هەڵەی SMTP: ئەو زانیاریانە قبوڵ نەکرا.';
$PHPMAILER_LANG['empty_message'] = 'پەیامەکە بەتاڵە';
$PHPMAILER_LANG['encoding'] = 'کۆدکردنی نەزانراو : ';
$PHPMAILER_LANG['execute'] = 'ناتوانرێت جێبەجێ بکرێت: ';
$PHPMAILER_LANG['file_access'] = 'ناتوانرێت دەستت بگات بە فایلەکە: ';
$PHPMAILER_LANG['file_open'] = 'هەڵەی پەڕگە(فایل): ناتوانرێت بکرێتەوە: ';
$PHPMAILER_LANG['from_failed'] = 'هەڵە لە ئاستی ناونیشانی نێرەر: ';
$PHPMAILER_LANG['instantiate'] = 'ناتوانرێت خزمەتگوزاری پۆستە پێشکەش بکرێت.';
$PHPMAILER_LANG['invalid_address'] = 'نەتوانرا بنێردرێت ، چونکە ناونیشانی ئیمەیڵەکە نادروستە: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' مەیلەر پشتگیری ناکات';
$PHPMAILER_LANG['provide_address'] = 'دەبێت ناونیشانی ئیمەیڵی لانیکەم یەک وەرگر دابین بکرێت.';
$PHPMAILER_LANG['recipients_failed'] = ' هەڵەی SMTP: ئەم هەڵانەی خوارەوەشکستی هێنا لە ناردن بۆ هەردووکیان: ';
$PHPMAILER_LANG['signing'] = 'هەڵەی واژۆ: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect()پەیوەندی شکستی هێنا .';
$PHPMAILER_LANG['smtp_error'] = 'هەڵەی ئاستی سێرڤەری SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'ناتوانرێت بیگۆڕیت یان دوبارە بینێریتەوە: ';
$PHPMAILER_LANG['extension_missing'] = 'درێژکراوە نەماوە: ';

View File

@ -0,0 +1,27 @@
<?php
/**
* Mongolian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author @wispas
*/
$PHPMAILER_LANG['authenticate'] = 'Алдаа SMTP: Холбогдож чадсангүй.';
$PHPMAILER_LANG['connect_host'] = 'Алдаа SMTP: SMTP- сервертэй холбогдож болохгүй байна.';
$PHPMAILER_LANG['data_not_accepted'] = 'Алдаа SMTP: зөвшөөрөгдсөнгүй.';
$PHPMAILER_LANG['encoding'] = 'Тодорхойгүй кодчилол: ';
$PHPMAILER_LANG['execute'] = 'Коммандыг гүйцэтгэх боломжгүй байна: ';
$PHPMAILER_LANG['file_access'] = 'Файлд хандах боломжгүй байна: ';
$PHPMAILER_LANG['file_open'] = 'Файлын алдаа: файлыг нээх боломжгүй байна: ';
$PHPMAILER_LANG['from_failed'] = 'Илгээгчийн хаяг буруу байна: ';
$PHPMAILER_LANG['instantiate'] = 'Mail () функцийг ажиллуулах боломжгүй байна.';
$PHPMAILER_LANG['provide_address'] = 'Хүлээн авагчийн имэйл хаягийг оруулна уу.';
$PHPMAILER_LANG['mailer_not_supported'] = ' — мэйл серверийг дэмжсэнгүй.';
$PHPMAILER_LANG['recipients_failed'] = 'Алдаа SMTP: ийм хаягийг илгээж чадсангүй: ';
$PHPMAILER_LANG['empty_message'] = 'Хоосон мессэж';
$PHPMAILER_LANG['invalid_address'] = 'И-Мэйл буруу форматтай тул илгээх боломжгүй: ';
$PHPMAILER_LANG['signing'] = 'Гарын үсгийн алдаа: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP сервертэй холбогдоход алдаа гарлаа';
$PHPMAILER_LANG['smtp_error'] = 'SMTP серверийн алдаа: ';
$PHPMAILER_LANG['variable_set'] = 'Хувьсагчийг тохируулах эсвэл дахин тохируулах боломжгүй байна: ';
$PHPMAILER_LANG['extension_missing'] = 'Өргөтгөл байхгүй: ';

View File

@ -3,24 +3,35 @@
/**
* Norwegian Bokmål PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Wera AS <wordpress@wera.no>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Feil: Kunne ikke autentisere.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Feil: Kunne ikke koble til SMTP tjener.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Feil: Datainnhold ikke akseptert.';
$PHPMAILER_LANG['empty_message'] = 'Meldingsinnhold mangler';
$PHPMAILER_LANG['encoding'] = 'Ukjent koding: ';
$PHPMAILER_LANG['execute'] = 'Kunne ikke utføre: ';
$PHPMAILER_LANG['file_access'] = 'Får ikke tilgang til filen: ';
$PHPMAILER_LANG['file_open'] = 'Fil Feil: Kunne ikke åpne filen: ';
$PHPMAILER_LANG['from_failed'] = 'Følgende Frå adresse feilet: ';
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere post funksjon.';
$PHPMAILER_LANG['invalid_address'] = 'Ugyldig adresse: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' sender er ikke støttet.';
$PHPMAILER_LANG['provide_address'] = 'Du må opppgi minst en mottakeradresse.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottakeradresse feilet: ';
$PHPMAILER_LANG['signing'] = 'Signering Feil: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() feilet.';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server feil: ';
$PHPMAILER_LANG['variable_set'] = 'Kan ikke skrive eller omskrive variabel: ';
$PHPMAILER_LANG['extension_missing'] = 'Utvidelse mangler: ';
$PHPMAILER_LANG['authenticate'] = 'SMTP-feil: Kunne ikke autentisere.';
$PHPMAILER_LANG['buggy_php'] = 'Din versjon av PHP er påvirket av en feil som kan føre til ødelagte meldinger. For å løse problemet kan du bytte til sending via SMTP, deaktivere mail.add_x_header-alternativet i php.ini, bytte til MacOS eller Linux, eller oppgradere PHP til versjon 7.0.17+ eller 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'SMTP-feil: Kunne ikke koble til SMTP-vert.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-feil: data ikke akseptert.';
$PHPMAILER_LANG['empty_message'] = 'Meldingsinnholdet er tomt';
$PHPMAILER_LANG['encoding'] = 'Ukjent koding: ';
$PHPMAILER_LANG['execute'] = 'Kunne ikke utføres: ';
$PHPMAILER_LANG['extension_missing'] = 'Utvidelse mangler: ';
$PHPMAILER_LANG['file_access'] = 'Kunne ikke få tilgang til filen: ';
$PHPMAILER_LANG['file_open'] = 'Feil i fil: Kunne ikke åpne filen: ';
$PHPMAILER_LANG['from_failed'] = 'Følgende avsenderadresse mislyktes: ';
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke starte e-postfunksjonen.';
$PHPMAILER_LANG['invalid_address'] = 'Ugyldig adresse: ';
$PHPMAILER_LANG['invalid_header'] = 'Ugyldig headernavn eller verdi';
$PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig vertsinngang: ';
$PHPMAILER_LANG['invalid_host'] = 'Ugyldig vert: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' sender er ikke støttet.';
$PHPMAILER_LANG['provide_address'] = 'Du må oppgi minst én mottaker-e-postadresse.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottakeradresse feilet: ';
$PHPMAILER_LANG['signing'] = 'Signeringsfeil: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP-kode: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Ytterligere SMTP-info: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() mislyktes.';
$PHPMAILER_LANG['smtp_detail'] = 'Detaljer: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfeil: ';
$PHPMAILER_LANG['variable_set'] = 'Kan ikke angi eller tilbakestille variabel: ';
$PHPMAILER_LANG['no_smtputf8'] = 'Serveren støtter ikke SMTPUTF8, som er nødvendig for å sende til Unicode-adresser.';
$PHPMAILER_LANG['imap_recommended'] = 'Det anbefales ikke å bruke forenklet adresseanalyse. Installer PHP IMAP-utvidelsen for full RFC822-analyse.';
$PHPMAILER_LANG['deprecated_argument'] = 'Avviklet argument: ';

View File

@ -4,10 +4,11 @@
* Dutch PHPMailer language file: refer to PHPMailer.php for definitive list.
* @package PHPMailer
* @author Tuxion <team@tuxion.nl>
* @author Robin van der Vliet <info@robinvandervliet.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.';
$PHPMAILER_LANG['buggy_php'] = 'PHP versie gededecteerd die onderhavig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de mail.add_x_header optie in uw php.ini file uit, gebruik MacOS of Linux, of pas de gebruikte PHP versie aan naar versie 7.0.17+ or 7.1.3+.';
$PHPMAILER_LANG['buggy_php'] = 'PHP-versie gedetecteerd die onderhevig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de optie mail.add_x_header in uw php.ini uit, gebruik MacOS of Linux, of pas de gebruikte PHP-versie aan naar versie 7.0.17+ or 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.';
$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg';
@ -16,19 +17,22 @@ $PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: ';
$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: ';
$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: ';
$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: ';
$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: ';
$PHPMAILER_LANG['from_failed'] = 'Het volgende afzenderadres is mislukt: ';
$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.';
$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: ';
$PHPMAILER_LANG['invalid_header'] = 'Ongeldige header naam of waarde';
$PHPMAILER_LANG['invalid_header'] = 'Ongeldige headernaam of -waarde';
$PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: ';
$PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';
$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: ';
$PHPMAILER_LANG['signing'] = 'Signeerfout: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP code: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP informatie: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.';
$PHPMAILER_LANG['smtp_code'] = 'SMTP-code: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP-informatie: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP-verbinding mislukt.';
$PHPMAILER_LANG['smtp_detail'] = 'Detail: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: ';
$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: ';
$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of herstellen: ';
$PHPMAILER_LANG['no_smtputf8'] = 'De server ondersteunt geen SMTPUTF8 dat nodig is om naar Unicode-adressen te sturen.';
$PHPMAILER_LANG['imap_recommended'] = 'Het gebruik van de vereenvoudigde adresparser is niet aanbevolen. Installeer de IMAP-extensie voor PHP voor volledige RFC822-ondersteuning.';
$PHPMAILER_LANG['deprecated_argument'] = 'Verouderd argument: ';

View File

@ -5,23 +5,29 @@
* @package PHPMailer
*/
$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić uwierzytelnienia.';
$PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.';
$PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.';
$PHPMAILER_LANG['empty_message'] = 'Wiadomość jest pusta.';
$PHPMAILER_LANG['encoding'] = 'Nieznany sposób kodowania znaków: ';
$PHPMAILER_LANG['execute'] = 'Nie można uruchomić: ';
$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: nie udało się przeprowadzić uwierzytelnienia.';
$PHPMAILER_LANG['buggy_php'] = 'Używana wersja PHP zawiera błąd, który może powodować uszkodzenie wiadomości. Aby temu zapobiec, użyj wysyłki przez SMTP, wyłącz opcję mail.add_x_header w php.ini, przejdź na macOS lub Linux, lub zaktualizuj PHP do wersji 7.0.17+ albo 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: nie udało się połączyć z serwerem (hostem).';
$PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: dane wiadomości nie zostały przyjęte przez serwer.';
$PHPMAILER_LANG['empty_message'] = 'Nie można wysłać pustej wiadomości.';
$PHPMAILER_LANG['encoding'] = 'Nieobsługiwane kodowanie znaków: ';
$PHPMAILER_LANG['execute'] = 'Nie udało się uruchomić polecenia: ';
$PHPMAILER_LANG['extension_missing'] = 'Brak wymaganego rozszerzenia PHP: ';
$PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: ';
$PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: ';
$PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest nieprawidłowy: ';
$PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';
$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, ' .
'następujący adres Odbiorcy jest nieprawidłowy: ';
$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.';
$PHPMAILER_LANG['file_open'] = 'Nie udało się otworzyć pliku: ';
$PHPMAILER_LANG['from_failed'] = 'Nieprawidłowy adres nadawcy: ';
$PHPMAILER_LANG['instantiate'] = 'Nie można zainicjować funkcji mail(). Sprawdź konfigurację serwera.';
$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości. Nieprawidłowy adres odbiorcy: ';
$PHPMAILER_LANG['invalid_header'] = 'Nieprawidłowa nazwa lub wartość nagłówka.';
$PHPMAILER_LANG['invalid_hostentry'] = 'Nieprawidłowy wpis hosta: ';
$PHPMAILER_LANG['invalid_host'] = 'Nieprawidłowa nazwa hosta: ';
$PHPMAILER_LANG['provide_address'] = 'Musisz podać co najmniej jeden prawidłowy adres e-mail odbiorcy.';
$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: ';
$PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zakończone niepowodzeniem.';
$PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: ';
$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: nie udało się wysłać do następujących odbiorców: ';
$PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości cyfrowo: ';
$PHPMAILER_LANG['smtp_code'] = 'Kod odpowiedzi SMTP: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatkowe informacje serwera SMTP: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Nie udało się nawiązać połączenia za pomocą SMTP Connect().';
$PHPMAILER_LANG['smtp_detail'] = 'Szczegóły błędu: ';
$PHPMAILER_LANG['smtp_error'] = 'Błąd serwera SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: ';
$PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: ';

View File

@ -3,25 +3,32 @@
/**
* Portuguese (European) PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Jonadabe <jonadabe@hotmail.com>
* @author João Vieira <mail@joaovieira.eu>
*/
$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.';
$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.';
$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.';
$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Falha na autenticação.';
$PHPMAILER_LANG['buggy_php'] = 'A sua versão do PHP tem um bug que pode causar mensagens corrompidas. Para resolver, utilize o envio por SMTP, desative a opção mail.add_x_header no ficheiro php.ini, mude para MacOS ou Linux, ou atualize o PHP para a versão 7.0.17+ ou 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Não foi possível ligar ao servidor SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Dados não aceites.';
$PHPMAILER_LANG['empty_message'] = 'A mensagem de e-mail está vazia.';
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: ';
$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: ';
$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: ';
$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.';
$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.';
$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: ';
$PHPMAILER_LANG['signing'] = 'Erro ao assinar: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.';
$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: ';
$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder ao ficheiro: ';
$PHPMAILER_LANG['file_open'] = 'Erro ao abrir o ficheiro: ';
$PHPMAILER_LANG['from_failed'] = 'O envio falhou para o seguinte endereço do remetente: ';
$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: ';
$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor do cabeçalho inválido.';
$PHPMAILER_LANG['invalid_hostentry'] = 'Entrada de host inválida: ';
$PHPMAILER_LANG['invalid_host'] = 'Host inválido: ';
$PHPMAILER_LANG['mailer_not_supported'] = 'O cliente de e-mail não é suportado.';
$PHPMAILER_LANG['provide_address'] = 'Deve fornecer pelo menos um endereço de destinatário.';
$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Falha no envio para os seguintes destinatários: ';
$PHPMAILER_LANG['signing'] = 'Erro ao assinar: ';
$PHPMAILER_LANG['smtp_code'] = 'Código SMTP: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais SMTP: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Falha na função SMTP connect().';
$PHPMAILER_LANG['smtp_detail'] = 'Detalhes: ';
$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';

View File

@ -5,24 +5,32 @@
* @package PHPMailer
* @author Alexey Chumakov <alex@chumakov.ru>
* @author Foster Snowhill <i18n@forstwoof.ru>
* @author ProjectSoft <projectsoft2009@yandex.ru>
*/
$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.';
$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: не удалось пройти аутентификацию.';
$PHPMAILER_LANG['buggy_php'] = 'В вашей версии PHP есть ошибка, которая может привести к повреждению сообщений. Чтобы исправить, переключитесь на отправку по SMTP, отключите опцию mail.add_x_header в ваш php.ini, переключитесь на MacOS или Linux или обновите PHP до версии 7.0.17+ или 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.';
$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.';
$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение';
$PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: ';
$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: ';
$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: ';
$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: ';
$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: ';
$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: ';
$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().';
$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.';
$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: ';
$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение';
$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: ';
$PHPMAILER_LANG['invalid_header'] = 'Неверное имя или значение заголовка';
$PHPMAILER_LANG['invalid_hostentry'] = 'Неверная запись хоста: ';
$PHPMAILER_LANG['invalid_host'] = 'Неверный хост: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
$PHPMAILER_LANG['provide_address'] = 'Вы должны указать хотя бы один адрес электронной почты получателя.';
$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: Ошибка следующих получателей: ';
$PHPMAILER_LANG['signing'] = 'Ошибка подписи: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером';
$PHPMAILER_LANG['smtp_code'] = 'Код SMTP: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Дополнительная информация SMTP: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером.';
$PHPMAILER_LANG['smtp_detail'] = 'Детали: ';
$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: ';
$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: ';
$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: ';

View File

@ -0,0 +1,34 @@
<?php
/**
* Sinhalese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Ayesh Karunaratne <ayesh@aye.sh>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP දෝෂය: සත්‍යාපනය අසාර්ථක විය.';
$PHPMAILER_LANG['buggy_php'] = 'ඔබගේ PHP version එකෙහි පවතින දෝෂයක් නිසා email පණිවිඩ දෝෂ සහගත වීමේ හැකියාවක් ඇත. මෙය විසදීම සදහා SMTP භාවිතා කිරීම, mail.add_x_header INI setting එක අක්‍රීය කිරීම, MacOS හෝ Linux වලට මාරු වීම, හෝ ඔබගේ PHP version එක 7.0.17+ හෝ 7.1.3+ වලට අලුත් කිරීම කරගන්න.';
$PHPMAILER_LANG['connect_host'] = 'SMTP දෝෂය: සම්බන්ධ වීමට නොහැකි විය.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP දෝෂය: දත්ත පිළිගනු නොලැබේ.';
$PHPMAILER_LANG['empty_message'] = 'පණිවිඩ අන්තර්ගතය හිස්';
$PHPMAILER_LANG['encoding'] = 'නොදන්නා කේතනය: ';
$PHPMAILER_LANG['execute'] = 'ක්‍රියාත්මක කළ නොහැකි විය: ';
$PHPMAILER_LANG['extension_missing'] = 'Extension එක නොමැත: ';
$PHPMAILER_LANG['file_access'] = 'File එකට ප්‍රවේශ විය නොහැකි විය: ';
$PHPMAILER_LANG['file_open'] = 'File දෝෂය: File එක විවෘත කළ නොහැක: ';
$PHPMAILER_LANG['from_failed'] = 'පහත From ලිපිනයන් අසාර්ථක විය: ';
$PHPMAILER_LANG['instantiate'] = 'mail function එක ක්‍රියාත්මක කළ නොහැක.';
$PHPMAILER_LANG['invalid_address'] = 'වලංගු නොවන ලිපිනය: ';
$PHPMAILER_LANG['invalid_header'] = 'වලංගු නොවන header නාමයක් හෝ අගයක්';
$PHPMAILER_LANG['invalid_hostentry'] = 'වලංගු නොවන hostentry එකක්: ';
$PHPMAILER_LANG['invalid_host'] = 'වලංගු නොවන host එකක්: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer සහාය නොදක්වයි.';
$PHPMAILER_LANG['provide_address'] = 'ඔබ අවම වශයෙන් එක් ලබන්නෙකුගේ ඊමේල් ලිපිනයක් සැපයිය යුතුය.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP දෝෂය: පහත ලබන්නන් අසමත් විය: ';
$PHPMAILER_LANG['signing'] = 'Sign කිරීමේ දෝෂය: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP කේතය: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'අමතර SMTP තොරතුරු: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP සම්බන්ධය අසාර්ථක විය.';
$PHPMAILER_LANG['smtp_detail'] = 'තොරතුරු: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP දෝෂය: ';
$PHPMAILER_LANG['variable_set'] = 'Variable එක සැකසීමට හෝ නැවත සැකසීමට නොහැක: ';

View File

@ -11,21 +11,28 @@
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Oturum açılamadı.';
$PHPMAILER_LANG['buggy_php'] = 'PHP sürümünüz iletilerin bozulmasına neden olabilecek bir hatadan etkileniyor. Bunu düzeltmek için, SMTP kullanarak göndermeye geçin, mail.add_x_header seçeneğini devre dışı bırakın php.ini dosyanızdaki mail.add_x_header seçeneğini devre dışı bırakın, MacOS veya Linux geçin veya PHP sürümünü 7.0.17+ veya 7.1.3+ sürümüne yükseltin,';
$PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP sunucusuna bağlanılamadı.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatası: Veri kabul edilmedi.';
$PHPMAILER_LANG['empty_message'] = 'Mesajın içeriği boş';
$PHPMAILER_LANG['encoding'] = 'Bilinmeyen karakter kodlama: ';
$PHPMAILER_LANG['execute'] = 'Çalıştırılamadı: ';
$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: ';
$PHPMAILER_LANG['file_access'] = 'Dosyaya erişilemedi: ';
$PHPMAILER_LANG['file_open'] = 'Dosya Hatası: Dosya açılamadı: ';
$PHPMAILER_LANG['from_failed'] = 'Belirtilen adreslere gönderme başarısız: ';
$PHPMAILER_LANG['instantiate'] = 'Örnek e-posta fonksiyonu oluşturulamadı.';
$PHPMAILER_LANG['invalid_address'] = 'Geçersiz e-posta adresi: ';
$PHPMAILER_LANG['invalid_header'] = 'Geçersiz başlık adı veya değeri: ';
$PHPMAILER_LANG['invalid_hostentry'] = 'Geçersiz ana bilgisayar girişi: ';
$PHPMAILER_LANG['invalid_host'] = 'Geçersiz ana bilgisayar: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.';
$PHPMAILER_LANG['provide_address'] = 'En az bir alıcı e-posta adresi belirtmelisiniz.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: ';
$PHPMAILER_LANG['signing'] = 'İmzalama hatası: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP kodu: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'ek SMTP bilgileri: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() fonksiyonu başarısız.';
$PHPMAILER_LANG['smtp_detail'] = 'SMTP SMTP Detayı: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP sunucu hatası: ';
$PHPMAILER_LANG['variable_set'] = 'Değişken ayarlanamadı ya da sıfırlanamadı: ';
$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: ';

View File

@ -0,0 +1,30 @@
<?php
/**
* Urdu PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Saqib Ali Siddiqui <saqibsra@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP خرابی: تصدیق کرنے سے قاصر۔';
$PHPMAILER_LANG['connect_host'] = 'SMTP خرابی: سرور سے منسلک ہونے سے قاصر۔';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP خرابی: ڈیٹا قبول نہیں کیا گیا۔';
$PHPMAILER_LANG['empty_message'] = 'پیغام کی باڈی خالی ہے۔';
$PHPMAILER_LANG['encoding'] = 'نامعلوم انکوڈنگ: ';
$PHPMAILER_LANG['execute'] = 'عمل کرنے کے قابل نہیں ';
$PHPMAILER_LANG['file_access'] = 'فائل تک رسائی سے قاصر:';
$PHPMAILER_LANG['file_open'] = 'فائل کی خرابی: فائل کو کھولنے سے قاصر:';
$PHPMAILER_LANG['from_failed'] = 'درج ذیل بھیجنے والے کا پتہ ناکام ہو گیا:';
$PHPMAILER_LANG['instantiate'] = 'میل فنکشن کی مثال بنانے سے قاصر۔';
$PHPMAILER_LANG['invalid_address'] = 'بھیجنے سے قاصر: غلط ای میل پتہ:';
$PHPMAILER_LANG['mailer_not_supported'] = ' میلر تعاون یافتہ نہیں ہے۔';
$PHPMAILER_LANG['provide_address'] = 'آپ کو کم از کم ایک منزل کا ای میل پتہ فراہم کرنا چاہیے۔';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP خرابی: درج ذیل پتہ پر نہیں بھیجا جاسکا: ';
$PHPMAILER_LANG['signing'] = 'دستخط کی خرابی: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP ملنا ناکام ہوا';
$PHPMAILER_LANG['smtp_error'] = 'SMTP سرور کی خرابی: ';
$PHPMAILER_LANG['variable_set'] = 'متغیر سیٹ نہیں کیا جا سکا: ';
$PHPMAILER_LANG['extension_missing'] = 'ایکٹینشن موجود نہیں ہے۔ ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP سرور کوڈ: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'اضافی SMTP سرور کی معلومات:';
$PHPMAILER_LANG['invalid_header'] = 'غلط ہیڈر کا نام یا قدر';

View File

@ -9,11 +9,13 @@
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。';
$PHPMAILER_LANG['buggy_php'] = '您的 PHP 版本存在漏洞,可能会导致消息损坏。为修复此问题,请切换到使用 SMTP 发送,在您的 php.ini 中禁用 mail.add_x_header 选项。切换到 MacOS 或 Linux或将您的 PHP 升级到 7.0.17+ 或 7.1.3+ 版本。';
$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。';
$PHPMAILER_LANG['empty_message'] = '邮件正文为空。';
$PHPMAILER_LANG['encoding'] = '未知编码:';
$PHPMAILER_LANG['execute'] = '无法执行:';
$PHPMAILER_LANG['extension_missing'] = '缺少扩展名:';
$PHPMAILER_LANG['file_access'] = '无法访问文件:';
$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:';
$PHPMAILER_LANG['from_failed'] = '发送地址错误:';
@ -22,8 +24,13 @@ $PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是
$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。';
$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:';
$PHPMAILER_LANG['signing'] = '登录失败:';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。';
$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错';
$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:';
$PHPMAILER_LANG['extension_missing'] = '丢失模块 Extension';
$PHPMAILER_LANG['invalid_header'] = '无效的标题名称或值';
$PHPMAILER_LANG['invalid_hostentry'] = '无效的hostentry ';
$PHPMAILER_LANG['invalid_host'] = '无效的主机:';
$PHPMAILER_LANG['signing'] = '签名错误:';
$PHPMAILER_LANG['smtp_code'] = 'SMTP代码 ';
$PHPMAILER_LANG['smtp_code_ex'] = '附加SMTP信息 ';
$PHPMAILER_LANG['smtp_detail'] = '详情:';

View File

@ -27,16 +27,26 @@
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
<exclude name="PSR12.Properties.ConstantVisibility.NotFound"/>
</rule>
<rule ref="PHPCompatibility">
<exclude name="PHPCompatibility.Constants.NewConstants.stream_crypto_method_tlsv1_1_clientFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.stream_crypto_method_tlsv1_2_clientFound"/>
<exclude name="PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003Deprecated"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.random_bytesFound"/>
<exclude name="PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated"/>
<exclude name="PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet"/>
</rule>
<rule ref="PHPCompatibility"/>
<!--
#############################################################################
SELECTIVE EXCLUSIONS
Exclude specific files for specific sniffs and/or exclude sub-groups in sniffs.
#############################################################################
-->
<rule ref="Generic.Files.LineLength.TooLong">
<exclude-pattern>*/language/phpmailer\.lang*\.php$</exclude-pattern>
</rule>
<!-- Excludes related to linting ignore comment for one specific test file. -->
<rule ref="PSR12.Files.OpenTag.NotAlone">
<exclude-pattern>*/test/Fixtures/LocalizationTest/phpmailer.lang-yz\.php</exclude-pattern>
</rule>
<rule ref="PSR12.Files.FileHeader.SpacingAfterBlock">
<exclude-pattern>*/test/Fixtures/LocalizationTest/phpmailer.lang-yz\.php</exclude-pattern>
</rule>
</ruleset>

245
src/DSNConfigurator.php Normal file
View File

@ -0,0 +1,245 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.5.
*
* @see 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 - 2023 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.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.
*/
namespace PHPMailer\PHPMailer;
/**
* Configure PHPMailer with DSN string.
*
* @see https://en.wikipedia.org/wiki/Data_source_name
*
* @author Oleg Voronkovich <oleg-voronkovich@yandex.ru>
*/
class DSNConfigurator
{
/**
* Create new PHPMailer instance configured by DSN.
*
* @param string $dsn DSN
* @param bool $exceptions Should we throw external exceptions?
*
* @return PHPMailer
*/
public static function mailer($dsn, $exceptions = null)
{
static $configurator = null;
if (null === $configurator) {
$configurator = new DSNConfigurator();
}
return $configurator->configure(new PHPMailer($exceptions), $dsn);
}
/**
* Configure PHPMailer instance with DSN string.
*
* @param PHPMailer $mailer PHPMailer instance
* @param string $dsn DSN
*
* @return PHPMailer
*/
public function configure(PHPMailer $mailer, $dsn)
{
$config = $this->parseDSN($dsn);
$this->applyConfig($mailer, $config);
return $mailer;
}
/**
* Parse DSN string.
*
* @param string $dsn DSN
*
* @throws Exception If DSN is malformed
*
* @return array Configuration
*/
private function parseDSN($dsn)
{
$config = $this->parseUrl($dsn);
if (false === $config || !isset($config['scheme']) || !isset($config['host'])) {
throw new Exception('Malformed DSN');
}
if (isset($config['query'])) {
parse_str($config['query'], $config['query']);
}
return $config;
}
/**
* Apply configuration to mailer.
*
* @param PHPMailer $mailer PHPMailer instance
* @param array $config Configuration
*
* @throws Exception If scheme is invalid
*/
private function applyConfig(PHPMailer $mailer, $config)
{
switch ($config['scheme']) {
case 'mail':
$mailer->isMail();
break;
case 'sendmail':
$mailer->isSendmail();
break;
case 'qmail':
$mailer->isQmail();
break;
case 'smtp':
case 'smtps':
$mailer->isSMTP();
$this->configureSMTP($mailer, $config);
break;
default:
throw new Exception(
sprintf(
'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".',
$config['scheme']
)
);
}
if (isset($config['query'])) {
$this->configureOptions($mailer, $config['query']);
}
}
/**
* Configure SMTP.
*
* @param PHPMailer $mailer PHPMailer instance
* @param array $config Configuration
*/
private function configureSMTP($mailer, $config)
{
$isSMTPS = 'smtps' === $config['scheme'];
if ($isSMTPS) {
$mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
}
$mailer->Host = $config['host'];
if (isset($config['port'])) {
$mailer->Port = $config['port'];
} elseif ($isSMTPS) {
$mailer->Port = SMTP::DEFAULT_SECURE_PORT;
}
$mailer->SMTPAuth = isset($config['user']) || isset($config['pass']);
if (isset($config['user'])) {
$mailer->Username = $config['user'];
}
if (isset($config['pass'])) {
$mailer->Password = $config['pass'];
}
}
/**
* Configure options.
*
* @param PHPMailer $mailer PHPMailer instance
* @param array $options Options
*
* @throws Exception If option is unknown
*/
private function configureOptions(PHPMailer $mailer, $options)
{
$allowedOptions = get_object_vars($mailer);
unset($allowedOptions['Mailer']);
unset($allowedOptions['SMTPAuth']);
unset($allowedOptions['Username']);
unset($allowedOptions['Password']);
unset($allowedOptions['Hostname']);
unset($allowedOptions['Port']);
unset($allowedOptions['ErrorInfo']);
$allowedOptions = \array_keys($allowedOptions);
foreach ($options as $key => $value) {
if (!in_array($key, $allowedOptions)) {
throw new Exception(
sprintf(
'Unknown option: "%s". Allowed values: "%s"',
$key,
implode('", "', $allowedOptions)
)
);
}
switch ($key) {
case 'AllowEmpty':
case 'SMTPAutoTLS':
case 'SMTPKeepAlive':
case 'SingleTo':
case 'UseSendmailOptions':
case 'do_verp':
case 'DKIM_copyHeaderFields':
$mailer->$key = (bool) $value;
break;
case 'Priority':
case 'SMTPDebug':
case 'WordWrap':
$mailer->$key = (int) $value;
break;
default:
$mailer->$key = $value;
break;
}
}
}
/**
* Parse a URL.
* Wrapper for the built-in parse_url function to work around a bug in PHP 5.5.
*
* @param string $url URL
*
* @return array|false
*/
protected function parseUrl($url)
{
if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) {
return parse_url($url);
}
$chunks = explode('?', $url);
if (is_array($chunks)) {
$result = parse_url($chunks[0]);
if (is_array($result)) {
$result['query'] = $chunks[1];
}
return $result;
}
return false;
}
}

View File

@ -13,7 +13,7 @@
* @copyright 2012 - 2020 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
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.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.

View File

@ -13,7 +13,7 @@
* @copyright 2012 - 2020 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
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.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.
@ -29,7 +29,7 @@ use League\OAuth2\Client\Token\AccessToken;
* OAuth - OAuth2 authentication wrapper class.
* Uses the oauth2-client package from the League of Extraordinary Packages.
*
* @see http://oauth2-client.thephpleague.com
* @see https://oauth2-client.thephpleague.com
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
*/

View File

@ -13,7 +13,7 @@
* @copyright 2012 - 2020 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
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.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.

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
* @copyright 2012 - 2020 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
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.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.
@ -45,8 +45,9 @@ class POP3
* The POP3 PHPMailer Version number.
*
* @var string
* @deprecated This constant will be removed in PHPMailer 8.0. Use `PHPMailer::VERSION` instead.
*/
const VERSION = '6.6.1';
const VERSION = '7.0.2';
/**
* Default POP3 port number.
@ -250,7 +251,9 @@ class POP3
//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([$this, 'catchWarning']);
set_error_handler(function () {
call_user_func_array([$this, 'catchWarning'], func_get_args());
});
if (false === $port) {
$port = static::DEFAULT_PORT;
@ -337,7 +340,12 @@ class POP3
*/
public function disconnect()
{
$this->sendString('QUIT');
// If could not connect at all, no need to disconnect
if ($this->pop_conn === false) {
return;
}
$this->sendString('QUIT' . static::LE);
// RFC 1939 shows POP3 server sending a +OK response to the QUIT command.
// Try to get it. Ignore any failures here.

View File

@ -13,7 +13,7 @@
* @copyright 2012 - 2020 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
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.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.
@ -34,8 +34,9 @@ class SMTP
* The PHPMailer SMTP version number.
*
* @var string
* @deprecated This constant will be removed in PHPMailer 8.0. Use `PHPMailer::VERSION` instead.
*/
const VERSION = '6.6.1';
const VERSION = '7.0.2';
/**
* SMTP line break constant.
@ -51,11 +52,18 @@ class SMTP
*/
const DEFAULT_PORT = 25;
/**
* The SMTPs port to use if one is not specified.
*
* @var int
*/
const DEFAULT_SECURE_PORT = 465;
/**
* The maximum line length allowed by RFC 5321 section 4.5.3.1.6,
* *excluding* a trailing CRLF break.
*
* @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6
* @see https://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.6
*
* @var int
*/
@ -65,7 +73,7 @@ class SMTP
* The maximum line length allowed for replies in RFC 5321 section 4.5.3.1.5,
* *including* a trailing CRLF line break.
*
* @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5
* @see https://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.5
*
* @var int
*/
@ -145,19 +153,28 @@ class SMTP
/**
* Whether to use VERP.
*
* @see http://en.wikipedia.org/wiki/Variable_envelope_return_path
* @see http://www.postfix.org/VERP_README.html Info on VERP
* @see https://en.wikipedia.org/wiki/Variable_envelope_return_path
* @see https://www.postfix.org/VERP_README.html Info on VERP
*
* @var bool
*/
public $do_verp = false;
/**
* Whether to use SMTPUTF8.
*
* @see https://www.rfc-editor.org/rfc/rfc6531
*
* @var bool
*/
public $do_smtputf8 = false;
/**
* The timeout value for connection, in seconds.
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2.
* This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
*
* @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2
* @see https://www.rfc-editor.org/rfc/rfc2821#section-4.5.3.2
*
* @var int
*/
@ -180,14 +197,28 @@ class SMTP
*/
protected $smtp_transaction_id_patterns = [
'exim' => '/[\d]{3} OK id=(.*)/',
'sendmail' => '/[\d]{3} 2.0.0 (.*) Message/',
'postfix' => '/[\d]{3} 2.0.0 Ok: queued as (.*)/',
'Microsoft_ESMTP' => '/[0-9]{3} 2.[\d].0 (.*)@(?:.*) Queued mail for delivery/',
'sendmail' => '/[\d]{3} 2\.0\.0 (.*) Message/',
'postfix' => '/[\d]{3} 2\.0\.0 Ok: queued as (.*)/',
'Microsoft_ESMTP' => '/[0-9]{3} 2\.[\d]\.0 (.*)@(?:.*) Queued mail for delivery/',
'Amazon_SES' => '/[\d]{3} Ok (.*)/',
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
'CampaignMonitor' => '/[\d]{3} 2\.0\.0 OK:([a-zA-Z\d]{48})/',
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
'ZoneMTA' => '/[\d]{3} Message queued as (.*)/',
'Mailjet' => '/[\d]{3} OK queued as (.*)/',
'Gsmtp' => '/[\d]{3} 2\.0\.0 OK (.*) - gsmtp/',
];
/**
* Allowed SMTP XCLIENT attributes.
* Must be allowed by the SMTP server. EHLO response is not checked.
*
* @see https://www.postfix.org/XCLIENT_README.html
*
* @var array
*/
public static $xclient_allowed_attributes = [
'NAME', 'ADDR', 'PORT', 'PROTO', 'HELO', 'LOGIN', 'DESTADDR', 'DESTPORT'
];
/**
@ -260,7 +291,8 @@ class SMTP
}
//Is this a PSR-3 logger?
if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) {
$this->Debugoutput->debug($str);
//Remove trailing line breaks potentially added by calls to SMTP::client_send()
$this->Debugoutput->debug(rtrim($str, "\r\n"));
return;
}
@ -273,6 +305,7 @@ class SMTP
switch ($this->Debugoutput) {
case 'error_log':
//Don't output, just log
/** @noinspection ForgottenDebugOutputInspection */
error_log($str);
break;
case 'html':
@ -351,7 +384,7 @@ class SMTP
}
//Anything other than a 220 response means something went wrong
//RFC 5321 says the server will wait for us to send a QUIT in response to a 554 error
//https://tools.ietf.org/html/rfc5321#section-3.1
//https://www.rfc-editor.org/rfc/rfc5321#section-3.1
if ($responseCode === 554) {
$this->quit();
}
@ -384,7 +417,9 @@ class SMTP
$errstr = '';
if ($streamok) {
$socket_context = stream_context_create($options);
set_error_handler([$this, 'errorHandler']);
set_error_handler(function () {
call_user_func_array([$this, 'errorHandler'], func_get_args());
});
$connection = stream_socket_client(
$host . ':' . $port,
$errno,
@ -399,7 +434,9 @@ class SMTP
'Connection: stream_socket_client not available, falling back to fsockopen',
self::DEBUG_CONNECTION
);
set_error_handler([$this, 'errorHandler']);
set_error_handler(function () {
call_user_func_array([$this, 'errorHandler'], func_get_args());
});
$connection = fsockopen(
$host,
$port,
@ -458,12 +495,16 @@ class SMTP
//PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
//so add them back in manually if we can
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
// phpcs:ignore PHPCompatibility.Constants.NewConstants.stream_crypto_method_tlsv1_2_clientFound
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
// phpcs:ignore PHPCompatibility.Constants.NewConstants.stream_crypto_method_tlsv1_1_clientFound
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
}
//Begin encrypted connection
set_error_handler([$this, 'errorHandler']);
set_error_handler(function () {
call_user_func_array([$this, 'errorHandler'], func_get_args());
});
$crypto_ok = stream_socket_enable_crypto(
$this->smtp_conn,
true,
@ -554,7 +595,7 @@ class SMTP
}
//Send encoded username and password
if (
//Format from https://tools.ietf.org/html/rfc4616#section-2
//Format from https://www.rfc-editor.org/rfc/rfc4616#section-2
//We skip the first field (it's forgery), so the string starts with a null byte
!$this->sendCommand(
'User & Password',
@ -595,11 +636,48 @@ class SMTP
if (null === $OAuth) {
return false;
}
$oauth = $OAuth->getOauth64();
//Start authentication
if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
return false;
try {
$oauth = $OAuth->getOauth64();
} catch (\Exception $e) {
// We catch all exceptions and convert them to PHPMailer exceptions to be able to
// handle them correctly later
throw new Exception("SMTP authentication error", 0, $e);
}
/*
* An SMTP command line can have a maximum length of 512 bytes, including the command name,
* so the base64-encoded OAUTH token has a maximum length of:
* 512 - 13 (AUTH XOAUTH2) - 2 (CRLF) = 497 bytes
* If the token is longer than that, the command and the token must be sent separately as described in
* https://www.rfc-editor.org/rfc/rfc4954#section-4
*/
if ($oauth === '') {
//Sending an empty auth token is legitimate, but it must be encoded as '='
//to indicate it's not a 2-part command
if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 =', 235)) {
return false;
}
} elseif (strlen($oauth) <= 497) {
//Authenticate using a token in the initial-response part
if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
return false;
}
} else {
//The token is too long, so we need to send it in two parts.
//Send the auth command without a token and expect a 334
if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2', 334)) {
return false;
}
//Send the token
if (!$this->sendCommand('OAuth TOKEN', $oauth, [235, 334])) {
return false;
}
//If the server answers with 334, send an empty line and wait for a 235
if (
substr($this->last_reply, 0, 3) === '334'
&& $this->sendCommand('AUTH End', '', 235)
) {
return false;
}
}
break;
default:
@ -628,7 +706,7 @@ class SMTP
}
//The following borrowed from
//http://php.net/manual/en/function.mhash.php#27225
//https://www.php.net/manual/en/function.mhash.php#27225
//RFC 2104 HMAC implementation for php.
//Creates an md5 HMAC.
@ -682,7 +760,6 @@ class SMTP
*/
public function close()
{
$this->setError('');
$this->server_caps = null;
$this->helo_rply = null;
if (is_resource($this->smtp_conn)) {
@ -693,11 +770,30 @@ class SMTP
}
}
private function iterateLines($s)
{
$start = 0;
$length = strlen($s);
for ($i = 0; $i < $length; $i++) {
$c = $s[$i];
if ($c === "\n" || $c === "\r") {
yield substr($s, $start, $i - $start);
if ($c === "\r" && $i + 1 < $length && $s[$i + 1] === "\n") {
$i++;
}
$start = $i + 1;
}
}
yield substr($s, $start);
}
/**
* Send an SMTP DATA command.
* Issues a data command and sends the msg_data to the server,
* finalizing the mail transaction. $msg_data is the message
* that is to be send with the headers. Each header needs to be
* that is to be sent with the headers. Each header needs to be
* on a single line followed by a <CRLF> with the message headers
* and the message body being separated by an additional <CRLF>.
* Implements RFC 821: DATA <CRLF>.
@ -721,15 +817,16 @@ class SMTP
* NOTE: this does not count towards line-length limit.
*/
//Normalize line breaks before exploding
$lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data));
//Iterate over lines with normalized line breaks
$lines = $this->iterateLines($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
* of the first line (':' separated) does not contain a space then it _should_ be a header, and we will
* process all lines before a blank line as headers.
*/
$field = substr($lines[0], 0, strpos($lines[0], ':'));
$first_line = $lines->current();
$field = substr($first_line, 0, strpos($first_line, ':'));
$in_headers = false;
if (!empty($field) && strpos($field, ' ') === false) {
$in_headers = true;
@ -768,7 +865,7 @@ class SMTP
//Send the lines to the server
foreach ($lines_out as $line_out) {
//Dot-stuffing as per RFC5321 section 4.5.2
//https://tools.ietf.org/html/rfc5321#section-4.5.2
//https://www.rfc-editor.org/rfc/rfc5321#section-4.5.2
if (!empty($line_out) && $line_out[0] === '.') {
$line_out = '.' . $line_out;
}
@ -886,7 +983,15 @@ class SMTP
* $from. Returns true if successful or false otherwise. If True
* the mail transaction is started and then one or more recipient
* commands may be called followed by a data command.
* Implements RFC 821: MAIL <SP> FROM:<reverse-path> <CRLF>.
* Implements RFC 821: MAIL <SP> FROM:<reverse-path> <CRLF> and
* two extensions, namely XVERP and SMTPUTF8.
*
* The server's EHLO response is not checked. If use of either
* extensions is enabled even though the server does not support
* that, mail submission will fail.
*
* XVERP is documented at https://www.postfix.org/VERP_README.html
* and SMTPUTF8 is specified in RFC 6531.
*
* @param string $from Source address of this message
*
@ -895,10 +1000,11 @@ class SMTP
public function mail($from)
{
$useVerp = ($this->do_verp ? ' XVERP' : '');
$useSmtputf8 = ($this->do_smtputf8 ? ' SMTPUTF8' : '');
return $this->sendCommand(
'MAIL FROM',
'MAIL FROM:<' . $from . '>' . $useVerp,
'MAIL FROM:<' . $from . '>' . $useSmtputf8 . $useVerp,
250
);
}
@ -964,6 +1070,25 @@ class SMTP
);
}
/**
* Send SMTP XCLIENT command to server and check its return code.
*
* @return bool True on success
*/
public function xclient(array $vars)
{
$xclient_options = "";
foreach ($vars as $key => $value) {
if (in_array($key, SMTP::$xclient_allowed_attributes)) {
$xclient_options .= " {$key}={$value}";
}
}
if (!$xclient_options) {
return true;
}
return $this->sendCommand('XCLIENT', 'XCLIENT' . $xclient_options, 250);
}
/**
* Send an SMTP RSET command.
* Abort any transaction that is currently in progress.
@ -1124,7 +1249,9 @@ class SMTP
} else {
$this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);
}
set_error_handler([$this, 'errorHandler']);
set_error_handler(function () {
call_user_func_array([$this, 'errorHandler'], func_get_args());
});
$result = fwrite($this->smtp_conn, $data);
restore_error_handler();
@ -1227,7 +1354,9 @@ class SMTP
while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
//Must pass vars in here as params are by reference
//solution for signals inspired by https://github.com/symfony/symfony/pull/6540
set_error_handler([$this, 'errorHandler']);
set_error_handler(function () {
call_user_func_array([$this, 'errorHandler'], func_get_args());
});
$n = stream_select($selR, $selW, $selW, $this->Timelimit);
restore_error_handler();
@ -1241,7 +1370,16 @@ class SMTP
//stream_select returns false when the `select` system call is interrupted
//by an incoming signal, try the select again
if (stripos($message, 'interrupted system call') !== false) {
if (
stripos($message, 'interrupted system call') !== false ||
(
// on applications with a different locale than english, the message above 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).
defined('SOCKET_EINTR') &&
stripos($message, 'stream_select(): Unable to select [' . SOCKET_EINTR . ']') !== false
)
) {
$this->edebug(
'SMTP -> get_lines(): retrying stream_select',
self::DEBUG_LOWLEVEL
@ -1314,6 +1452,26 @@ class SMTP
return $this->do_verp;
}
/**
* Enable or disable use of SMTPUTF8.
*
* @param bool $enabled
*/
public function setSMTPUTF8($enabled = false)
{
$this->do_smtputf8 = $enabled;
}
/**
* Get SMTPUTF8 use.
*
* @return bool
*/
public function getSMTPUTF8()
{
return $this->do_smtputf8;
}
/**
* Set error messages and codes.
*

View File

@ -11,7 +11,7 @@
* @copyright 2010 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @copyright 2020 Juliette Reinders Folmer
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test;

View File

@ -0,0 +1,31 @@
-----BEGIN CERTIFICATE-----
MIIFazCCA1OgAwIBAgIUPVCD/ME/tR7lrcNY0eLMignHqywwDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNTA5MTExOTI4MDdaFw0zNTA5
MDkxOTI4MDdaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggIiMA0GCSqGSIb3DQEB
AQUAA4ICDwAwggIKAoICAQDHDtSUM73CqVfUt5hhBIbz56ENE746CqgqCqYpKypQ
frCDbcaRWagg9JOy4k9BChB4/B8wZilF9vsmfFoIa0H+LmQWQLN1pVx2tuSWI9rw
CdmTm6cXFZCxleOQMFxzmzV53gK9y2YRxAYL/hm6mcWp6Rblv0SqyxBz+GPJLLrr
cVRIgkktEia7ENA56DWpLoi49xYUwnDN3o+PwtrPGEzwsH/25zhEyS1LlcfRM3pY
W9UGX8HtU1LB94dWoVWNvISFvjicCWhVsuNw1Z0tIko499iEQG+zezbmh++n9a2G
bkCaI6dFZL5pHakmKOTYKyZ1sprE4799KDSTd8hlPfHboC4ClWqIiI6ou3kEpJln
sdsNZP5vPHrDgjuW/oE+zsQjmkaJiWaZphpthyYkR32Xu7HPvtQT4MHfkrs/SFE0
43ml8CqrGSa+IjSjI+HXMwsf0mRmEtK7PcqVLhdSWAGjMNPjJ+er/O+PX3ZAWrbl
GzJfYU5LAk1ES/8uKpB+TjAXDL8xyM0+aP0axEeU57SyTNqbVfimrA250KZ+Q3hk
dpTWlTEjCXhxGHXdiJJwFPyanCNstFuKgNHTbmdRTMKIQ+Wmu5EgUSH2GcRZg9oO
t2veQP3EIc9dIxzijUFETWuBqzi80D6rKJJ1KowJE0rdh7owI/SCHNOYgjSN5a0G
XQIDAQABo1MwUTAdBgNVHQ4EFgQUzSwRCSiJnYQsy99FkcsdWzHJjIwwHwYDVR0j
BBgwFoAUzSwRCSiJnYQsy99FkcsdWzHJjIwwDwYDVR0TAQH/BAUwAwEB/zANBgkq
hkiG9w0BAQsFAAOCAgEAVZApbeRypzpwv2d8B/kPcIRcq5Kot0HhTDr9CNvGqU0G
TwQrVyIVAzi0uX+Ki7flj3+bo1br9xR/ocKbnTbEA3ofCxEbf0KGEjiwvB7tAg22
UeFBxdAZG2IJcwwmY779IHKmjmFgrWGbXTirrN2a3i5TYU/nrTp7yY3GFQFujt5q
hQXBnkEvubS3n9ImdA0ByWCgmYiS08v8HGgsgGs9xVe1idkDkD+5I1imCADvUh7I
0ZksoB/XpdHRaqTRF0h6G2EUXznOG7x04uG4tiHkim1W4IkBBVTLxp6iul9n8GAe
QoZadHGaPIeytwl7A986Qo78WIltxZC+SBjJeQJG7/qHt/MvB8dBXZ49zg1SmHeV
ZtBWdtC0LBGcLoImm9m7DCyA9xMqSKSoOqmzXTlWcKQnPi3MeI5dqfWzuvk9LyLg
71hXXF4EnTgZpHw1ZWJBI47jEfsH2G0c7X46HPYjD4XcDCChNG81d0xQpZMbq5J7
jy6PSbE/iGghEOuiF1NpQsrAnlf0UAzA27bUPyX0NFOmQmAejc8b6NqIljSQE/Xm
MOZlE4RpIa63EzzDo1fas8hhUhtz3loYysHN+nmw4N0BRjVenxatJXiunIbsDkzJ
VeBTrddQlqszd0qOlGCpJM0uhHuVDPntHKmFLo7O32aH2TgvYakpp54Xd+4xIqM=
-----END CERTIFICATE-----

View File

@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQDHDtSUM73CqVfU
t5hhBIbz56ENE746CqgqCqYpKypQfrCDbcaRWagg9JOy4k9BChB4/B8wZilF9vsm
fFoIa0H+LmQWQLN1pVx2tuSWI9rwCdmTm6cXFZCxleOQMFxzmzV53gK9y2YRxAYL
/hm6mcWp6Rblv0SqyxBz+GPJLLrrcVRIgkktEia7ENA56DWpLoi49xYUwnDN3o+P
wtrPGEzwsH/25zhEyS1LlcfRM3pYW9UGX8HtU1LB94dWoVWNvISFvjicCWhVsuNw
1Z0tIko499iEQG+zezbmh++n9a2GbkCaI6dFZL5pHakmKOTYKyZ1sprE4799KDST
d8hlPfHboC4ClWqIiI6ou3kEpJlnsdsNZP5vPHrDgjuW/oE+zsQjmkaJiWaZphpt
hyYkR32Xu7HPvtQT4MHfkrs/SFE043ml8CqrGSa+IjSjI+HXMwsf0mRmEtK7PcqV
LhdSWAGjMNPjJ+er/O+PX3ZAWrblGzJfYU5LAk1ES/8uKpB+TjAXDL8xyM0+aP0a
xEeU57SyTNqbVfimrA250KZ+Q3hkdpTWlTEjCXhxGHXdiJJwFPyanCNstFuKgNHT
bmdRTMKIQ+Wmu5EgUSH2GcRZg9oOt2veQP3EIc9dIxzijUFETWuBqzi80D6rKJJ1
KowJE0rdh7owI/SCHNOYgjSN5a0GXQIDAQABAoIB/3KwmMrLBQqjh3eIUMOVWCwv
yRs/xNqsSTfv6szNkhPO6uTO2xnkDnrucCshOYi/w73xhgbc1er54rrJ6xXutpc9
I22u2bdvD1dXCV14Sy0Cf9oMVLl4M2Yedn8dXic9xhHxWKMCDk0uJE3Emg5pivna
0taM3YOKfHBVLSk8HHaLVYRxjLfrPWWKym6S3Fgd96iatJ5Bab0z/oNWQbwQxEPp
bdFUZ5c6Ul66beabQmKmhpallZan64bWl6PSUPjZJYHpl7RPt02pRGI+sdDPcPRh
2N5aQgGnfHpW2D5tzw0leRNWd4oEAbGO5WaXKUNjmUU3IvVOQ4ZZI/HTkiLDDhX3
DATtfJg5aUXxy/MmlEebHrG0onidu3YZPel8Yj6JY0P7j1lSUcGiXvm6zgpNWk3p
wpWD1KFIc8lJdeSsWtGs1f1SEUkzbjZu/TwHMJfVxY2GWqVsHtiTiDitsbgWhxVX
Th8Vd12yq7DfjxhHO0ZkobUDaOPem32FrnjVyWf/ZEDAOLTZpeycXnCQWEqU2R7T
G78e/o1rwdclRo/kElQ5ksRs2y9mKUpwYSAqMZFFMSh6sXSbuydE7FPd0njX9ypS
+3OgeIntFG1RMspltJTMtJgPhExTkB2yf78jUFrtV7wGCZDDkKDkB+aLkGH0eygT
M+doZSJgFy2fvdYxmzMCggEBAPuQzgO6ab7zfGcaHhlbhXpHl9twMQefYGdH/DVx
yS91Ef1ygUsEgAICNIYAX6bvaBBL6akTf9kMbixo8j47KM6o6uR2ogze9z4nnKUk
Xxsj+CIJz6ImlGdDzMziCwB9wK3duwsxovZBWh2oSgKgvU52kgurI+AW0kKFn1rH
axwlVHoCG+XhiwlUZGD4tD8L0qjzWIn+T/0T4kKAEAvTleG/KZNkCRbOS3mycwrM
ouJGGkdapt5Fh/cmnv+lO5wh5QbkYaJS/kpUkYGljy1/s3HTlvDsw955dADeH1+0
+/2nwfK54dgoB8m037AyIqrwKY6dhGDES7cTUZ5AqiAtJ7MCggEBAMqRFV9YbyBg
Ktgni4Q/vXLCqsaZN7JVnKxjiCqbpJ8UZuGv4Ifalq8npwo0634Hfi10p/54TKxy
gJrUKFwYqffovj7N4mYn0YpRSic5WouN93IIt83ugZ12pU1lL2vp/MX5sWqpGvb/
GyWZ8yfKkJY5dW937j38i9iUeDhW+YksK1RNNrz9crUP5H9zk42EE2h/AHItPMvx
lAktAzB4KuvIrCRMedSO6m+bYpq5P89Vbq2Ovl7fwJWvYDAEUUe7hhkrUDDOxHu/
w1zkdf62YVZ0BAfY1uGEAPr+pJE9Uyy1lW5C0qLRZrOiEXDd7i9Q9rIyZwPBD76+
csaWPGYkEa8CggEBAN3zjrBfYjklXlchBflddFDEpcjoHXoaNdYp/u2wbM7APZUd
19E2MTKUe37XCY2hoHDwaUHRgHUhsHriRQh+7awYANZ9jNBKUF24WU6i3n51p9Fw
Uo8/9qN9gE4sCYTvbnZ4MTTZIGygkD+mYVYcN6nol0ZQQqDNwckLV+OiGnCExxm2
jqKt8hvTJ5UfGPifF8gUm8N0a2JgjroZfw7QKWc5YBc4pYRHkvPWbAXVMsjtDPZz
ltJ5ClMW8iWfxQ4mIYmJKlMrYkx2fMKkLcT47Hu7MWtzmgTJp320fH3WkpXj0wyy
z/4Eo4plWQ59zXR/3EqF02wFBMCL/PDhILiu3l0CggEADdmnrXI9fug0Zb0mc+9r
w6n9xUB6p23lHYBcshUcR2g8tJey8XcHsIg0iqUdqOtYPEFqryKIk43srylsbQee
r32xbFflb/ivAhcWy+HHCB232oswDhuNrzeKi+UsPeOszdiJwfI4DsVYlNSW5JSc
GDlrhyibGI/o+/EC209PFor3l3cEFB38NtcUV4aOgzGRpiZw4F2pd4RYC9yRCEJf
JOn+oyi7d8Yhz2m/bzbVXxbHT4SgDZqc718jY4UYDaCLxbLJc9zfYFq3P+W7D6Rm
uWOLVwIDhz3gV0kL9YZM5pSv1+8nucw5inS9Xos+GuwdQgfiNUaBDhi1flCNZqp2
rwKCAQA6mdcJJJxo7LAAKXKxxWOiTm3rX+6Q0s56/N61cxl1PRGktqKACSXOrizj
DhcKYAVW8taffpEHHWbTTMvB7ypU4b8yTmF9jZlexH9hgM3tGcY+bou44nDiHtsc
ilDjEQgPBagR0LJKz3LOjt3lPQBAxaBydtlPSfBp2YqIwJSl6m3hDt7Q5bCiMh2O
KWHX09Oj4wg/Q82MA4T/t2qOqC5AzJE4diHRHGm1ey+NiXfPY9YdeoeX5CqkfvB+
HNAVmWbSXoNt6Unp1WjLZTaNcBm4+XE7sxM4eDy4ATLEXHIFiCs7Q+axtvILDeSo
ujKpHkhiv0V4kA8yZpxQDcXp84JE
-----END PRIVATE KEY-----

View File

@ -12,6 +12,5 @@ echo $composer;
$PHPMAILER_LANG['extension_missing'] = 'Confirming that test fixture was loaded correctly (yy).';
$PHPMAILER_LANG['empty_message'] = $composer;
$PHPMAILER_LANG['encoding'] = `ls -l`;
$PHPMAILER_LANG['execute'] = exec('some harmful command');
$PHPMAILER_LANG['signing'] = "Double quoted but not interpolated $composer";

View File

@ -0,0 +1,16 @@
<?php // lint < 8.5.
/**
* Test fixture.
*
* Used in the `PHPMailer\LocalizationTest` to test that arbitrary code in translation files is disregarded.
*
* Note: this test fixture uses a syntax (backticks) which has been deprecated in PHP 8.5 and
* is slated for removal in PHP 9.0.
* For that reason, the file is excluded from the linting check on PHP 8.5 and above.
*
* @phpcs:disable PHPCompatibility.LanguageConstructs.RemovedLanguageConstructs.t_backtickDeprecated
*/
$PHPMAILER_LANG['extension_missing'] = 'Confirming that test fixture was loaded correctly (yz).';
$PHPMAILER_LANG['encoding'] = `ls -l`;

View File

@ -9,7 +9,7 @@
* @author Andy Prevost
* @copyright 2010 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\Language;

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\OAuth;
@ -36,7 +36,7 @@ final class OAuthTest extends TestCase
$PHPMailer = new PHPMailer(true);
$reflection = new \ReflectionClass($PHPMailer);
$property = $reflection->getProperty('oauth');
$property->setAccessible(true);
(\PHP_VERSION_ID < 80100) && $property->setAccessible(true);
$property->setValue($PHPMailer, true);
self::assertTrue($PHPMailer->getOAuth(), 'Initial value of oauth property is not true');

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -0,0 +1,70 @@
<?php
/**
* PHPMailer - PHP email transport unit tests.
* PHP version 5.5.
*
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
use PHPMailer\Test\TestCase;
/**
* Test address formatting.
*
* @covers \PHPMailer\PHPMailer\PHPMailer::addrFormat
*/
final class AddrFormatTest extends TestCase
{
/**
* Test formatting an address for use in a message header
*
* @dataProvider dataAddrFormat
*
* @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name
* @param string $expected The expected function output.
*/
public function testAddrFormat($addr, $expected)
{
$actual = $this->Mail->addrFormat($addr);
self::assertSame(
$expected,
$actual,
'The return value from addrFormat() did not match the expected output.'
);
}
/**
* Data provider.
*
* @return array
*/
public function dataAddrFormat()
{
return [
// Test cases with valid addresses.
'Valid address: address with empty string name' => [
'addr' => ['joe@example.com', ''],
'expected' => 'joe@example.com',
],
'Valid address: address with null name' => [
'addr' => ['joe@example.com', null],
'expected' => 'joe@example.com',
],
'Valid address: address with falsy name' => [
'addr' => ['joe@example.com', '0'],
'expected' => '0 <joe@example.com>',
],
'Valid address: address with truthy name' => [
'addr' => ['joe@example.com', 'Joe'],
'expected' => 'Joe <joe@example.com>',
]
];
}
}

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -190,6 +190,48 @@ final class CustomHeaderTest extends TestCase
];
}
/**
* Test removing previously set custom header.
*
* @covers \PHPMailer\PHPMailer\PHPMailer::clearCustomHeader
*/
public function testClearCustomHeader()
{
// make sure 'foo' is cleared, even if there is more than one header set.
$this->Mail->addCustomHeader('foo', 'bar');
$this->Mail->addCustomHeader('foo', 'baz');
self::assertSame([['foo', 'bar'], ['foo', 'baz']], $this->Mail->getCustomHeaders());
$this->Mail->clearCustomHeader('foo');
$cleared = $this->Mail->getCustomHeaders();
self::assertIsArray($cleared);
self::assertEmpty($cleared);
}
/**
* Test removing previously set custom header value.
*
* @covers \PHPMailer\PHPMailer\PHPMailer::clearCustomHeader
*/
public function testClearCustomHeaderValue()
{
// Test clearing 'name', 'value'
$this->Mail->addCustomHeader('foo', 'bar');
$this->Mail->addCustomHeader('foo', 'baz');
self::assertSame([['foo', 'bar'], ['foo', 'baz']], $this->Mail->getCustomHeaders());
$this->Mail->clearCustomHeader('foo', 'bar');
self::assertSame([['foo', 'baz']], array_values($this->Mail->getCustomHeaders()));
// Test clearing 'name: value'
$this->Mail->addCustomHeader('foo', 'bar');
self::assertSame([['foo', 'baz'], ['foo', 'bar']], array_values($this->Mail->getCustomHeaders()));
$this->Mail->clearCustomHeader('foo: bar');
self::assertSame([['foo', 'baz']], array_values($this->Mail->getCustomHeaders()));
}
/**
* Test removing previously set custom headers.
*
@ -222,4 +264,22 @@ final class CustomHeaderTest extends TestCase
$mail = new PHPMailer(true);
$mail->addCustomHeader('SomeHeader', "Some\n Value");
}
/**
* Test replacing a previously set custom header.
*
* @covers \PHPMailer\PHPMailer\PHPMailer::replaceCustomHeader
*/
public function testReplaceCustomHeader()
{
$this->Mail->addCustomHeader('foo', 'bar');
$this->Mail->replaceCustomHeader('foo', 'baz');
// Test retrieving the custom header(s) and verify the updated value is seet.
self::assertSame(
[['foo', 'baz']],
$this->Mail->getCustomHeaders(),
'Custom header does not contain expected update'
);
}
}

View File

@ -8,13 +8,12 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
use Exception;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\Test\SendTestCase;
/**
@ -48,35 +47,48 @@ final class DKIMTest extends SendTestCase
/**
* DKIM body canonicalization tests.
*
* @link https://tools.ietf.org/html/rfc6376#section-3.4.4
* @link https://www.rfc-editor.org/rfc/rfc6376.html#section-3.4.4
*
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_BodyC
*/
public function testDKIMBodyCanonicalization()
{
// Example from https://tools.ietf.org/html/rfc6376#section-3.4.5.
// Example from https://www.rfc-editor.org/rfc/rfc6376.html#section-3.4.5.
$prebody = " C \r\nD \t E\r\n\r\n\r\n";
$postbody = " C \r\nD \t E\r\n";
self::assertSame("\r\n", $this->Mail->DKIM_BodyC(''), 'DKIM empty body canonicalization incorrect');
self::assertSame(
"\r\n",
$this->Mail->DKIM_BodyC(''),
'DKIM empty body canonicalization incorrect (Empty body)'
);
self::assertSame(
'frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY=',
base64_encode(hash('sha256', $this->Mail->DKIM_BodyC(''), true)),
'DKIM canonicalized empty body hash mismatch'
);
self::assertSame($postbody, $this->Mail->DKIM_BodyC($prebody), 'DKIM body canonicalization incorrect');
//Ensure that non-break trailing whitespace in the body is preserved
$prebody = " C \r\nD \t E \r\n\r\n\r\n";
$postbody = " C \r\nD \t E \r\n";
self::assertSame(
$postbody,
$this->Mail->DKIM_BodyC($prebody),
'DKIM body canonicalization incorrect (trailing WSP)'
);
}
/**
* DKIM header canonicalization tests.
*
* @link https://tools.ietf.org/html/rfc6376#section-3.4.2
* @link https://www.rfc-editor.org/rfc/rfc6376.html#section-3.4.2
*
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_HeaderC
*/
public function testDKIMHeaderCanonicalization()
{
// Example from https://tools.ietf.org/html/rfc6376#section-3.4.5.
// Example from https://www.rfc-editor.org/rfc/rfc6376.html#section-3.4.5.
$preheaders = "A: X\r\nB : Y\t\r\n\tZ \r\n";
$postheaders = "a:X\r\nb:Y Z\r\n";
self::assertSame(
@ -103,7 +115,7 @@ final class DKIMTest extends SendTestCase
/**
* DKIM copied header fields tests.
*
* @link https://tools.ietf.org/html/rfc6376#section-3.5
* @link https://www.rfc-editor.org/rfc/rfc6376.html#section-3.5
*
* @requires extension openssl
*
@ -122,7 +134,7 @@ final class DKIMTest extends SendTestCase
openssl_pkey_export_to_file($pk, self::PRIVATE_KEY_FILE);
$this->Mail->DKIM_private = self::PRIVATE_KEY_FILE;
// Example from https://tools.ietf.org/html/rfc6376#section-3.5.
// Example from https://www.rfc-editor.org/rfc/rfc6376.html#section-3.5.
$from = 'from@example.com';
$to = 'to@example.com';
$date = 'date';
@ -166,7 +178,7 @@ final class DKIMTest extends SendTestCase
openssl_pkey_export_to_file($pk, self::PRIVATE_KEY_FILE);
$this->Mail->DKIM_private = self::PRIVATE_KEY_FILE;
// Example from https://tools.ietf.org/html/rfc6376#section-3.5.
// Example from https://www.rfc-editor.org/rfc/rfc6376.html#section-3.5.
$from = 'from@example.com';
$to = 'to@example.com';
$date = 'date';
@ -227,21 +239,6 @@ final class DKIMTest extends SendTestCase
self::assertTrue($this->Mail->send(), 'DKIM signed mail via mail() failed');
}
/**
* Verify behaviour of the DKIM_Sign method when Open SSL is not available.
*
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Sign
*/
public function testDKIMSignOpenSSLNotAvailable()
{
if (extension_loaded('openssl')) {
$this->markTestSkipped('Test requires OpenSSL *not* to be available');
}
$signature = $this->Mail->DKIM_Sign('foo');
self::assertSame('', $signature);
}
/**
* Verify behaviour of the DKIM_Sign method when Open SSL is not available and exceptions is enabled.
*
@ -250,7 +247,7 @@ final class DKIMTest extends SendTestCase
public function testDKIMSignOpenSSLNotAvailableException()
{
if (extension_loaded('openssl')) {
$this->markTestSkipped('Test requires OpenSSL *not* to be available');
self::markTestSkipped('Test requires OpenSSL *not* to be available');
}
$this->expectException(Exception::class);

View File

@ -0,0 +1,46 @@
<?php
/**
* PHPMailer - PHP email transport unit tests.
* PHP version 5.5.
*
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
use PHPMailer\Test\TestCase;
/**
* Test DKIM signing functionality.
*
* @group dkim
*/
final class DKIMWithoutExceptionsTest extends TestCase
{
/**
* Whether or not to initialize the PHPMailer object to throw exceptions.
*
* @var bool|null
*/
const USE_EXCEPTIONS = false;
/**
* Verify behaviour of the DKIM_Sign method when Open SSL is not available and exceptions is disabled.
*
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Sign
*/
public function testDKIMSignOpenSSLNotAvailable()
{
if (extension_loaded('openssl')) {
self::markTestSkipped('Test requires OpenSSL *not* to be available');
}
$signature = $this->Mail->DKIM_Sign('foo');
self::assertSame('', $signature);
}
}

View File

@ -0,0 +1,221 @@
<?php
/**
* PHPMailer - PHP email transport unit tests.
* PHP version 5.5.
*
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
use PHPMailer\PHPMailer\DSNConfigurator;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\Test\TestCase;
/**
* Test configuring with DSN.
*
* @covers \PHPMailer\PHPMailer\DSNConfigurator
*/
final class DSNConfiguratorTest extends TestCase
{
/**
* Test throwing exception if DSN is invalid.
*/
public function testInvalidDSN()
{
$configurator = new DSNConfigurator();
$this->expectException(Exception::class);
$this->expectExceptionMessage('Malformed DSN');
$configurator->configure($this->Mail, 'localhost');
}
/**
* Test throwing exception if DSN scheme is invalid.
*/
public function testInvalidScheme()
{
$configurator = new DSNConfigurator();
$this->expectException(Exception::class);
$this->expectExceptionMessage('Invalid scheme: "ftp".');
$configurator->configure($this->Mail, 'ftp://localhost');
}
/**
* Test cofiguring mail.
*/
public function testConfigureMail()
{
$configurator = new DSNConfigurator();
$configurator->configure($this->Mail, 'mail://localhost');
self::assertEquals($this->Mail->Mailer, 'mail');
}
/**
* Test cofiguring sendmail.
*/
public function testConfigureSendmail()
{
$configurator = new DSNConfigurator();
$configurator->configure($this->Mail, 'sendmail://localhost');
self::assertEquals($this->Mail->Mailer, 'sendmail');
}
/**
* Test cofiguring qmail.
*/
public function testConfigureQmail()
{
$configurator = new DSNConfigurator();
$configurator->configure($this->Mail, 'qmail://localhost');
self::assertEquals($this->Mail->Mailer, 'qmail');
}
/**
* Test cofiguring SMTP without authentication.
*/
public function testConfigureSmtpWithoutAuthentication()
{
$configurator = new DSNConfigurator();
$configurator->configure($this->Mail, 'smtp://localhost');
self::assertEquals($this->Mail->Mailer, 'smtp');
self::assertEquals($this->Mail->Host, 'localhost');
self::assertFalse($this->Mail->SMTPAuth);
}
/**
* Test cofiguring SMTP with authentication.
*/
public function testConfigureSmtpWithAuthentication()
{
$configurator = new DSNConfigurator();
$configurator->configure($this->Mail, 'smtp://user:pass@remotehost');
self::assertEquals($this->Mail->Mailer, 'smtp');
self::assertEquals($this->Mail->Host, 'remotehost');
self::assertTrue($this->Mail->SMTPAuth);
self::assertEquals($this->Mail->Username, 'user');
self::assertEquals($this->Mail->Password, 'pass');
}
/**
* Test cofiguring SMTP without port.
*/
public function testConfigureSmtpWithoutPort()
{
$configurator = new DSNConfigurator();
$configurator->configure($this->Mail, 'smtp://localhost');
self::assertEquals($this->Mail->Mailer, 'smtp');
self::assertEquals($this->Mail->Host, 'localhost');
self::assertEquals($this->Mail->Port, SMTP::DEFAULT_PORT);
}
/**
* Test cofiguring SMTP with port.
*/
public function testConfigureSmtpWitPort()
{
$configurator = new DSNConfigurator();
$configurator->configure($this->Mail, 'smtp://localhost:2525');
self::assertEquals($this->Mail->Mailer, 'smtp');
self::assertEquals($this->Mail->Host, 'localhost');
self::assertEquals($this->Mail->Port, 2525);
}
/**
* Test cofiguring SMTPs without port.
*/
public function testConfigureSmtpsWithoutPort()
{
$configurator = new DSNConfigurator();
$configurator->configure($this->Mail, 'smtps://user:pass@remotehost');
self::assertEquals($this->Mail->Mailer, 'smtp');
self::assertEquals($this->Mail->SMTPSecure, PHPMailer::ENCRYPTION_STARTTLS);
self::assertEquals($this->Mail->Host, 'remotehost');
self::assertEquals($this->Mail->Port, SMTP::DEFAULT_SECURE_PORT);
self::assertTrue($this->Mail->SMTPAuth);
self::assertEquals($this->Mail->Username, 'user');
self::assertEquals($this->Mail->Password, 'pass');
}
/**
* Test cofiguring SMTPs with port.
*/
public function testConfigureWithUnknownOption()
{
$configurator = new DSNConfigurator();
$this->expectException(Exception::class);
$this->expectExceptionMessage('Unknown option: "UnknownOption".');
$configurator->configure($this->Mail, 'mail://locahost?UnknownOption=Value');
}
/**
* Test cofiguring options with query sting.
*/
public function testConfigureWithOptions()
{
$configurator = new DSNConfigurator();
$configurator->configure(
$this->Mail,
'sendmail://localhost?Sendmail=/usr/local/bin/sendmail&AllowEmpty=1&WordWrap=78'
);
self::assertEquals($this->Mail->Mailer, 'sendmail');
self::assertEquals($this->Mail->Sendmail, '/usr/local/bin/sendmail');
self::assertEquals($this->Mail->AllowEmpty, true);
self::assertEquals($this->Mail->WordWrap, 78);
}
/**
* Test shortcut.
*/
public function testShortcut()
{
$mailer = DSNConfigurator::mailer('smtps://user@gmail.com:secret@smtp.gmail.com?SMTPDebug=3&Timeout=1000');
self::assertEquals($mailer->Mailer, 'smtp');
self::assertEquals($mailer->SMTPSecure, PHPMailer::ENCRYPTION_STARTTLS);
self::assertEquals($mailer->Host, 'smtp.gmail.com');
self::assertEquals($mailer->Port, SMTP::DEFAULT_SECURE_PORT);
self::assertTrue($mailer->SMTPAuth);
self::assertEquals($mailer->Username, 'user@gmail.com');
self::assertEquals($mailer->Password, 'secret');
self::assertEquals($mailer->SMTPDebug, 3);
self::assertEquals($mailer->Timeout, 1000);
}
}

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -39,9 +39,9 @@ final class FileIsAccessibleTest extends TestCase
public function testFileIsAccessible($input, $expected)
{
$reflMethod = new ReflectionMethod(PHPMailer::class, 'fileIsAccessible');
$reflMethod->setAccessible(true);
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(true);
$result = $reflMethod->invoke(null, $input);
$reflMethod->setAccessible(false);
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(false);
self::assertSame($expected, $result);
}
@ -83,7 +83,7 @@ final class FileIsAccessibleTest extends TestCase
{
if (\DIRECTORY_SEPARATOR === '\\') {
// Windows does not respect chmod permissions.
$this->markTestSkipped('This test requires a non-Windows OS.');
self::markTestSkipped('This test requires a non-Windows OS.');
}
$path = dirname(__DIR__) . '/Fixtures/FileIsAccessibleTest/';
@ -91,9 +91,9 @@ final class FileIsAccessibleTest extends TestCase
chmod($file, octdec('0'));
$reflMethod = new ReflectionMethod(PHPMailer::class, 'fileIsAccessible');
$reflMethod->setAccessible(true);
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(true);
$result = $reflMethod->invoke(null, $file);
$reflMethod->setAccessible(false);
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(false);
// Reset to the default for git files before running assertions.
chmod($file, octdec('644'));

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -49,7 +49,7 @@ final class GenerateIdTest extends PreSendTestCase
self::assertSame(
1,
preg_match(
'`Content-Type: multipart/alternative;\s+boundary="(b[1-3]_[A-Za-z0-9]{32,})"`',
'`Content-Type: multipart/alternative;\s+boundary="(b[1-3]=_[A-Za-z0-9]{32,})"`',
$message,
$matches
),
@ -64,4 +64,12 @@ final class GenerateIdTest extends PreSendTestCase
'No boundaries using the generated ID found in message'
);
}
public function testBoundaries()
{
$boundaries = $this->Mail->getBoundaries();
self::assertMatchesRegularExpression('/b[1-3]=_[A-Za-z0-9]{32,}/', $boundaries[1]);
self::assertMatchesRegularExpression('/b[1-3]=_[A-Za-z0-9]{32,}/', $boundaries[2]);
self::assertMatchesRegularExpression('/b[1-3]=_[A-Za-z0-9]{32,}/', $boundaries[3]);
}
}

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -56,6 +56,46 @@ final class HasLineLongerThanMaxTest extends PreSendTestCase
);
}
/**
* Test constructing a SMIME signed message that contains lines that are too long for RFC compliance.
*
* @covers \PHPMailer\PHPMailer\PHPMailer::hasLineLongerThanMax
*/
public function testLongBodySmime()
{
$oklen = str_repeat(str_repeat('0', PHPMailer::MAX_LINE_LENGTH) . PHPMailer::getLE(), 2);
// Use +2 to ensure line length is over limit - LE may only be 1 char.
$badlen = str_repeat(str_repeat('1', PHPMailer::MAX_LINE_LENGTH + 2) . PHPMailer::getLE(), 2);
$this->Mail->Body = 'This message contains lines that are too long.' .
PHPMailer::getLE() . $oklen . $badlen . $oklen;
self::assertTrue(
PHPMailer::hasLineLongerThanMax($this->Mail->Body),
'Test content does not contain long lines!'
);
$this->Mail->isHTML();
$this->buildBody();
#$this->Mail->AltBody = $this->Mail->Body;
$this->Mail->Encoding = '8bit';
$this->Mail->sign(
__DIR__ . '/../Fixtures/HasLineLongerThanMaxTest/cert.pem',
__DIR__ . '/../Fixtures/HasLineLongerThanMaxTest/key.pem',
null
);
$this->Mail->preSend();
$message = $this->Mail->getSentMIMEMessage();
self::assertFalse(
PHPMailer::hasLineLongerThanMax($message),
'Long line not corrected (Max: ' . (PHPMailer::MAX_LINE_LENGTH + strlen(PHPMailer::getLE())) . ' chars)'
);
self::assertStringContainsString(
'Content-Transfer-Encoding: quoted-printable',
$message,
'Long line did not cause transfer encoding switch.'
);
}
/**
* Test constructing a message that does NOT contain lines that are too long for RFC compliance.
*

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -87,21 +87,21 @@ material is wood',
<body>
<h1>PHPMailer does HTML!</h1>
<p>This is a <strong>test message</strong> written in HTML.<br>
Go to <a href="http://code.google.com/a/apache-extras.org/p/phpmailer/">
http://code.google.com/a/apache-extras.org/p/phpmailer/</a>
Go to <a href="https://github.com/PHPMailer/PHPMailer">
https://github.com/PHPMailer/PHPMailer</a>
for new versions of PHPMailer.</p>
<p>Thank you!</p>
</body>
</html>
EOT
,
// Note: be careful when updating & saving this file. The the trailing space on
// Note: be careful when updating & saving this file. The trailing space on
// the line with "Go to " needs to be preserved!
'expected' => <<<EOT
PHPMailer does HTML!
This is a test message written in HTML.
Go to
http://code.google.com/a/apache-extras.org/p/phpmailer/
https://github.com/PHPMailer/PHPMailer
for new versions of PHPMailer.
Thank you!
EOT
@ -132,14 +132,14 @@ EOT
'HTML with a "less than" sign in the text' => [
'input' => '<p><span style="color: #ff0000; background-color: #000000;">Complex</span> '
. '<span style="font-family: impact,chicago;">text <50% </span> '
. '<a href="http://exempledomain.com/"><em>with</em></a> '
. '<a href="https://example.com/"><em>with</em></a> '
. '<span style="font-size: 36pt;"><strong>tags</strong></span></p>',
'expected' => 'Complex text',
],
'HTML with an encoded "less than" sign in the text' => [
'input' => '<p><span style="color: #ff0000; background-color: #000000;">Complex</span> '
. '<span style="font-family: impact,chicago;">text &lt;50% </span> '
. '<a href="http://exempledomain.com/"><em>with</em></a> '
. '<a href="https://example.com/"><em>with</em></a> '
. '<span style="font-size: 36pt;"><strong>tags</strong></span></p>',
'expected' => 'Complex text <50% with tags',
],

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -35,9 +35,9 @@ final class IsPermittedPathTest extends TestCase
public function testIsPermittedPath($input, $expected)
{
$reflMethod = new ReflectionMethod(PHPMailer::class, 'isPermittedPath');
$reflMethod->setAccessible(true);
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(true);
$result = $reflMethod->invoke(null, $input);
$reflMethod->setAccessible(false);
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(false);
self::assertSame($expected, $result);
}

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -8,13 +8,14 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
use ReflectionMethod;
use PHPMailer\Test\TestCase;
use PHPMailer\PHPMailer\PHPMailer;
/**
* Test localized error message functionality.
@ -262,7 +263,7 @@ final class LocalizationTest extends TestCase
],
'Custom path: not a local/permitted path' => [
'langCode' => 'xx', // Unassigned lang code.
'langPath' => 'http://example.com/files/',
'langPath' => 'https://example.com/files/',
],
'Custom path: path traversal' => [
'langCode' => 'xx', // Unassigned lang code.
@ -305,13 +306,6 @@ final class LocalizationTest extends TestCase
'The "empty_message" translation is not as expected'
);
self::assertArrayHasKey('encoding', $lang, 'The "encoding" translation key was not found');
self::assertSame(
'Unknown encoding: ',
$lang['encoding'],
'The "encoding" translation is not as expected'
);
self::assertArrayHasKey('execute', $lang, 'The "execute" translation key was not found');
self::assertSame(
'Could not execute: ',
@ -327,6 +321,37 @@ final class LocalizationTest extends TestCase
);
}
/**
* Test that arbitrary code in a language file does not get executed.
*/
public function testSetLanguageDoesNotExecuteCodeWithBackticksInLangFile()
{
$result = $this->Mail->setLanguage(
'yz', // Unassigned lang code.
dirname(__DIR__) . '/Fixtures/LocalizationTest/'
);
$lang = $this->Mail->getTranslations();
self::assertTrue($result, 'Setting the language failed. Translations set to: ' . var_export($lang, true));
self::assertIsArray($lang, 'Translations is not an array');
// Verify that the fixture file was loaded.
self::assertArrayHasKey('extension_missing', $lang, 'The "extension_missing" translation key was not found');
self::assertSame(
'Confirming that test fixture was loaded correctly (yz).',
$lang['extension_missing'],
'The "extension_missing" translation is not as expected'
);
// Verify that arbitrary code in a translation file does not get processed.
self::assertArrayHasKey('encoding', $lang, 'The "encoding" translation key was not found');
self::assertSame(
'Unknown encoding: ',
$lang['encoding'],
'The "encoding" translation is not as expected'
);
}
/**
* Test that text strings passed in from a language file for arbitrary keys do not get processed.
*/
@ -419,13 +444,13 @@ final class LocalizationTest extends TestCase
public function testLang($input, $expected, $langCode = null)
{
if (isset($langCode)) {
$this->Mail->setLanguage($langCode);
PHPMailer::setLanguage($langCode);
}
$reflMethod = new ReflectionMethod($this->Mail, 'lang');
$reflMethod->setAccessible(true);
$result = $reflMethod->invoke($this->Mail, $input);
$reflMethod->setAccessible(false);
$reflMethod = new ReflectionMethod(PHPMailer::class, 'lang');
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(true);
$result = $reflMethod->invoke(null, $input);
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(false);
self::assertSame($expected, $result);
}

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -20,6 +20,23 @@ use PHPMailer\Test\SendTestCase;
*/
final class MailTransportTest extends SendTestCase
{
/** @var string */
private $originalSendmailFrom = '';
protected function set_up()
{
parent::set_up();
$from = ini_get('sendmail_from');
$this->originalSendmailFrom = $from === false ? '' : $from;
}
protected function tear_down()
{
ini_set('sendmail_from', $this->originalSendmailFrom);
parent::tear_down();
}
/**
* Test sending using SendMail.
*
@ -65,12 +82,6 @@ final class MailTransportTest extends SendTestCase
*/
public function testMailSend()
{
$sendmail = ini_get('sendmail_path');
// No path in sendmail_path.
if (strpos($sendmail, '/') === false) {
ini_set('sendmail_path', '/usr/sbin/sendmail -t -i ');
}
$this->Mail->Body = 'Sending via mail()';
$this->buildBody();
$this->Mail->Subject = $this->Mail->Subject . ': mail()';
@ -105,4 +116,146 @@ final class MailTransportTest extends SendTestCase
$msg = $this->Mail->getSentMIMEMessage();
self::assertStringNotContainsString("\r\n\r\nMIME-Version:", $msg, 'Incorrect MIME headers');
}
/**
* Test sending using PHP mail() function with Sender address
* and explicit sendmail_from ini set.
* Test running required with:
* php -d sendmail_path="/usr/sbin/sendmail -t -i -frpath@example.org" ./vendor/bin/phpunit
*
* @group sendmailparams
* @covers \PHPMailer\PHPMailer\PHPMailer::isMail
*/
public function testMailSendWithSendmailParams()
{
$sender = 'rpath@example.org';
if (strpos(ini_get('sendmail_path'), $sender) === false) {
self::markTestSkipped('Custom Sendmail php.ini not available');
}
$this->Mail->Body = 'Sending via mail()';
$this->buildBody();
$this->Mail->Subject = $this->Mail->Subject . ': mail()';
$this->Mail->clearAddresses();
$this->setAddress('testmailsend@example.com', 'totest');
ini_set('sendmail_from', $sender);
$this->Mail->createHeader();
$this->Mail->isMail();
self::assertTrue($this->Mail->send(), $this->Mail->ErrorInfo);
}
/**
* Test sending using SendMail with Sender address
* and explicit sendmail_from ini set.
* Test running required with:
* php -d sendmail_path="/usr/sbin/sendmail -t -i -frpath@example.org" ./vendor/bin/phpunit
*
* @group sendmailparams
* @covers \PHPMailer\PHPMailer\PHPMailer::isSendmail
*/
public function testSendmailSendWithSendmailParams()
{
$sender = 'rpath@example.org';
if (strpos(ini_get('sendmail_path'), $sender) === false) {
self::markTestSkipped('Custom Sendmail php.ini not available');
}
$this->Mail->Body = 'Sending via sendmail';
$this->buildBody();
$subject = $this->Mail->Subject;
$this->Mail->Subject = $subject . ': sendmail';
ini_set('sendmail_from', $sender);
$this->Mail->isSendmail();
self::assertTrue($this->Mail->send(), $this->Mail->ErrorInfo);
}
/**
* Test parsing of sendmail path and with certain parameters.
*
* @group sendmailparams
* @covers \PHPMailer\PHPMailer\PHPMailer::parseSendmailPath
* @dataProvider sendmailPathProvider
*
* @param string $sendmailPath The sendmail path to parse.
* @param string $expectedCommand The expected command after parsing.
* @param string $expectedSender The expected Sender (-f parameter) after parsing.
*/
public function testParseSendmailPath($sendmailPath, $expectedCommand, $expectedSender)
{
$mailer = $this->Mail;
$parseSendmailPath = \Closure::bind(
function ($path) {
return $this->{'parseSendmailPath'}($path);
},
$mailer,
\PHPMailer\PHPMailer\PHPMailer::class
);
$command = $parseSendmailPath($sendmailPath);
self::assertSame($expectedCommand, $command, 'Sendmail command not parsed correctly');
self::assertSame($expectedSender, $mailer->Sender, 'Sender property not set correctly');
}
/**
* Data provider for testParseSendmailPath.
*
* @return array{
* 0: string, // The sendmail path to parse.
* 1: string, // The expected command after parsing.
* 2: string // The expected Sender (-f parameter) after parsing.
* }
*/
public function sendmailPathProvider()
{
return [
'path only' => [
'/usr/sbin/sendmail',
'/usr/sbin/sendmail',
''
],
'with i and t' => [
'/usr/sbin/sendmail -i -t',
'/usr/sbin/sendmail',
''
],
'with f concatenated' => [
'/usr/sbin/sendmail -frpath@example.org -i',
'/usr/sbin/sendmail',
'rpath@example.org'
],
'with f separated' => [
'/usr/sbin/sendmail -f rpath@example.org -t',
'/usr/sbin/sendmail',
'rpath@example.org',
],
'with extra flags preserved' => [
'/opt/sendmail -x -y -fuser@example.org',
'/opt/sendmail -x -y',
'user@example.org',
],
"extra flags with values preserved" => [
'/opt/sendmail -X /path/to/logfile -fuser@example.org',
'/opt/sendmail -X /path/to/logfile',
'user@example.org',
],
"extra flags concatenated preserved" => [
'/opt/sendmail -X/path/to/logfile -t -i',
'/opt/sendmail -X/path/to/logfile',
'',
],
"option values with regular parameters" => [
'/opt/sendmail -oi -t',
'/opt/sendmail',
'',
],
];
}
}

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -29,7 +29,7 @@ final class MimeTypesTest extends TestCase
* @dataProvider dataMime_Types
*
* @param string $input Input text string.
* @param string $expected Expected funtion output.
* @param string $expected Expected function output.
*/
public function testMime_Types($input, $expected)
{

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -30,7 +30,7 @@ final class NormalizeBreaksTest extends TestCase
* @dataProvider dataNormalizeBreaks
*
* @param string $input Input text string.
* @param string $expected Expected funtion output.
* @param string $expected Expected function output.
* @param string $breaktype Optional. What kind of line break to use.
*/
public function testNormalizeBreaks($input, $expected, $breaktype = null)

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -253,7 +253,7 @@ EOT;
$PHPMailer = new PHPMailer();
$reflection = new \ReflectionClass($PHPMailer);
$property = $reflection->getProperty('message_type');
$property->setAccessible(true);
(\PHP_VERSION_ID < 80100) && $property->setAccessible(true);
$property->setValue($PHPMailer, 'inline');
self::assertIsString($PHPMailer->createBody());
@ -278,6 +278,8 @@ EOT;
/**
* Send a message containing ISO-8859-1 text.
*
* @requires extension mbstring
*/
public function testHtmlIso8859()
{
@ -472,7 +474,7 @@ EOT;
//Make sure phar paths are rejected
self::assertFalse($this->Mail->addAttachment('phar://pharfile.php', 'pharfile.php'));
//Make sure any path that looks URLish is rejected
self::assertFalse($this->Mail->addAttachment('http://example.com/test.php', 'test.php'));
self::assertFalse($this->Mail->addAttachment('https://example.com/test.php', 'test.php'));
self::assertFalse(
$this->Mail->addAttachment(
'ssh2.sftp://user:pass@attacker-controlled.example.com:22/tmp/payload.phar',
@ -595,6 +597,7 @@ EOT;
*/
public function testEmbeddedImage()
{
$this->Mail->From = '';
$this->Mail->msgHTML('<!DOCTYPE html>
<html lang="en">
<head>
@ -613,6 +616,32 @@ EOT;
);
}
/**
* An embedded attachment test with custom cid domain.
*/
public function testEmbeddedImageCustomCidDomain()
{
$result = $this->Mail->setFrom('test@example.com');
self::assertTrue($result, 'setFrom failed');
$this->Mail->msgHTML('<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>E-Mail Inline Image Test</title>
</head>
<body>
<p><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="></p>
</body>
</html>', '', false);
$this->Mail->preSend();
self::assertStringContainsString(
'Content-ID: <bb229a48bee31f5d54ca12dc9bd960c6@example.com>',
$this->Mail->getSentMIMEMessage(),
'Embedded image header encoding incorrect.'
);
}
/**
* An embedded attachment test.
*/
@ -748,6 +777,11 @@ EOT;
self::assertFalse($this->Mail->addAddress('a@example..com'), 'Invalid address accepted');
self::assertTrue($this->Mail->addAddress('a@example.com'), 'Addressing failed');
self::assertTrue($this->Mail->addAddress('nullname@example.com', null), 'Null name not ignored');
self::assertTrue(
$this->Mail->addAddress('objectname@example.com', new \stdClass()),
'Object as name not ignored'
);
self::assertTrue($this->Mail->addAddress('arrayname@example.com', [1,2,3]), 'Array as name not ignored');
self::assertFalse($this->Mail->addAddress('a@example.com'), 'Duplicate addressing failed');
self::assertTrue($this->Mail->addCC('b@example.com'), 'CC addressing failed');
self::assertFalse($this->Mail->addCC('b@example.com'), 'CC duplicate addressing failed');
@ -800,8 +834,7 @@ EOT;
$this->buildBody();
$this->Mail->preSend();
self::assertMatchesRegularExpression(
"/Content-Transfer-Encoding: 8bit\r\n\r\n" .
'This is a multi-part message in MIME format./',
"/Content-Transfer-Encoding: 8bit\r\n\r\n/",
$this->Mail->getSentMIMEMessage(),
'MIME structure broken'
);
@ -834,6 +867,20 @@ EOT;
$mail->addAttachment(__FILE__, 'test.txt', 'invalidencoding');
}
/**
* Expect errors on trying to attach a folder as an attachment
*/
public function testAddFolderAsAttachment()
{
$mail = new PHPMailer();
self::assertFalse($mail->addAttachment(__DIR__, 'test.txt'));
$this->expectException(Exception::class);
$mail = new PHPMailer(true);
$mail->addAttachment(__DIR__, 'test.txt');
}
/**
* Expect exceptions on sending after deleting a previously successfully attached file
*/
@ -1053,6 +1100,7 @@ EOT;
$this->Mail->isSendmail();
$this->Mail->isQmail();
$this->Mail->Sender = '';
self::assertEmpty($this->Mail->Sender);
$this->Mail->createHeader();
}
@ -1102,12 +1150,13 @@ EOT;
public function testConvertEncoding()
{
if (!PHPMailer::idnSupported()) {
self::markTestSkipped('intl and/or mbstring extensions are not available');
self::markTestSkipped('Both intl and mbstring extensions are required.');
}
$this->Mail->clearAllRecipients();
//This file is UTF-8 encoded. Create a domain encoded in "iso-8859-1".
//This file is UTF-8 encoded so we have to take a roundabout route
//to make a domain using an ISO-8859-1 character.
$letter = html_entity_decode('&ccedil;', ENT_COMPAT, PHPMailer::CHARSET_ISO88591);
$domain = '@' . 'fran' . $letter . 'ois.ch';
$this->Mail->addAddress('test' . $domain);
@ -1146,7 +1195,7 @@ EOT;
public function testDuplicateIDNRemoved()
{
if (!PHPMailer::idnSupported()) {
self::markTestSkipped('intl and/or mbstring extensions are not available');
self::markTestSkipped('Both intl and mbstring extensions are required.');
}
$this->Mail->clearAllRecipients();
@ -1172,6 +1221,119 @@ EOT;
);
}
/**
* Test that validation doesn't accidentally succeed.
*/
public function testUnsupportedSmtpUTF8()
{
self::assertFalse(PHPMailer::validateAddress('spın̈altap@example.com', 'html5'));
self::assertTrue(PHPMailer::validateAddress('spın̈altap@example.com', 'eai'));
}
/**
* The eai regex is complex and warrants a few extra tests.
*/
public function testStrangeUnicodeEmailAddresses()
{
PHPMailer::$validator = 'eai';
self::assertTrue(PHPMailer::validateAddress('spın̈altap@example.com'));
self::assertTrue(PHPMailer::validateAddress('spın̈altap@spın̈altap.com'));
self::assertTrue(PHPMailer::validateAddress('दूकान@मेरी.दूकान.भारत'));
self::assertTrue(PHPMailer::validateAddress('慕田峪长城@慕田峪长城.网址'));
self::assertFalse(PHPMailer::validateAddress('慕田峪长城@慕田峪长城。网址'));
}
/**
* Test that SMTPUTF8 is allowed unless the caller has made a conscious choice against it.
*/
public function testAutomaticEaiValidation()
{
$this->Mail = new PHPMailer(true);
PHPMailer::$validator = 'php';
$this->Mail->Body = 'Test';
$this->Mail->isSMTP();
self::assertTrue($this->Mail->addAddress('spın̈altap@example.com', ''));
$this->Mail->preSend();
self::assertTrue($this->Mail->needsSMTPUTF8());
}
/**
* Test SMTPUTF8 usage, including when it is not to be used.
*/
public function testSmtpUTF8()
{
PHPMailer::$validator = 'php';
$this->Mail = new PHPMailer(true);
$this->Mail->Body = 'Test';
$this->Mail->isSMTP();
$this->Mail->addAddress('foo@example.com', '');
$this->Mail->preSend();
self::assertFalse($this->Mail->needsSMTPUTF8());
//Beyond this point we need UTF-8 support
if (!PHPMailer::idnSupported()) {
self::markTestSkipped('Both intl and mbstring extensions are required.');
}
//Using a punycodable domain does not need SMTPUTF8
self::assertFalse($this->Mail->needsSMTPUTF8());
$this->Mail->addAddress('foo@spın̈altap.example', '');
$this->Mail->preSend();
self::assertFalse($this->Mail->needsSMTPUTF8());
//Need to use SMTPUTF8, and can.
self::assertTrue($this->Mail->addAddress('spın̈altap@example.com', ''));
$this->Mail->preSend();
self::assertTrue($this->Mail->needsSMTPUTF8());
//If using SMTPUTF8, then the To header should contain
//Unicode@Unicode, for better rendering by clients like Mac
//Outlook.
$this->Mail->addAddress('spın̈altap@spın̈altap.invalid', '');
$this->Mail->preSend();
self::assertStringContainsString('spın̈altap@spın̈altap.invalid', $this->Mail->createHeader());
//Sending unencoded UTF8 is legal when SMTPUTF8 is used,
//except that body parts have to be encoded if they
//accidentally contain any lines that match the MIME boundary
//lines. It also looks good, so let's do it.
$this->Mail->Subject = 'Spın̈al Tap';
self::assertStringContainsString('Spın̈al', $this->Mail->createHeader());
$this->Mail->Body = 'Spın̈al Tap';
$this->Mail->preSend();
self::assertStringContainsString('Spın̈al', $this->Mail->createBody());
}
/**
* Test SMTP Xclient options
*/
public function testSmtpXclient()
{
$this->Mail->isSMTP();
$this->Mail->SMTPAuth = false;
$this->Mail->setSMTPXclientAttribute('ADDR', '127.0.0.1');
$this->Mail->setSMTPXclientAttribute('LOGIN', 'user@example.com');
$this->Mail->setSMTPXclientAttribute('HELO', 'test.example.com');
$this->assertFalse($this->Mail->setSMTPXclientAttribute('INVALID', 'value'));
$attributes = $this->Mail->getSMTPXclientAttributes();
$this->assertEquals('test.example.com', $attributes['HELO']);
// remove attribute
$this->Mail->setSMTPXclientAttribute('HELO', null);
$attributes = $this->Mail->getSMTPXclientAttributes();
$this->assertEquals(['ADDR' => '127.0.0.1', 'LOGIN' => 'user@example.com'], $attributes);
$this->Mail->Subject .= ': Testing XCLIENT';
$this->buildBody();
$this->Mail->clearAllRecipients();
self::assertTrue($this->Mail->addAddress('a@example.com'), 'Addressing failed');
$this->Mail->preSend();
self::assertTrue($this->Mail->send(), 'send failed');
}
/**
* Test SMTP host connections.
* This test can take a long time, so run it last.
@ -1210,13 +1372,12 @@ EOT;
$this->Mail->smtpClose();
}
/**
* @requires extension mbstring
* @requires function idn_to_ascii
*/
public function testGivenIdnAddress_addAddress_returns_true()
{
if (file_exists(\PHPMAILER_INCLUDE_DIR . '/test/fakefunctions.php') === false) {
$this->markTestSkipped('/test/fakefunctions.php file not found');
}
include \PHPMAILER_INCLUDE_DIR . '/test/fakefunctions.php';
$this->assertTrue($this->Mail->addAddress('test@françois.ch'));
}

View File

@ -8,153 +8,20 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
use PHPMailer\PHPMailer\PHPMailer;
use ReflectionMethod;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
/**
* Test RFC822 address splitting.
*
* @todo Additional tests need to be added to verify the correct handling of inputs which
* include a different encoding than UTF8 or even mixed encoding. For more information
* on what these test cases should look like and should test, please see
* {@link https://github.com/PHPMailer/PHPMailer/pull/2449} for context.
*
* @covers \PHPMailer\PHPMailer\PHPMailer::parseAddresses
*/
final class ParseAddressesTest extends TestCase
{
/**
* Test RFC822 address splitting using the PHPMailer native implementation
* with the Mbstring extension available.
*
* @requires extension mbstring
*
* @dataProvider dataAddressSplitting
*
* @param string $addrstr The address list string.
* @param array $expected The expected function output.
* @param string $charset Optional. The charset to use.
*/
public function testAddressSplittingNative($addrstr, $expected, $charset = null)
{
if (isset($charset)) {
$parsed = PHPMailer::parseAddresses($addrstr, false, $charset);
} else {
$parsed = PHPMailer::parseAddresses($addrstr, false);
}
$expectedOutput = $expected['default'];
if (empty($expected['native+mbstring']) === false) {
$expectedOutput = $expected['native+mbstring'];
} elseif (empty($expected['native']) === false) {
$expectedOutput = $expected['native'];
}
$this->verifyExpectations($parsed, $expectedOutput);
}
/**
* Test RFC822 address splitting using the IMAP implementation
* with the Mbstring extension available.
*
* @requires extension imap
* @requires extension mbstring
*
* @dataProvider dataAddressSplitting
*
* @param string $addrstr The address list string.
* @param array $expected The expected function output.
* @param string $charset Optional. The charset to use.
*/
public function testAddressSplittingImap($addrstr, $expected, $charset = null)
{
if (isset($charset)) {
$parsed = PHPMailer::parseAddresses($addrstr, true, $charset);
} else {
$parsed = PHPMailer::parseAddresses($addrstr, true);
}
$expectedOutput = $expected['default'];
if (empty($expected['imap+mbstring']) === false) {
$expectedOutput = $expected['imap+mbstring'];
} elseif (empty($expected['imap']) === false) {
$expectedOutput = $expected['imap'];
}
$this->verifyExpectations($parsed, $expectedOutput);
}
/**
* Test RFC822 address splitting using the PHPMailer native implementation
* without the Mbstring extension.
*
* @dataProvider dataAddressSplitting
*
* @param string $addrstr The address list string.
* @param array $expected The expected function output.
* @param string $charset Optional. The charset to use.
*/
public function testAddressSplittingNativeNoMbstring($addrstr, $expected, $charset = null)
{
if (extension_loaded('mbstring')) {
$this->markTestSkipped('Test requires MbString *not* to be available');
}
if (isset($charset)) {
$parsed = PHPMailer::parseAddresses($addrstr, false, $charset);
} else {
$parsed = PHPMailer::parseAddresses($addrstr, false);
}
$expectedOutput = $expected['default'];
if (empty($expected['native--mbstring']) === false) {
$expectedOutput = $expected['native--mbstring'];
} elseif (empty($expected['native']) === false) {
$expectedOutput = $expected['native'];
}
$this->verifyExpectations($parsed, $expectedOutput);
}
/**
* Test RFC822 address splitting using the IMAP implementation
* without the Mbstring extension.
*
* @requires extension imap
*
* @dataProvider dataAddressSplitting
*
* @param string $addrstr The address list string.
* @param array $expected The expected function output.
* @param string $charset Optional. The charset to use.
*/
public function testAddressSplittingImapNoMbstring($addrstr, $expected, $charset = null)
{
if (extension_loaded('mbstring')) {
$this->markTestSkipped('Test requires MbString *not* to be available');
}
if (isset($charset)) {
$parsed = PHPMailer::parseAddresses($addrstr, true, $charset);
} else {
$parsed = PHPMailer::parseAddresses($addrstr, true);
}
$expectedOutput = $expected['default'];
if (empty($expected['imap--mbstring']) === false) {
$expectedOutput = $expected['imap--mbstring'];
} elseif (empty($expected['imap']) === false) {
$expectedOutput = $expected['imap'];
}
$this->verifyExpectations($parsed, $expectedOutput);
}
/**
* Verify the expectations.
*
@ -173,19 +40,135 @@ final class ParseAddressesTest extends TestCase
);
}
/**
* Test RFC822 address splitting using the native implementation
*
* @dataProvider dataAddressSplittingNative
* @covers \PHPMailer\PHPMailer\PHPMailer::parseSimplerAddresses
*
* @param string $addrstr The address list string.
* @param array $expected The expected function output.
* @param string $charset Optional.The charset to use.
*/
public function testAddressSplittingNative($addrstr, $expected, $charset = PHPMailer::CHARSET_ISO88591)
{
set_error_handler(static function ($errno, $errstr) {
throw new \Exception($errstr, $errno);
}, E_USER_NOTICE);
try {
$this->expectException(\Exception::class);
$reflMethod = new ReflectionMethod(PHPMailer::class, 'parseSimplerAddresses');
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(true);
$parsed = $reflMethod->invoke(null, $addrstr, $charset);
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(false);
$this->verifyExpectations($parsed, $expected);
} finally {
restore_error_handler();
}
}
/**
* Data provider for testAddressSplittingNative.
*
* @return array
* addrstr: string,
* expected: array{name: string, address: string}[]
* charset: string
*/
public function dataAddressSplittingNative()
{
return [
'Valid address: single address without name' => [
'addrstr' => 'joe@example.com',
'expected' => [
['name' => '', 'address' => 'joe@example.com'],
],
],
'Valid address: two addresses with names' => [
'addrstr' => 'Joe User <joe@example.com>, Jill User <jill@example.net>',
'expected' => [
['name' => 'Joe User', 'address' => 'joe@example.com'],
['name' => 'Jill User', 'address' => 'jill@example.net'],
],
],
];
}
/**
* Test if email addresses are parsed and split into a name and address.
*
* @dataProvider dataParseEmailString
* @covers \PHPMailer\PHPMailer\PHPMailer::parseEmailString
* @param mixed $addrstr
* @param mixed $expected
*/
public function testParseEmailString($addrstr, $expected)
{
$reflMethod = new ReflectionMethod(PHPMailer::class, 'parseEmailString');
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(true);
$parsed = $reflMethod->invoke(null, $addrstr);
(\PHP_VERSION_ID < 80100) && $reflMethod->setAccessible(false);
$this->assertEquals($parsed, $expected);
}
/**
* Data provider for testParseEmailString.
*
* @return array The array is expected to have an `addrstr` and an `expected` key.
*/
public function dataParseEmailString()
{
return [
'Valid address: simple address' => [
'addrstr' => 'Joe User <joe@example.com>',
'expected' => ['name' => 'Joe User', 'email' => 'joe@example.com'],
],
'Valid address: simple address with double quotes' => [
'addrstr' => '"Joe User" <joe@example.com>',
'expected' => ['name' => 'Joe User', 'email' => 'joe@example.com'],
],
'Valid address: simple address with single quotes' => [
'addrstr' => '\'Joe User\' <joe@example.com>',
'expected' => ['name' => 'Joe User', 'email' => 'joe@example.com'],
],
'Valid address: complex address with single quotes' => [
'addrstr' => '\'Joe<User\' <joe@example.com>',
'expected' => ['name' => 'Joe<User', 'email' => 'joe@example.com'],
],
'Valid address: complex address with triangle bracket' => [
'addrstr' => '"test<stage" <test@example.com>',
'expected' => ['name' => 'test<stage', 'email' => 'test@example.com'],
],
];
}
/**
* Test RFC822 address splitting using the PHPMailer implementation
*
* @dataProvider dataAddressSplitting
* @covers \PHPMailer\PHPMailer\PHPMailer::parseAddresses
*
* @requires extension imap
* @requires extension mbstring
*
* @param string $addrstr The address list string.
* @param array $expected The expected function output.
* @param string $charset Optional. The charset to use.
*/
public function testAddressSplitting($addrstr, $expected)
{
$parsed = PHPMailer::parseAddresses($addrstr, null, PHPMailer::CHARSET_UTF8);
$this->verifyExpectations($parsed, $expected);
}
/**
* Data provider.
*
* @return array The array is expected to have an `addrstr` and an `expected` key.
* The `expected` key should - as a minimum - have a `default` key.
* Optionally, the following extra keys are supported:
* - `native` Expected output from the native implementation with or without Mbstring.
* - `native+mbstring` Expected output from the native implementation with Mbstring.
* - `native--mbstring` Expected output from the native implementation without Mbstring.
* - `imap` Expected output from the IMAP implementation with or without Mbstring.
* - `imap+mbstring` Expected output from the IMAP implementation with Mbstring.
* - `imap--mbstring` Expected output from the IMAP implementation without Mbstring.
* Also optionally, an additional `charset` key can be passed,
* The `expected` key should - as a minimum.
*/
public function dataAddressSplitting()
{
@ -194,54 +177,39 @@ final class ParseAddressesTest extends TestCase
'Valid address: single address without name' => [
'addrstr' => 'joe@example.com',
'expected' => [
'default' => [
['name' => '', 'address' => 'joe@example.com'],
],
],
],
'Valid address: single address with name' => [
'addrstr' => 'Joe User <joe@example.com>',
'expected' => [
'default' => [
['name' => 'Joe User', 'address' => 'joe@example.com'],
],
['name' => 'Joe User', 'address' => 'joe@example.com'],
],
],
'Valid address: single RFC2047 address folded onto multiple lines' => [
'addrstr' => "=?iso-8859-1?B?QWJjZGVmZ2ggSWprbG3DsSDmnIPorbDlrqTpoJDntITn?=\r\n" .
' =?iso-8859-1?B?s7vntbE=?= <xyz@example.com>',
'addrstr' => "=?ISO-8859-1?Q?J=F6rg?=\r\n" .
' =?ISO-8859-1?Q?_M=FCller?= <xyz@example.com>',
'expected' => [
'default' => [
['name' => 'Abcdefgh Ijklmñ 會議室預約系統', 'address' => 'xyz@example.com'],
],
['name' => 'Jörg Müller', 'address' => 'xyz@example.com'],
],
],
'Valid address: single RFC2047 address with space encoded as _' => [
'addrstr' => '=?iso-8859-1?Q?Abcdefgh_ijklm=C3=B1?= <xyz@example.com>',
'addrstr' => '=?iso-8859-1?Q?Abcdefgh_ijklm=F1?= <xyz@example.com>',
'expected' => [
'default' => [
['name' => 'Abcdefgh ijklmñ', 'address' => 'xyz@example.com'],
],
['name' => 'Abcdefgh ijklmñ', 'address' => 'xyz@example.com'],
],
],
'Valid address: single address, quotes within name' => [
'addrstr' => 'Tim "The Book" O\'Reilly <foo@example.com>',
'expected' => [
'default' => [
['name' => 'Tim "The Book" O\'Reilly', 'address' => 'foo@example.com'],
],
'imap' => [
['name' => 'Tim The Book O\'Reilly', 'address' => 'foo@example.com'],
],
['name' => 'Tim The Book O\'Reilly', 'address' => 'foo@example.com'],
],
],
'Valid address: two addresses with names' => [
'addrstr' => 'Joe User <joe@example.com>, Jill User <jill@example.net>',
'expected' => [
'default' => [
['name' => 'Joe User', 'address' => 'joe@example.com'],
['name' => 'Jill User', 'address' => 'jill@example.net'],
],
['name' => 'Joe User', 'address' => 'joe@example.com'],
['name' => 'Jill User', 'address' => 'jill@example.net'],
],
],
'Valid address: two addresses with names, one without' => [
@ -249,106 +217,104 @@ final class ParseAddressesTest extends TestCase
. 'Jill User <jill@example.net>,'
. 'frank@example.com,',
'expected' => [
'default' => [
['name' => 'Joe User', 'address' => 'joe@example.com'],
['name' => 'Jill User', 'address' => 'jill@example.net'],
['name' => '', 'address' => 'frank@example.com'],
],
['name' => 'Joe User', 'address' => 'joe@example.com'],
['name' => 'Jill User', 'address' => 'jill@example.net'],
['name' => '', 'address' => 'frank@example.com'],
],
],
'Valid address: multiple address, various formats, including one utf8-encoded name' => [
'Valid address: multiple address, various formats, including one utf8-encoded names' => [
'addrstr' => 'joe@example.com, <me@example.com>, Joe Doe <doe@example.com>,' .
' "John O\'Groats" <johnog@example.net>,' .
' =?utf-8?B?0J3QsNC30LLQsNC90LjQtSDRgtC10YHRgtCw?= <encoded@example.org>',
' =?utf-8?B?0J3QsNC30LLQsNC90LjQtSDRgtC10YHRgtCw?= <encoded@example.org>,' .
' =?UTF-8?Q?Welcome_to_our_caf=C3=A9!?= =?ISO-8859-1?Q?_Willkommen_in_unserem_Caf=E9!?=' .
' =?KOI8-R?Q?_=F0=D2=C9=D7=C5=D4_=D7_=CE=C1=DB=C5_=CB=C1=C6=C5!?= <encoded3@example.org>',
'expected' => [
'default' => [
[
'name' => '',
'address' => 'joe@example.com',
],
[
'name' => '',
'address' => 'me@example.com',
],
[
'name' => 'Joe Doe',
'address' => 'doe@example.com',
],
[
'name' => "John O'Groats",
'address' => 'johnog@example.net',
],
[
'name' => 'Название теста',
'address' => 'encoded@example.org',
],
['name' => '', 'address' => 'joe@example.com'],
['name' => '', 'address' => 'me@example.com'],
['name' => 'Joe Doe', 'address' => 'doe@example.com'],
['name' => "John O'Groats", 'address' => 'johnog@example.net'],
['name' => 'Название теста', 'address' => 'encoded@example.org'],
[
'name' => 'Welcome to our café! Willkommen in unserem Café! Привет в наше кафе!',
'address' => 'encoded3@example.org'
],
'native--mbstring' => [
[
'name' => '',
'address' => 'joe@example.com',
],
[
'name' => '',
'address' => 'me@example.com',
],
[
'name' => 'Joe Doe',
'address' => 'doe@example.com',
],
[
'name' => "John O'Groats",
'address' => 'johnog@example.net',
],
[
'name' => '=?utf-8?B?0J3QsNC30LLQsNC90LjQtSDRgtC10YHRgtCw?=',
'address' => 'encoded@example.org',
],
],
'imap--mbstring' => [
[
'name' => '',
'address' => 'joe@example.com',
],
[
'name' => '',
'address' => 'me@example.com',
],
[
'name' => 'Joe Doe',
'address' => 'doe@example.com',
],
[
'name' => "John O'Groats",
'address' => 'johnog@example.net',
],
[
'name' => '=?utf-8?B?0J3QsNC30LLQsNC90LjQtSDRgtC10YHRgtCw?=',
'address' => 'encoded@example.org',
],
],
],
'charset' => PHPMailer::CHARSET_UTF8,
]
],
// Test cases with invalid addresses.
'Invalid address: single address, incomplete email' => [
'addrstr' => 'Jill User <doug@>',
'expected' => [
'default' => [],
],
'expected' => [],
],
'Invalid address: single address, invalid characters in email' => [
'addrstr' => 'Joe User <{^c\@**Dog^}@cartoon.com>',
'expected' => [
'default' => [],
],
'expected' => [],
],
'Invalid address: multiple addresses, invalid periods' => [
'addrstr' => 'Joe User <joe@example.com.>, Jill User <jill.@example.net>',
'expected' => [
'default' => [],
],
'expected' => [],
],
];
}
/**
* Test decodeHeader using the PHPMailer
* with the Mbstring extension available.
*
* @dataProvider dataDecodeHeader
* @covers \PHPMailer\PHPMailer\PHPMailer::decodeHeader
*
* @requires extension mbstring
*
* @param string $addrstr The header string.
* @param array $expected The expected function output.
*/
public function testDecodeHeader($str, $expected)
{
$parsed = PHPMailer::decodeHeader($str, PHPMailer::CHARSET_UTF8);
$this->assertEquals($parsed, $expected);
}
/**
* Data provider for decodeHeader.
*
* @return array The array is expected to have an `addrstr` and an `expected` key.
* The `expected` key should - as a minimum - have a single value.
*/
public function dataDecodeHeader()
{
return [
'UTF-8 B-encoded' => [
'name' => '=?utf-8?B?0J3QsNC30LLQsNC90LjQtSDRgtC10YHRgtCw?=',
'expected' => 'Название теста',
],
'UTF-8 Q-encoded' => [
'name' => '=?UTF-8?Q?=D0=9D=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8?=' .
' =?UTF-8?Q?=D0=B5_=D1=82=D0=B5=D1=81=D1=82=D0=B0?=',
'expected' => 'Название теста',
],
'UTF-8 Q-encoded with multiple wrong labels and space encoded as _' => [
'name' => '=?UTF-8?Q?Welcome_to_our_caf=C3=A9!?= =?ISO-8859-1?Q?_Willkommen_in_unserem_Caf=E9!?=' .
' =?KOI8-R?Q?_=F0=D2=C9=D7=C5=D4_=D7_=CE=C1=DB=C5_=CB=C1=C6=C5!?=',
'expected' => 'Welcome to our café! Willkommen in unserem Café! Привет в наше кафе!',
],
'ISO-8859-1 Q-encoded' => [
'name' => '=?ISO-8859-1?Q?Willkommen_in_unserem_Caf=E9!?=',
'expected' => 'Willkommen in unserem Café!',
],
'Valid but wrongly labeled UTF-8 as ISO-8859-1' => [
'name' => '=?iso-8859-1?B?5pyD6K2w5a6k?=',
'expected' => "æ\xC2\x9C\xC2\x83議室",
],
'SMTPUTF8 encoded' => [
'name' => '=?UTF-8?B?SGVsbG8g8J+MjSDkuJbnlYwgY2Fmw6k=?=',
'expected' => 'Hello 🌍 世界 café',
],
'Multiple lines' => [
'name' => '=?UTF-8?B?0YLQtdGB0YIg0YLQtdGB0YIg0YLQtdGB0YIg0YLQtdGB0YIg0YLQtdGB0YIg?='
. "\n =?UTF-8?B?0YLQtdGB0YIg0YLQtdGB0YI=?=",
'expected' => 'тест тест тест тест тест тест тест',
],
];
}

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -33,7 +33,7 @@ final class PunyencodeAddressTest extends TestCase
*
* @param string $input Input text string.
* @param string $charset The character set.
* @param string $expected Expected funtion output.
* @param string $expected Expected function output.
*/
public function testPunyencodeAddressConversion($input, $charset, $expected)
{
@ -87,7 +87,7 @@ final class PunyencodeAddressTest extends TestCase
*
* @param string $input Input text string.
* @param string $charset The character set.
* @param string $expected Expected funtion output.
* @param string $expected Expected function output.
*/
public function testPunyencodeAddressNoConversion($input, $charset, $expected)
{

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -29,7 +29,7 @@ final class QuotedStringTest extends TestCase
* @dataProvider dataQuotedString
*
* @param string $input Input text string.
* @param string $expected Expected funtion output.
* @param string $expected Expected function output.
*/
public function testQuotedString($input, $expected)
{

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -48,7 +48,6 @@ final class ReplyToGetSetClearTest extends PreSendTestCase
if (isset($expected) === false) {
$expected = [
'key' => $address,
'address' => $address,
'name' => $name,
];
@ -62,25 +61,19 @@ final class ReplyToGetSetClearTest extends PreSendTestCase
self::assertIsArray($retrieved, 'ReplyTo property is not an array');
self::assertCount(1, $retrieved, 'ReplyTo property does not contain exactly one address');
$key = $expected['key'];
self::assertArrayHasKey(
$key,
$retrieved,
'ReplyTo property does not contain an entry with this address as the key'
);
self::assertCount(
2,
$retrieved[$key],
$retrieved[0],
'ReplyTo array for this address does not contain exactly two array items'
);
self::assertSame(
$expected['address'],
$retrieved[$key][0],
$retrieved[0][0],
'ReplyTo array for this address does not contain added address'
);
self::assertSame(
$expected['name'],
$retrieved[$key][1],
$retrieved[0][1],
'ReplyTo array for this address does not contain added name'
);
}
@ -100,7 +93,6 @@ final class ReplyToGetSetClearTest extends PreSendTestCase
'address' => " \tMiXeD@Example.Com \r\n",
'name' => null,
'expected' => [
'key' => 'mixed@example.com',
'address' => 'MiXeD@Example.Com',
'name' => '',
],
@ -113,7 +105,6 @@ final class ReplyToGetSetClearTest extends PreSendTestCase
'address' => 'a@example.com',
'name' => "\t\t ReplyTo\r\nname ",
'expected' => [
'key' => 'a@example.com',
'address' => 'a@example.com',
'name' => 'ReplyToname',
],
@ -292,9 +283,11 @@ final class ReplyToGetSetClearTest extends PreSendTestCase
// Addresses with IDN are returned by get*Addresses() after preSend() call.
$domain = $this->Mail->punyencodeAddress($domain);
$expected = array('test+replyto' . $domain, '');
$retrieved = $this->Mail->getReplyToAddresses();
self::assertSame(
['test+replyto' . $domain => ['test+replyto' . $domain, '']],
$this->Mail->getReplyToAddresses(),
$expected,
$retrieved[0],
'Bad "reply-to" addresses'
);
}
@ -377,30 +370,30 @@ final class ReplyToGetSetClearTest extends PreSendTestCase
self::assertCount(1, $retrieved, 'Stored addresses after preSend() is not 1');
// Verify that the registered reply-to address is the initially added lowercase punycode one.
self::assertArrayHasKey(
self::assertSame(
$expectedAddress,
$retrieved,
$retrieved[0][0],
'ReplyTo property does not contain an entry with this address as the key'
);
self::assertCount(
2,
$retrieved[$expectedAddress],
$retrieved[0],
'ReplyTo array for this address does not contain exactly two array items'
);
self::assertSame(
$expectedAddress,
$retrieved[$expectedAddress][0],
$retrieved[0][0],
'ReplyTo array for this address does not contain added address'
);
self::assertSame(
'',
$retrieved[$expectedAddress][1],
$retrieved[0][1],
'ReplyTo array for this address does not contain added name'
);
}
/**
* Test unsuccesfully adding an Reply-to address when an email address containing
* Test unsuccessfully adding an Reply-to address when an email address containing
* an 8bit character is passed and either the MbString or the Intl extension are
* not available.
*
@ -408,8 +401,8 @@ final class ReplyToGetSetClearTest extends PreSendTestCase
*/
public function testAddReplyToFailsOn8BitCharInDomainWithoutOptionalExtensions()
{
if (extension_loaded('mbstring') && function_exists('idn_to_ascii')) {
$this->markTestSkipped('Test requires MbString and/or Intl *not* to be available');
if (PHPMailer::idnSupported()) {
self::markTestSkipped('Test requires MbString and/or Intl *not* to be available');
}
self::assertFalse($this->Mail->addReplyTo('test@françois.ch'));

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -111,7 +111,7 @@ final class SetErrorTest extends TestCase
'smtp_code' => '',
'smtp_code_ex' => '',
],
'expected' => 'Cannot set or reset variable: nonexistentpropertySMTP server error: Fake error',
'expected' => 'Cannot set or reset variable: nonexistentproperty SMTP server error: Fake error',
],
'SMTP error, full details' => [
'mockReturn' => [
@ -120,7 +120,7 @@ final class SetErrorTest extends TestCase
'smtp_code' => 'Fake code',
'smtp_code_ex' => 'Fake code ex',
],
'expected' => 'Cannot set or reset variable: nonexistentpropertySMTP server error: '
'expected' => 'Cannot set or reset variable: nonexistentproperty SMTP server error: '
. 'Fake error Detail: Fake detail SMTP code: Fake code Additional SMTP info: Fake code ex',
],
];

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;
@ -25,11 +25,11 @@ use PHPMailer\Test\TestCase;
final class SetFromTest extends TestCase
{
/**
* Test succesfully setting the From, FromName and Sender properties.
* Test successfully setting the From, FromName and Sender properties.
*
* @dataProvider dataSetFromSuccess
*
* @param string $expected Expected funtion output.
* @param string $expected Expected function output.
* @param string $address Email address input to pass to the function.
* @param string $name Optional. Name input to pass to the function.
*/
@ -126,7 +126,7 @@ final class SetFromTest extends TestCase
}
/**
* Test unsuccesfully setting the From, FromName and Sender properties.
* Test unsuccessfully setting the From, FromName and Sender properties.
*
* @dataProvider dataSetFromFail
*
@ -187,14 +187,14 @@ final class SetFromTest extends TestCase
}
/**
* Test unsuccesfully setting the From, FromName and Sender properties when an email address
* Test unsuccessfully setting the From, FromName and Sender properties when an email address
* containing an 8bit character is passed and either the MbString or the Intl extension are
* not available.
*/
public function testSetFromFailsOn8BitCharInDomainWithoutOptionalExtensions()
{
if (extension_loaded('mbstring') && function_exists('idn_to_ascii')) {
$this->markTestSkipped('Test requires MbString and/or Intl *not* to be available');
self::markTestSkipped('Test requires MbString and/or Intl *not* to be available');
}
$this->testSetFromFail("8bit@ex\x80mple.com");

View File

@ -8,7 +8,7 @@
* @author Andy Prevost
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
*/
namespace PHPMailer\Test\PHPMailer;

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