Compare commits
No commits in common. "master" and "v6.3.0" have entirely different histories.
21
.codecov.yml
21
.codecov.yml
|
|
@ -1,21 +0,0 @@
|
|||
codecov:
|
||||
notify:
|
||||
after_n_builds: 2
|
||||
|
||||
coverage:
|
||||
round: nearest
|
||||
# Status will be green when coverage is between 70 and 100%.
|
||||
range: "70...100"
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
threshold: 2%
|
||||
paths:
|
||||
- "src"
|
||||
patch:
|
||||
default:
|
||||
threshold: 0%
|
||||
paths:
|
||||
- "src"
|
||||
|
||||
comment: false
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
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,17 +1,16 @@
|
|||
* text=auto
|
||||
|
||||
/.codecov.yml export-ignore
|
||||
/.editorconfig export-ignore
|
||||
/.gitattributes export-ignore
|
||||
/.github export-ignore
|
||||
/.gitignore export-ignore
|
||||
/.phan export-ignore
|
||||
/.scrutinizer.yml export-ignore
|
||||
/.travis.yml export-ignore
|
||||
/changelog.md export-ignore
|
||||
/docs export-ignore
|
||||
/examples export-ignore
|
||||
/phpcs.xml.dist export-ignore
|
||||
/phpdoc.dist.xml export-ignore
|
||||
/phpunit.xml.dist export-ignore
|
||||
/test export-ignore
|
||||
/travis.phpunit.xml.dist export-ignore
|
||||
/UPGRADING.md export-ignore
|
||||
|
|
|
|||
|
|
@ -2,5 +2,4 @@
|
|||
|
||||
github: Synchro
|
||||
patreon: marcusbointon
|
||||
tidelift: "packagist/phpmailer/phpmailer"
|
||||
custom: https://marcus.bointon.com/donations/
|
||||
|
|
|
|||
|
|
@ -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**](https://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**](http://stackoverflow.com/questions/tagged/phpmailer)!
|
||||
|
||||
# Problem description
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
Before submitting your pull request, check whether your code adheres to PHPMailer coding standards (which is mostly [PSR-12](https://www.php-fig.org/psr/psr-12/)) by running [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer):
|
||||
|
||||
./vendor/bin/phpcs
|
||||
|
||||
Any problems reported can probably be fixed automatically by using its partner tool, PHP code beautifier:
|
||||
|
||||
./vendor/bin/phpcbf
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Dependabot configuration.
|
||||
#
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "cron"
|
||||
cronjob: "10 22 5,20 * *" # At 22:10, every 5th and 20th day of the month.
|
||||
open-pull-requests-limit: 5
|
||||
commit-message:
|
||||
prefix: "GH Actions:"
|
||||
groups:
|
||||
action-runners:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
|
|
@ -3,28 +3,19 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- master
|
||||
permissions: {}
|
||||
jobs:
|
||||
build_and_publish:
|
||||
permissions:
|
||||
contents: write # to push changes in repo (jamesives/github-pages-deploy-action)
|
||||
|
||||
name: Build and publish Docs
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'PHPMailer/PHPMailer'
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
persist-credentials: false
|
||||
- name: Build Docs
|
||||
uses: ./.github/actions/build-docs
|
||||
- name: Publish Docs to gh-pages
|
||||
uses: JamesIves/github-pages-deploy-action@9d877eea73427180ae43cf98e8914934fe157a1a # v4.7.6
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: docs
|
||||
uses: maxheld83/ghpages@v0.2.1
|
||||
env:
|
||||
BUILD_DIR: docs/
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
|
|
|
|||
|
|
@ -1,61 +0,0 @@
|
|||
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
|
||||
|
|
@ -1,212 +1,60 @@
|
|||
name: "Tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
# Allow manually triggering the workflow.
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
|
||||
coding-standard:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
php: ['8.0']
|
||||
dependency-version: [prefer-stable]
|
||||
name: Coding standards
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 'latest'
|
||||
coverage: none
|
||||
tools: cs2pr
|
||||
php-version: ${{ matrix.php }}
|
||||
|
||||
# Install dependencies and handle caching in one go.
|
||||
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
|
||||
- name: Install Composer dependencies
|
||||
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
|
||||
with:
|
||||
# Bust the cache at least once a month - output format: YYYY-MM.
|
||||
custom-cache-suffix: $(date -u "+%Y-%m")
|
||||
- name: Install dependencies
|
||||
run: composer install --no-interaction
|
||||
|
||||
- name: Check coding standards
|
||||
id: phpcs
|
||||
run: ./vendor/bin/phpcs -s --report-full --report-checkstyle=./phpcs-report.xml
|
||||
|
||||
- name: Show PHPCS results in PR
|
||||
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
|
||||
run: cs2pr ./phpcs-report.xml
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
php: ['5.5', '7.2', '8.0', '8.5']
|
||||
experimental: [false]
|
||||
include:
|
||||
- php: 'nightly'
|
||||
experimental: true
|
||||
|
||||
name: "Lint: PHP ${{ matrix.php }}"
|
||||
continue-on-error: ${{ matrix.experimental }}
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install PHP
|
||||
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
ini-values: error_reporting=-1, display_errors=On, display_startup_errors=On
|
||||
coverage: none
|
||||
tools: cs2pr
|
||||
|
||||
# Install dependencies and handle caching in one go.
|
||||
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
|
||||
- name: Install Composer dependencies
|
||||
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
|
||||
with:
|
||||
# Bust the cache at least once a month - output format: YYYY-MM.
|
||||
custom-cache-suffix: $(date -u "+%Y-%m")
|
||||
|
||||
- name: Lint against parse errors
|
||||
if: ${{ matrix.php != 'nightly' }}
|
||||
run: composer lint -- --checkstyle | cs2pr
|
||||
|
||||
- name: Lint against future parse errors (PHP nightly)
|
||||
if: ${{ matrix.php == 'nightly' }}
|
||||
run: composer lint
|
||||
run: ./vendor/bin/phpcs -s
|
||||
|
||||
test:
|
||||
needs: ['coding-standard', 'lint']
|
||||
runs-on: ubuntu-22.04
|
||||
needs: ['coding-standard']
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
|
||||
extensions: ['optimal', 'minimal']
|
||||
coverage: [false]
|
||||
experimental: [false]
|
||||
include:
|
||||
# Run code coverage on high/low PHP.
|
||||
- php: '5.5'
|
||||
extensions: 'optimal'
|
||||
coverage: true
|
||||
experimental: false
|
||||
- php: '5.5'
|
||||
extensions: 'minimal'
|
||||
coverage: true
|
||||
experimental: false
|
||||
- php: '8.5'
|
||||
extensions: 'optimal'
|
||||
coverage: true
|
||||
experimental: false
|
||||
- php: '8.5'
|
||||
extensions: 'minimal'
|
||||
coverage: true
|
||||
experimental: false
|
||||
|
||||
# Experimental builds. These are allowed to fail.
|
||||
- php: '8.6'
|
||||
extensions: 'optimal'
|
||||
coverage: false
|
||||
experimental: true
|
||||
- php: '8.6'
|
||||
extensions: 'minimal'
|
||||
coverage: false
|
||||
experimental: true
|
||||
|
||||
name: "Test: PHP ${{ matrix.php }} - ${{ matrix.extensions }}"
|
||||
|
||||
continue-on-error: ${{ matrix.experimental }}
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
php: ['5.5', '5.6', '7.0.', '7.1', '7.2', '7.3', '7.4', '8.0']
|
||||
dependency-version: [prefer-stable]
|
||||
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
# About the "extensions":
|
||||
#
|
||||
# In a "normal" test run, the "default" extension set for a PHP version is used
|
||||
# and it is ensured that certain extensions will be available, no matter what.
|
||||
#
|
||||
# For the "minimal" test run, all extensions are disabled and then only
|
||||
# a limited set of minimally required extensions are re-enabled.
|
||||
# The minimal set is based on the required extensions from PHPUnit + PHPMailer combined
|
||||
# + Curl for Composer.
|
||||
# Whether Xdebug will be enabled depends on the code coverage settings.
|
||||
#
|
||||
# Also see:
|
||||
# https://github.com/shivammathur/setup-php/?tab=readme-ov-file#heavy_plus_sign-php-extension-support
|
||||
# https://github.com/shivammathur/setup-php/wiki
|
||||
- name: Determine extensions to use
|
||||
id: set_extensions
|
||||
run: |
|
||||
if [[ "${{ matrix.extensions }}" == "optimal" ]]; then
|
||||
# Optimal.
|
||||
echo 'EXT=imap, mbstring, openssl, intl, ctype, filter, hash' >> $GITHUB_OUTPUT
|
||||
echo 'COMPOSER_OPTIONS=' >> $GITHUB_OUTPUT
|
||||
else
|
||||
# Minimal.
|
||||
echo 'EXT=none, curl, dom, json, libxml, mbstring, tokenizer, xml, xmlwriter, ctype, filter, hash' >> $GITHUB_OUTPUT
|
||||
echo 'COMPOSER_OPTIONS=--ignore-platform-req=ext-simplexml' >> $GITHUB_OUTPUT
|
||||
fi
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
|
||||
ini-values: sendmail_path=/usr/sbin/sendmail -t -i, error_reporting=-1, display_errors=On, display_startup_errors=On
|
||||
extensions: ${{ steps.set_extensions.outputs.EXT }}
|
||||
coverage: xdebug
|
||||
ini-values: sendmail_path=/usr/sbin/sendmail -t -i, zend.multibyte=1, zend.script_encoding=UTF-8, default_charset=UTF-8
|
||||
extensions: xdebug, imap, mbstring, intl, ctype, filter, hash
|
||||
|
||||
# Install dependencies and handle caching in one go.
|
||||
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
|
||||
- name: Install PHP packages - normal
|
||||
if: ${{ matrix.php != '8.6' }}
|
||||
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
|
||||
with:
|
||||
composer-options: ${{ steps.set_extensions.outputs.COMPOSER_OPTIONS }}
|
||||
# Bust the cache at least once a month - output format: YYYY-MM.
|
||||
custom-cache-suffix: $(date -u "+%Y-%m")
|
||||
- name: Install PHP packages
|
||||
run: composer install --no-interaction
|
||||
|
||||
- name: Install PHP packages - ignore-platform-reqs
|
||||
if: ${{ matrix.php == '8.6' }}
|
||||
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
|
||||
with:
|
||||
composer-options: --ignore-platform-reqs ${{ steps.set_extensions.outputs.COMPOSER_OPTIONS }}
|
||||
# Bust the cache at least once a month - output format: YYYY-MM.
|
||||
custom-cache-suffix: $(date -u "+%Y-%m")
|
||||
|
||||
# Install postfix and automatically retry if the install failed, which happens reguarly.
|
||||
# @link https://github.com/marketplace/actions/retry-step
|
||||
- name: Install postfix
|
||||
uses: nick-invision/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
retry_wait_seconds: 8
|
||||
command: |
|
||||
sudo apt-get install --fix-broken -y libsqlite3-0 postfix
|
||||
sudo systemctl stop postfix.service
|
||||
run: |
|
||||
sudo apt-get install -y -qq postfix qmail
|
||||
sudo service postfix stop
|
||||
|
||||
- name: Set up sendmail
|
||||
run: |
|
||||
|
|
@ -217,21 +65,6 @@ jobs:
|
|||
sudo mkdir -p /var/qmail/bin
|
||||
sudo cp test/fakesendmail.sh /var/qmail/bin/sendmail
|
||||
sudo cp test/fakesendmail.sh /usr/sbin/sendmail
|
||||
|
||||
- name: Run tests, no code coverage
|
||||
if: ${{ matrix.coverage == false }}
|
||||
run: ./vendor/bin/phpunit --no-coverage
|
||||
|
||||
- name: Run tests with code coverage
|
||||
if: ${{ matrix.coverage == true }}
|
||||
run: vendor/bin/phpunit
|
||||
|
||||
- name: Send coverage report to Codecov
|
||||
if: ${{ success() && matrix.coverage == true && github.event.repository.fork == false }}
|
||||
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
with:
|
||||
files: ./build/logs/clover.xml
|
||||
fail_ci_if_error: true
|
||||
verbose: true
|
||||
|
||||
- name: Run tests
|
||||
run: ./vendor/bin/phpunit --configuration ./phpunit.xml.dist
|
||||
|
|
|
|||
|
|
@ -11,6 +11,5 @@ phpcs.xml
|
|||
.phpcs-cache
|
||||
/.rnd
|
||||
test/PHPMailerTest.php*nonexistent_file.txt
|
||||
test/*/PHPMailerTest.php*nonexistent_file.txt
|
||||
phpunit.xml
|
||||
/.phpunit.result.cache
|
||||
|
|
|
|||
72
README.md
72
README.md
|
|
@ -1,54 +1,45 @@
|
|||
[](https://supportukrainenow.org/)
|
||||
|
||||

|
||||
|
||||
# PHPMailer – A full-featured email creation and transfer class for PHP
|
||||
|
||||
[](https://github.com/PHPMailer/PHPMailer/actions)
|
||||
[](https://codecov.io/gh/PHPMailer/PHPMailer)
|
||||
[](https://packagist.org/packages/phpmailer/phpmailer)
|
||||
[](https://packagist.org/packages/phpmailer/phpmailer)
|
||||
[](https://packagist.org/packages/phpmailer/phpmailer)
|
||||
[](https://phpmailer.github.io/PHPMailer/)
|
||||
[](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer)
|
||||
[](https://github.com/PHPMailer/PHPMailer/actions) [](https://packagist.org/packages/phpmailer/phpmailer) [](https://packagist.org/packages/phpmailer/phpmailer) [](https://packagist.org/packages/phpmailer/phpmailer) [](https://packagist.org/packages/phpmailer/phpmailer) [](https://phpmailer.github.io/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
|
||||
- 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
|
||||
- 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.5
|
||||
- Compatible with PHP 5.5 and later, including PHP 8.0
|
||||
- Namespaced to prevent name clashes
|
||||
- Much more!
|
||||
|
||||
## Why you might need it
|
||||
Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as authentication, HTML messages, and attachments.
|
||||
Many PHP developers 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.
|
||||
|
||||
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 [Symfony Mailer](https://symfony.com/doc/current/mailer.html), [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc.
|
||||
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.
|
||||
|
||||
## License
|
||||
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.
|
||||
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.
|
||||
|
||||
## 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": "^7.0.0"
|
||||
"phpmailer/phpmailer": "^6.2"
|
||||
```
|
||||
|
||||
or run
|
||||
|
|
@ -59,8 +50,7 @@ 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 XOAUTH2 authentication, you will also need to add a dependency on the `league/oauth2-client` and appropriate service adapters package in your `composer.json`, or take a look at
|
||||
by @decomplexity's [SendOauth2 wrapper](https://github.com/decomplexity/SendOauth2), especially if you're using Microsoft services.
|
||||
If you 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`.
|
||||
|
||||
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:
|
||||
|
|
@ -75,7 +65,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 it. 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 the SMTP class. 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.
|
||||
|
|
@ -96,10 +86,10 @@ use PHPMailer\PHPMailer\PHPMailer;
|
|||
use PHPMailer\PHPMailer\SMTP;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
//Load Composer's autoloader (created by composer, not included with PHPMailer)
|
||||
//Load Composer's autoloader
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
//Create an instance; passing `true` enables exceptions
|
||||
//Instantiation and passing `true` enables exceptions
|
||||
$mail = new PHPMailer(true);
|
||||
|
||||
try {
|
||||
|
|
@ -110,8 +100,8 @@ try {
|
|||
$mail->SMTPAuth = true; //Enable SMTP authentication
|
||||
$mail->Username = 'user@example.com'; //SMTP username
|
||||
$mail->Password = 'secret'; //SMTP password
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption
|
||||
$mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
|
||||
$mail->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
|
||||
|
||||
//Recipients
|
||||
$mail->setFrom('from@example.com', 'Mailer');
|
||||
|
|
@ -138,21 +128,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](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:
|
||||
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:
|
||||
|
||||
```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 [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.
|
||||
We welcome corrections and new languages – if you're looking for corrections to do, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations.
|
||||
|
||||
## 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.
|
||||
|
|
@ -163,9 +153,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](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.
|
||||
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.
|
||||
|
||||
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).
|
||||
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).
|
||||
|
||||
## 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.
|
||||
|
|
@ -180,9 +170,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.
|
||||
|
||||
|
|
@ -195,26 +185,18 @@ git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git
|
|||
Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained.
|
||||
|
||||
## Sponsorship
|
||||
Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), the world's only privacy-first email marketing system.
|
||||
Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), the world's only privacy-first email marketing system.
|
||||
|
||||
<a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="550" alt="Smartmessages.net privacy-first email marketing logo"></a>
|
||||
|
||||
Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to PHPMailer's maintainers and contributors – just click the "Sponsor" button [on the project page](https://github.com/PHPMailer/PHPMailer). If your company uses PHPMailer, consider taking part in Tidelift's enterprise support programme.
|
||||
|
||||
## PHPMailer For Enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial
|
||||
support and maintenance for the open-source packages you use to build your applications. Save time, reduce risk, and
|
||||
improve code health, while paying the maintainers of the exact packages you
|
||||
use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
Contributions are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to PHPMailer's maintainers and contributors – just click the "Sponsor" button [on the project page](https://github.com/PHPMailer/PHPMailer).
|
||||
|
||||
## Changelog
|
||||
See [changelog](changelog.md).
|
||||
|
||||
## History
|
||||
- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](https://sourceforge.net/projects/phpmailer/).
|
||||
- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://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.
|
||||
|
|
@ -224,9 +206,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.
|
||||
|
|
|
|||
13
SECURITY.md
13
SECURITY.md
|
|
@ -1,25 +1,18 @@
|
|||
# Security notices relating to PHPMailer
|
||||
|
||||
Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately.
|
||||
|
||||
PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/).
|
||||
|
||||
PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows.
|
||||
PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift.
|
||||
|
||||
PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts.
|
||||
Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately.
|
||||
|
||||
PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security.
|
||||
|
||||
PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr.
|
||||
|
||||
PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it is not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
|
||||
PHPMailer versions prior to 5.2.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.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](https://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](http://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
48
SMTPUTF8.md
|
|
@ -1,48 +0,0 @@
|
|||
# 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.
|
||||
|
|
@ -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 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.
|
||||
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).
|
||||
|
||||
## Loading PHPMailer
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ require 'src/Exception.php';
|
|||
```
|
||||
|
||||
## Namespace
|
||||
PHPMailer 6 uses a [namespace](https://www.php.net/manual/en/language.namespaces.rationale.php) of `PHPMailer\PHPMailer`, because it's the PHPMailer project within the PHPMailer organisation. You **must** import (with a `use` statement) classes you're using explicitly into your own namespace, or reference them absolutely in the global namespace - all the examples do this. This means the fully-qualified name of the main PHPMailer class is `PHPMailer\PHPMailer\PHPMailer`, which is a bit of a mouthful, but there's no harm in it! If you are using other PHPMailer classes explicitly (such as `SMTP` or `Exception`), you will need to import them into your namespace too.
|
||||
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.
|
||||
|
||||
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](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).
|
||||
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).
|
||||
|
||||
## 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.
|
||||
|
|
|
|||
213
changelog.md
213
changelog.md
|
|
@ -1,203 +1,8 @@
|
|||
# PHPMailer Change Log
|
||||
|
||||
## Version 7.0.2 (January 9th, 2026)
|
||||
* Fixes for sendmail parameter problems in WordPress, thanks to @SirLouen
|
||||
* Reduce memory consumption when sending large attachments by @RobinvanderVliet
|
||||
|
||||
## Version 7.0.1 (November 25th, 2025)
|
||||
* Use From domain when generating CIDs in msgHTML.
|
||||
* Update to PHPCompatibility 10, resolve numerous PHPCS issues in PHP 8.5.
|
||||
* Revise GitHub actions for PHP 8.5 and experimental 8.6 tests.
|
||||
* Switch gmail example from the deprecated IMAP extension to use `directorytree/imapengine` for IMAP uploads.
|
||||
* Set `htmlspecialchars()` flags explicitly and consistently.
|
||||
* Convert XOAUTH2 token exceptions into PHPMailer Exceptions. The original exception is available as an inner exception.
|
||||
* Deprecate VERSION constants in POP3 and SMTP classes.
|
||||
* Remove dependency on `roave/security-advisories`; it's now built into composer 2.9.
|
||||
* Update Dutch, Esperanto, and Norwegian translations.
|
||||
|
||||
## Version 7.0.0 (October 15th, 2025)
|
||||
This is exactly the same as 6.11.1 but bumps the major version number to indicate the presence of a BC break in child classes. Specifically, `lang()`, `setLanguage()`, and `$language` are now static, and should be called statically.
|
||||
|
||||
## Version 6.12.0 (October 15th, 2025)
|
||||
This is exactly the same as 6.10.0, reverting all the changes in 6.11.0 and 6.11.1, which inadvertently introduced a BC break affecting child classes. 6.11.1 has been re-released as 7.0.0.
|
||||
|
||||
## Version 6.11.1 (September 30th, 2025)
|
||||
* Avoid function signature problems with the deprecation of `$useimap` in `parseAddresses`.
|
||||
|
||||
## Version 6.11.0 (September 29th, 2025)
|
||||
* Add support for [RFC4954](https://www.rfc-editor.org/rfc/rfc4954#section-4) two-part authentication for large XOAUTH2 tokens.
|
||||
* Also support empty tokens.
|
||||
* Avoid bogus static analyser deprecation warnings in `setFrom`.
|
||||
* Make language loading entirely static, thanks to @SirLouen.
|
||||
* Emit warnings when `parseAddresses()` is used without the IMAP extension.
|
||||
* Handle `mb_decode_mimeheader` changes from PHP 8.3+.
|
||||
* Deprecate the charset param to parseAddresses.
|
||||
* Fix PHP 8.5 linting issue.
|
||||
* Don't use `-t` switch when calling qmail.
|
||||
* Checking for interrupted system calls now works in languages other than English.
|
||||
* Add support for extracting gmail transaction IDs after sending.
|
||||
* For consistency, the protected `ReplyTo` property has been changed to match the format used for other address arrays.
|
||||
* Fix line length issues when using S/MIME signing.
|
||||
* Pin action runners to exact versions to avoid unexpected upstream changes.
|
||||
|
||||
## Version 6.10.0 (April 24th, 2025)
|
||||
* Add support for [RFC 6530 SMTPUTF8](https://www.rfc-editor.org/rfc/rfc6530), permitting use of UTF-8 Unicode characters everywhere, thanks to @arnt and ICANN. See `SMTPUTF8.md` for details.
|
||||
* More reliable checking for multibyte support.
|
||||
|
||||
## Version 6.9.3 (November 22nd, 2024)
|
||||
* Add support for the release version of PHP 8.4
|
||||
* Add experimental support for PHP 8.5
|
||||
* Use rfc-editor.org for all RFC docs links
|
||||
|
||||
## Version 6.9.2 (October 9th, 2024)
|
||||
* Escape dots in SMTP transaction ID patterns
|
||||
* Add link to [aboutmy.email](https://aboutmy.email) testing service in docs
|
||||
* Add a more comprehensive example for using XOAUTH2 with gmail and Azure, thanks to @decomplexity
|
||||
* Update Turkish, Spanish, Japanese, Russian, French translations
|
||||
* Add Urdu & Kurdish (Sorani) translations
|
||||
* Fix broken links in docs and comments, avoid http links, correct link to LGPL 2.1 license file
|
||||
* Cleaner PSR-3 SMTP debug logging
|
||||
* Bump GitHub action versions
|
||||
* Fix error handler scope issue in POP3 and SMTP classes
|
||||
* Numerous test improvements by @jrfnl
|
||||
|
||||
## Version 6.9.1 (November 25th, 2023)
|
||||
* Finalise SendOauth2 example
|
||||
|
||||
## Version 6.9.0 (November 23rd, 2023)
|
||||
* Add support for official release of PHP 8.3, add experimental support for PHP 8.4
|
||||
* Add `clearCustomHeader` and `replaceCustomHeader` methods
|
||||
* Add support for the XCLIENT SMTP extension with `setSMTPXclientAttribute` and `getSMTPXclientAttributes` methods
|
||||
* Don't attempt opportunistic TLS when connecting to localhost
|
||||
* Add package link and example showing how to use @decomplexity's SendOauth2 wrapper
|
||||
* Update example to show a better way of using an SMTP subclass
|
||||
* Avoid some more deprecation warnings
|
||||
* Update Danish and Polish translations
|
||||
* Add Bengali and Assamese translations
|
||||
|
||||
## Version 6.8.1 (August 29th, 2023)
|
||||
* Don't reflect malformed DSNs in error messages to avert any risk of XSS
|
||||
* Improve Simplified Chinese, Sinhalese, and Norwegian translations
|
||||
* Don't use `setAccessible` in PHP >= 8.1 in tests
|
||||
* Avoid a deprecation notice in PHP 8.3
|
||||
* Fix link in readme
|
||||
|
||||
## Version 6.8.0 (March 6th, 2023)
|
||||
* Add DSN parsing class, thanks to @voronkovich
|
||||
* Fix some name edge cases, expand tests
|
||||
* Add pattern for ZonMTA message IDs
|
||||
* Improve Hindi translation
|
||||
|
||||
## Version 6.7.1 (December 8th, 2022)
|
||||
* Add official support for PHP 8.2
|
||||
* Add PHP 8.3 to test suite with "experimental" status
|
||||
* Add ext-openssl to composer suggest list
|
||||
* Bump development dependencies
|
||||
|
||||
## Version 6.7 (December 5th, 2022)
|
||||
* Break out boundary definitions into a method (note that boundary format has also changed slightly)
|
||||
* Remove MIME preamble to match popular client behaviour, may help with DKIM too
|
||||
* Fix handling of trailing whitespace in simple DKIM canonicalisation
|
||||
* Fix some possible POP3 auth issues, including a TCP hang (thanks to @czirkoszoltan)
|
||||
* Add Azure XOAUTH2 example and docs (thanks to @greew)
|
||||
* Preserve errors during disconnect
|
||||
* Avoid some PHP 8.1 type issues
|
||||
* Update CI to run on Ubuntu 22.04
|
||||
|
||||
## Version 6.6.5 (October 7th, 2022)
|
||||
|
||||
* Don't try to issue RSET if there has been a connection error
|
||||
* Reject attempts to add folders as attachments
|
||||
* Don't suppress earlier error messages on close()
|
||||
* Handle Host === null better
|
||||
* Update Danish and Polish translations
|
||||
* Change recommendation for Microsoft OAuth package to thenetworg/oauth2-azure
|
||||
* Bump some GitHub action versions
|
||||
|
||||
## Version 6.6.4 (August 22nd, 2022)
|
||||
* Update Greek translation
|
||||
* Add text/csv MIME type
|
||||
* Fix DKIM when sending to anonymous group via mail()
|
||||
* Improve docs around auth following gmail & MS deprecations
|
||||
* Update GitHub action deps
|
||||
* Add OpenSSF Scorecard security health metrics
|
||||
|
||||
## Version 6.6.3 (June 20th, 2022)
|
||||
* Add an HTML form to the OAuth setup script
|
||||
* Minor CS improvements
|
||||
* Add Mongolian translation
|
||||
* Remove bogus "ch" translation
|
||||
|
||||
## Version 6.6.2 (June 14th, 2022)
|
||||
* Fix docs deployment GitHub action
|
||||
* Updates to parallel-lint and console highlighter, thanks to @jrfnl
|
||||
|
||||
## Version 6.6.1 (June 14th, 2022) (unreleased)
|
||||
* Don't clear errors on RSET, so they can still be obtained when using keepalive
|
||||
* Bump some GitHub action versions
|
||||
* Fix some tests
|
||||
* 🇺🇦 Slava Ukraini!
|
||||
|
||||
## Version 6.6 (February 28th, 2022)
|
||||
* Introduce interface for OAuth providers, making it easier to use OAuth libraries other than the League one, thanks to @pdscopes.
|
||||
* Add more contextual information to TLS connection failure error messages, and throw exceptions on TLS connection errors, thanks to @miken32
|
||||
|
||||
## Version 6.5.4 (February 17th, 2022)
|
||||
* If we can't use escaping functions, refuse to do unsafe things
|
||||
* Avoid PHP 8.1 trim issue
|
||||
* Add tests for XMailer
|
||||
* Fix bug in use of CharSet property
|
||||
* Fix bug in file upload example
|
||||
* Update dev dependencies
|
||||
|
||||
## Version 6.5.3 (November 25th, 2021)
|
||||
* Wrong commit tagged for the 6.5.2 release!
|
||||
* Version file updated
|
||||
|
||||
## Version 6.5.2 (November 25th, 2021)
|
||||
* Enable official support for PHP 8.1
|
||||
* Enable experimental support for PHP 8.2
|
||||
* Fix for PHP 5.6
|
||||
* Fix for incorrect options for punyencoding IDNs
|
||||
|
||||
## Version 6.5.1 (August 18th, 2021)
|
||||
* Provisional support for PHP 8.1
|
||||
* Major overhaul of test suite
|
||||
* Add codecov.io coverage reporting
|
||||
* Prefer implicit TLS on port 465 as default encryption scheme in examples, as per RFC8314
|
||||
* Fix potential noisy output from IMAP address parser
|
||||
* Stricter checking of custom MessageID validity
|
||||
* Replace invalid default From address
|
||||
* Support fallback for languages, so a request for `pt_xx` will fall back to `pt` rather than the default `en`.
|
||||
* Support multi-line RFC2047 addresses in parseAddresses
|
||||
* Improved Japanese translation
|
||||
|
||||
Many thanks to @jrfnl for all her work.
|
||||
|
||||
## Version 6.5.0 (June 16th, 2021)
|
||||
* **SECURITY** Fixes CVE-2021-34551, a complex RCE affecting Windows hosts. See [SECURITY.md](SECURITY.md) for details.
|
||||
* The fix for this issue changes the way that language files are loaded. While they remain in the same PHP-like format, they are processed as plain text, and any code in them will not be run, including operations such as concatenation using the `.` operator.
|
||||
* *Deprecation* The current translation file format using PHP arrays is now deprecated; the next major version will introduce a new format.
|
||||
* **SECURITY** Fixes CVE-2021-3603 that may permit untrusted code to be run from an address validator. See [SECURITY.md](SECURITY.md) for details.
|
||||
* The fix for this issue includes a minor BC break: callables injected into `validateAddress`, or indirectly through the `$validator` class property, may no longer be simple strings. If you want to inject your own validator, provide a closure instead of a function name.
|
||||
* Haraka message ID strings are now recognised
|
||||
|
||||
## Version 6.4.1 (April 29th, 2021)
|
||||
* **SECURITY** Fixes CVE-2020-36326, a regression of CVE-2018-19296 object injection introduced in 6.1.8, see SECURITY.md for details
|
||||
* Reject more file paths that look like URLs, matching RFC3986 spec, blocking URLS using schemes such as `ssh2`
|
||||
* Ensure method signature consistency in `doCallback` calls
|
||||
* Ukrainian language update
|
||||
* Add composer scripts for checking coding standards and running tests
|
||||
|
||||
## Version 6.4.0 (March 31st, 2021)
|
||||
* Revert change that made the `mail()` and sendmail transports set the envelope sender if one isn't explicitly provided, as it causes problems described in <https://github.com/PHPMailer/PHPMailer/issues/2298>
|
||||
* Check for mbstring extension before decoding addresss in `parseAddress`
|
||||
* Add Serbian Latin translation (`sr_latn`)
|
||||
* Enrol PHPMailer in Tidelift
|
||||
|
||||
## Version 6.3.0 (February 19th, 2021)
|
||||
* Handle early connection errors such as 421 during connection and EHLO states
|
||||
* Switch to GitHub Actions for CI
|
||||
* 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
|
||||
|
|
@ -276,7 +81,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://www.rfc-editor.org/rfc/rfc2387#section-3.1) in `multipart/related` structures.
|
||||
* Add support for [RFC2387 child element content-type hint](https://tools.ietf.org/html/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
|
||||
|
|
@ -351,7 +156,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)
|
||||
|
|
@ -410,7 +215,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()`.
|
||||
|
|
@ -424,7 +229,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 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.
|
||||
* **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.
|
||||
* 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.
|
||||
|
|
@ -853,10 +658,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
|
||||
|
|
@ -941,7 +746,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: https://sourceforge.net/p/phpmailer/bugs/120/
|
||||
* Fixed alt attachments bug: http://tinyurl.com/98u9k
|
||||
|
||||
## Version 1.72 (Wed, May 25 2004)
|
||||
* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations.
|
||||
|
|
@ -1058,7 +863,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: https://bugs.php.net/bug.php?id=11616
|
||||
(See PHP bug report: http://www.php.net/bugs.php?id=11616)
|
||||
* mail() no longer passes a fifth parameter when not needed
|
||||
|
||||
## Version 1.15 (Fri, Jun 15 2001)
|
||||
|
|
|
|||
|
|
@ -25,12 +25,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||
},
|
||||
"lock": false
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5.0",
|
||||
"ext-ctype": "*",
|
||||
|
|
@ -38,29 +32,21 @@
|
|||
"ext-hash": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"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"
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
|
||||
"doctrine/annotations": "^1.2",
|
||||
"phpcompatibility/php-compatibility": "^9.3.5",
|
||||
"roave/security-advisories": "dev-latest",
|
||||
"squizlabs/php_codesniffer": "^3.5.6",
|
||||
"yoast/phpunit-polyfills": "^0.2.0"
|
||||
},
|
||||
"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",
|
||||
"ext-mbstring": "Needed to send email in multibyte encoding charset",
|
||||
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
|
||||
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
|
||||
"psr/log": "For optional PSR-3 debug logging",
|
||||
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
|
||||
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication",
|
||||
"directorytree/imapengine": "For uploading sent messages via IMAP, see gmail example"
|
||||
"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)"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"PHPMailer\\PHPMailer\\": "src/"
|
||||
|
|
@ -71,14 +57,5 @@
|
|||
"PHPMailer\\Test\\": "test/"
|
||||
}
|
||||
},
|
||||
"license": "LGPL-2.1-only",
|
||||
"scripts": {
|
||||
"check": "./vendor/bin/phpcs",
|
||||
"style": "./vendor/bin/phpcbf",
|
||||
"test": "./vendor/bin/phpunit --no-coverage",
|
||||
"coverage": "./vendor/bin/phpunit",
|
||||
"lint": [
|
||||
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . --show-deprecated -e php,phps --exclude vendor --exclude .git --exclude build"
|
||||
]
|
||||
}
|
||||
"license": "LGPL-2.1-only"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@
|
|||
* You should only need to do this once, and the public key (**not** the private key!)
|
||||
* you generate should be inserted in your DNS matching the selector you want.
|
||||
*
|
||||
* You can also use the DKIM wizard here: https://www.sparkpost.com/resources/tools/dkim-wizard/
|
||||
* You can also use the DKIM wizard here: https://www.port25.com/support/domainkeysdkim-wizard/
|
||||
* but be aware that having your private key known anywhere outside your own server
|
||||
* is a security risk, and it's easy enough to create your own on your own server.
|
||||
*
|
||||
* For security, any keys you create should not be accessible via your web site.
|
||||
*
|
||||
* 2048 bits is the recommended minimum key length - gmail won't accept less than 1024 bits.
|
||||
* To test your DKIM config, use Sparkpost's DKIM tester:
|
||||
* https://tools.sparkpost.com/dkim
|
||||
* To test your DKIM config, use Port25's DKIM tester:
|
||||
* https://www.port25.com/support/authentication-center/email-verification/
|
||||
*
|
||||
* Note that you only need a *private* key to *send* a DKIM-signed message,
|
||||
* but receivers need your *public* key in order to verify it.
|
||||
|
|
@ -55,11 +55,11 @@ if (file_exists($privatekeyfile)) {
|
|||
echo "Private key (keep this private!):\n\n" . $privatekey;
|
||||
echo "\n\nPublic key:\n\n" . $publickey;
|
||||
|
||||
//Prepare public key for DNS, e.g.
|
||||
//Prep public key for DNS, e.g.
|
||||
//phpmailer._domainkey.example.com IN TXT "v=DKIM1; h=sha256; t=s; p=" "MIIBIjANBg...oXlwIDAQAB"...
|
||||
$dnskey = "$selector._domainkey.$domain IN TXT";
|
||||
$dnsvalue = '"v=DKIM1; h=sha256; t=s; p=" ';
|
||||
//Some DNS servers don't like ;(semi colon) chars unless backslash-escaped
|
||||
//Some DNS server don't like ; chars unless backslash-escaped
|
||||
$dnsvalue2 = '"v=DKIM1\; h=sha256\; t=s\; p=" ';
|
||||
|
||||
//Strip and split the key into smaller parts and format for DNS
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* This example shows sending a DKIM-signed message with PHPMailer.
|
||||
* More info about DKIM can be found here: https://www.dkim.org/info/dkim-faq.html
|
||||
* More info about DKIM can be found here: http://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,
|
||||
|
|
|
|||
|
|
@ -8,15 +8,14 @@ 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](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.
|
||||
* [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.
|
||||
* [smtp4dev](https://github.com/rnwood/smtp4dev), a dummy SMTP server for Windows and Linux.
|
||||
* [fakesendmail.sh](https://github.com/PHPMailer/PHPMailer/blob/master/test/fakesendmail.sh), part of PHPMailer's test setup, this is a shell script that emulates sendmail for testing 'mail' or 'sendmail' methods in PHPMailer.
|
||||
* [HELO](https://usehelo.com), a very nice (commercial) mail server desktop app from BeyondCode, and [how to set it up for local testing](https://usehelo.com/blog/how-to-use-helo-with-phps-mail-function).
|
||||
* [msglint](https://www.splitbrain.org/_static/msglint/), not a mail server, the IETF's MIME structure analyser checks the formatting of your messages.
|
||||
* [msglint](http://tools.ietf.org/tools/msglint/), not a mail server, the IETF's MIME structure analyser checks the formatting of your messages.
|
||||
* [MailHog](https://github.com/les-enovateurs/mailhog-examples), a Go-based email testing tool for developers with a web interface. You can use it with Docker and GitHub Actions to test your mails. The repository also contains a small part of PHPMailer's setup.
|
||||
* [aboutmy.email](https://aboutmy.email), a service for evaluating your email config – SPF, DKIM, DMARC, and compliance with list-unsubscribe, TLS, and many other settings.
|
||||
|
||||
Most of these examples use the `example.com` and `example.net` domains. These domains are reserved by IANA for illustrative purposes, as documented in [RFC 2606](https://www.rfc-editor.org/rfc/rfc2606). Don't use made-up domains like 'mydomain.com' or 'somedomain.com' in examples as someone, somewhere, probably owns them!
|
||||
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!
|
||||
|
||||
## 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!_
|
||||
|
|
|
|||
|
|
@ -1,126 +0,0 @@
|
|||
<?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!';
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -31,15 +31,11 @@ $mail->Host = 'smtp.gmail.com';
|
|||
//if your network does not support SMTP over IPv6,
|
||||
//though this may cause issues with TLS
|
||||
|
||||
//Set the SMTP port number:
|
||||
// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or
|
||||
// - 587 for SMTP+STARTTLS
|
||||
$mail->Port = 465;
|
||||
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
|
||||
$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_SMTPS;
|
||||
//Set the encryption mechanism to use - STARTTLS or SMTPS
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
|
||||
//Whether to use SMTP authentication
|
||||
$mail->SMTPAuth = true;
|
||||
|
|
@ -51,13 +47,9 @@ $mail->Username = 'username@gmail.com';
|
|||
$mail->Password = 'yourpassword';
|
||||
|
||||
//Set who the message is to be sent from
|
||||
//Note that with gmail you can only use your account address (same as `Username`)
|
||||
//or predefined aliases that you have configured within your account.
|
||||
//Do not use user-submitted addresses in here
|
||||
$mail->setFrom('from@example.com', 'First Last');
|
||||
|
||||
//Set an alternative reply-to address
|
||||
//This is a good place to put user-submitted addresses
|
||||
$mail->addReplyTo('replyto@example.com', 'First Last');
|
||||
|
||||
//Set who the message is to be sent to
|
||||
|
|
@ -83,24 +75,26 @@ if (!$mail->send()) {
|
|||
echo 'Message sent!';
|
||||
//Section 2: IMAP
|
||||
//Uncomment these to save your message in the 'Sent Mail' folder.
|
||||
#save_mail($mail->getSentMIMEMessage());
|
||||
#if (save_mail($mail)) {
|
||||
# echo "Message saved!";
|
||||
#}
|
||||
}
|
||||
|
||||
//Section 2: IMAP
|
||||
//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)
|
||||
//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)
|
||||
{
|
||||
$mailbox = new \DirectoryTree\ImapEngine\Mailbox([
|
||||
'host' => 'imap.gmail.com',
|
||||
'port' => 993,
|
||||
'encryption' => 'ssl',
|
||||
'username' => 'user@example.com',
|
||||
'password' => 'password',
|
||||
]);
|
||||
//You can change 'Sent Mail' to any other folder or tag
|
||||
$path = '{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail';
|
||||
|
||||
// Find the "sent" messages folder – yours may have a different name.
|
||||
$folder = $mailbox->folders()->find('Sent Mail');
|
||||
//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);
|
||||
|
||||
$folder->messages()->append($message);
|
||||
$result = imap_append($imapStream, $path, $mail->getSentMIMEMessage());
|
||||
imap_close($imapStream);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This example shows how to send via Google's Gmail servers using XOAUTH2 authentication
|
||||
* using the league/oauth2-client to provide the OAuth2 token.
|
||||
* To use a different OAuth2 library create a wrapper class that implements OAuthTokenProvider and
|
||||
* pass that wrapper class to PHPMailer::setOAuth().
|
||||
* This example shows how to send via Google's Gmail servers using XOAUTH2 authentication.
|
||||
*/
|
||||
|
||||
//Import PHPMailer classes into the global namespace
|
||||
|
|
@ -37,15 +34,11 @@ $mail->SMTPDebug = SMTP::DEBUG_SERVER;
|
|||
//Set the hostname of the mail server
|
||||
$mail->Host = 'smtp.gmail.com';
|
||||
|
||||
//Set the SMTP port number:
|
||||
// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or
|
||||
// - 587 for SMTP+STARTTLS
|
||||
$mail->Port = 465;
|
||||
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
|
||||
$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_SMTPS;
|
||||
//Set the encryption mechanism to use - STARTTLS or SMTPS
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
|
||||
//Whether to use SMTP authentication
|
||||
$mail->SMTPAuth = true;
|
||||
|
|
@ -53,7 +46,6 @@ $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 gmail account owner, or the user that gave consent
|
||||
$email = 'someone@gmail.com';
|
||||
|
|
@ -84,16 +76,6 @@ $mail->setOAuth(
|
|||
]
|
||||
)
|
||||
);
|
||||
//End Option 1
|
||||
|
||||
//Option 2: Another OAuth library as OAuth2 token provider
|
||||
//Set up the other oauth library as per its documentation
|
||||
//Then create the wrapper class that implements OAuthTokenProvider
|
||||
$oauthTokenProvider = new MyOAuthTokenProvider(/* Email, ClientId, ClientSecret, etc. */);
|
||||
|
||||
//Pass the implementation of OAuthTokenProvider to PHPMailer
|
||||
$mail->setOAuth($oauthTokenProvider);
|
||||
//End Option 2
|
||||
|
||||
//Set who the message is to be sent from
|
||||
//For gmail, this generally needs to be the same as the user you logged in as
|
||||
|
|
@ -113,6 +95,9 @@ $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;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
error_reporting(E_ALL);
|
||||
error_reporting(E_STRICT | E_ALL);
|
||||
|
||||
date_default_timezone_set('Etc/UTC');
|
||||
|
||||
|
|
@ -28,10 +28,7 @@ $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
|
||||
|
|
@ -51,29 +48,18 @@ foreach ($result as $row) {
|
|||
try {
|
||||
$mail->addAddress($row['email'], $row['full_name']);
|
||||
} catch (Exception $e) {
|
||||
printf(
|
||||
'Invalid address skipped: %s<br>',
|
||||
htmlspecialchars($row['email'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401)
|
||||
);
|
||||
echo 'Invalid address skipped: ' . htmlspecialchars($row['email']) . '<br>';
|
||||
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();
|
||||
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)
|
||||
);
|
||||
echo 'Message sent to :' . htmlspecialchars($row['full_name']) . ' (' .
|
||||
htmlspecialchars($row['email']) . ')<br>';
|
||||
//Mark it as sent in the DB
|
||||
mysqli_query(
|
||||
$mysql,
|
||||
|
|
@ -81,11 +67,7 @@ foreach ($result as $row) {
|
|||
mysqli_real_escape_string($mysql, $row['email']) . "'"
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
printf(
|
||||
'Mailer Error (%s) %s<br>',
|
||||
htmlspecialchars($row['email'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401),
|
||||
$mail->ErrorInfo
|
||||
);
|
||||
echo 'Mailer Error (' . htmlspecialchars($row['email']) . ') ' . $mail->ErrorInfo . '<br>';
|
||||
//Reset the connection to abort sending this message
|
||||
//The loop will continue trying to send to the rest of the list
|
||||
$mail->getSMTPInstance()->reset();
|
||||
|
|
|
|||
|
|
@ -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 https://www.php.net/manual/en/features.file-upload.php#114004 for more thorough upload validation
|
||||
//See http://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, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401);
|
||||
echo htmlspecialchars($msg);
|
||||
} ?>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
@ -20,7 +20,7 @@ if (array_key_exists('userfile', $_FILES)) {
|
|||
//Attach multiple files one by one
|
||||
for ($ct = 0, $ctMax = count($_FILES['userfile']['tmp_name']); $ct < $ctMax; $ct++) {
|
||||
//Extract an extension from the provided filename
|
||||
$ext = PHPMailer::mb_pathinfo($_FILES['userfile']['name'][$ct], PATHINFO_EXTENSION);
|
||||
$ext = PHPMailer::mb_pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION);
|
||||
//Define a safe location to move the uploaded file to, preserving the extension
|
||||
$uploadfile = tempnam(sys_get_temp_dir(), hash('sha256', $_FILES['userfile']['name'][$ct])) . '.' . $ext;
|
||||
$filename = $_FILES['userfile']['name'][$ct];
|
||||
|
|
@ -54,7 +54,7 @@ if (array_key_exists('userfile', $_FILES)) {
|
|||
<input type="submit" value="Send Files">
|
||||
</form>
|
||||
<?php } else {
|
||||
echo htmlspecialchars($msg, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401);
|
||||
echo htmlspecialchars($msg);
|
||||
} ?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,100 +0,0 @@
|
|||
<?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);
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ use PHPMailer\PHPMailer\PHPMailer;
|
|||
|
||||
require '../vendor/autoload.php';
|
||||
|
||||
if (array_key_exists('email', $_POST)) {
|
||||
if (array_key_exists('to', $_POST)) {
|
||||
$err = false;
|
||||
$msg = '';
|
||||
$email = '';
|
||||
|
|
@ -45,7 +45,7 @@ if (array_key_exists('email', $_POST)) {
|
|||
$to = 'support@example.com';
|
||||
}
|
||||
//Make sure the address they provided is valid before trying to use it
|
||||
if (PHPMailer::validateAddress($_POST['email'])) {
|
||||
if (array_key_exists('email', $_POST) && PHPMailer::validateAddress($_POST['email'])) {
|
||||
$email = $_POST['email'];
|
||||
} else {
|
||||
$msg .= 'Error: invalid email address provided';
|
||||
|
|
@ -99,4 +99,4 @@ if (array_key_exists('email', $_POST)) {
|
|||
echo $msg;
|
||||
} ?>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
@ -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: https://kb.mozillazine.org/Getting_an_SMIME_certificate
|
||||
* Check out this link for more providers: http://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.
|
||||
|
|
|
|||
|
|
@ -49,11 +49,6 @@ $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;
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@
|
|||
* SMTP low memory example.
|
||||
*/
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\SMTP;
|
||||
namespace PHPMailer\PHPMailer;
|
||||
|
||||
require '../vendor/autoload.php';
|
||||
|
||||
/**
|
||||
* This class demonstrates sending an already-built RFC822 message via SMTP
|
||||
* by extending PHPMailer's SMTP class.
|
||||
* It uses less memory than PHPMailer's usual approach because it keeps
|
||||
* It uses less memory that PHPMailer's usual approach because it keeps
|
||||
* the message as a single string rather than splitting its lines into
|
||||
* an array, which can consume very large amounts of memory if you have
|
||||
* large attachments. The downside is that it's somewhat slower.
|
||||
|
|
@ -30,10 +31,8 @@ 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 '.' (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.
|
||||
* We will also look for lines that start with a '.' and prepend an additional '.'.
|
||||
* NOTE: this does not count towards line-length limit.
|
||||
*/
|
||||
|
||||
//Normalize line breaks
|
||||
|
|
@ -111,7 +110,22 @@ class SMTPLowMemory extends 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
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,20 +24,16 @@ $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_CONNECTION;
|
||||
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
|
||||
|
||||
//Set the hostname of the mail server
|
||||
$mail->Host = 'smtp.example.com';
|
||||
|
||||
//Set the SMTP port number:
|
||||
// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or
|
||||
// - 587 for SMTP+STARTTLS
|
||||
$mail->Port = 465;
|
||||
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
|
||||
$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_SMTPS;
|
||||
//Set the encryption mechanism to use - STARTTLS or SMTPS
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
|
||||
//Custom connection options
|
||||
//Note that these settings are INSECURE
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
* @copyright 2012 - 2020 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
|
||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
|
@ -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 https://oauth2-client.thephpleague.com/providers/thirdparty/
|
||||
* @see http://oauth2-client.thephpleague.com/providers/thirdparty/
|
||||
*/
|
||||
//@see https://github.com/thephpleague/oauth2-google
|
||||
use League\OAuth2\Client\Provider\Google;
|
||||
|
|
@ -44,31 +44,14 @@ 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($_POST['provider'])) {
|
||||
if (!isset($_GET['code']) && !isset($_GET['provider'])) {
|
||||
?>
|
||||
<html>
|
||||
<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>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>
|
||||
</html>
|
||||
<?php
|
||||
|
|
@ -80,29 +63,21 @@ require 'vendor/autoload.php';
|
|||
session_start();
|
||||
|
||||
$providerName = '';
|
||||
$clientId = '';
|
||||
$clientSecret = '';
|
||||
$tenantId = '';
|
||||
|
||||
if (array_key_exists('provider', $_POST)) {
|
||||
$providerName = $_POST['provider'];
|
||||
$clientId = $_POST['clientId'];
|
||||
$clientSecret = $_POST['clientSecret'];
|
||||
$tenantId = $_POST['tenantId'];
|
||||
if (array_key_exists('provider', $_GET)) {
|
||||
$providerName = $_GET['provider'];
|
||||
$_SESSION['provider'] = $providerName;
|
||||
$_SESSION['clientId'] = $clientId;
|
||||
$_SESSION['clientSecret'] = $clientSecret;
|
||||
$_SESSION['tenantId'] = $tenantId;
|
||||
} elseif (array_key_exists('provider', $_SESSION)) {
|
||||
$providerName = $_SESSION['provider'];
|
||||
$clientId = $_SESSION['clientId'];
|
||||
$clientSecret = $_SESSION['clientSecret'];
|
||||
$tenantId = $_SESSION['tenantId'];
|
||||
}
|
||||
if (!in_array($providerName, ['Google', 'Microsoft', 'Yahoo'])) {
|
||||
exit('Only Google, Microsoft and Yahoo OAuth2 providers are currently supported in this script.');
|
||||
}
|
||||
|
||||
//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';
|
||||
//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 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'];
|
||||
|
|
@ -139,17 +114,6 @@ 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) {
|
||||
|
|
@ -178,5 +142,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: ', htmlspecialchars($token->getRefreshToken(), ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401);
|
||||
echo 'Refresh Token: ', $token->getRefreshToken();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ $PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة ا
|
|||
$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية فشل في الارسال لكل من : ';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية ' .
|
||||
'فشل في الارسال لكل من : ';
|
||||
$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: ';
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
<?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'] = 'অনুপস্থিত সম্প্ৰসাৰণ: ';
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?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'] = 'অনুপস্থিত এক্সটেনশন: ';
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?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: ';
|
||||
|
|
@ -9,31 +9,21 @@
|
|||
*/
|
||||
|
||||
$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 fejlede: ';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: ';
|
||||
$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['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: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: ';
|
||||
|
|
|
|||
|
|
@ -5,29 +5,22 @@
|
|||
* @package PHPMailer
|
||||
*/
|
||||
|
||||
$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['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['mailer_not_supported'] = ' mailer δεν υποστηρίζεται.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Δώστε τουλάχιστον μια ηλεκτρονική διεύθυνση παραλήπτη.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Σφάλμα SMTP: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Παρακαλούμε δώστε τουλάχιστον μια e-mail διεύθυνση παραλήπτη.';
|
||||
$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['smtp_connect_failed'] = 'Αποτυχία σύνδεσης στον SMTP Server.';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα από τον SMTP Server: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή αρχικοποίησης μεταβλητής: ';
|
||||
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
||||
|
|
|
|||
|
|
@ -3,35 +3,24 @@
|
|||
/**
|
||||
* Esperanto PHPMailer language file: refer to English translation for definitive list
|
||||
* @package PHPMailer
|
||||
* @author Robin van der Vliet <info@robinvandervliet.com>
|
||||
*/
|
||||
|
||||
$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['authenticate'] = 'Eraro de servilo SMTP : aŭtentigo malsukcesis.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Eraro de servilo SMTP : konektado al servilo malsukcesis.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Eraro de servilo SMTP : neĝustaj datumoj.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Teksto de mesaĝo mankas.';
|
||||
$PHPMAILER_LANG['encoding'] = 'Nekonata kodoprezento: ';
|
||||
$PHPMAILER_LANG['execute'] = '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: ';
|
||||
$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: ';
|
||||
|
|
|
|||
|
|
@ -4,35 +4,24 @@
|
|||
* 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 siguiente dirección de remitente falló: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
|
||||
$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['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: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: ';
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ $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ö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: ';
|
||||
|
|
|
|||
|
|
@ -6,31 +6,27 @@
|
|||
* 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 l’authentification.';
|
||||
$PHPMAILER_LANG['buggy_php'] = 'Votre version de PHP est affectée par un bug qui peut entraîner des messages corrompus. Pour résoudre ce problème, passez à l’envoi par SMTP, désactivez l’option mail.add_x_header dans le fichier php.ini, passez à MacOS ou Linux, ou passez PHP à la version 7.0.17+ ou 7.1.3+.';
|
||||
$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l\'authentification.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : impossible de se connecter au serveur SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Erreur SMTP : données incorrectes.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Corps du message vide.';
|
||||
$PHPMAILER_LANG['encoding'] = 'Encodage inconnu : ';
|
||||
$PHPMAILER_LANG['execute'] = 'Impossible de lancer l’exécution : ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Impossible d’accéder au fichier : ';
|
||||
$PHPMAILER_LANG['execute'] = 'Impossible de lancer l\'exécution : ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Impossible d\'accéder au fichier : ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Ouverture du fichier impossible : ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'L’adresse d’expéditeur suivante a échoué : ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Impossible d’instancier la fonction mail.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Adresse courriel non valide : ';
|
||||
$PHPMAILER_LANG['invalid_header'] = 'Nom ou valeur de l’en-tête non valide';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Entrée d’hôte non valide : ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'Hôte non valide : ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échoué : ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide : ';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'L\'entrée hôte n\'est pas valide : ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'L\'hôte n\'est pas valide : ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants ont échoué : ';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants sont en erreur : ';
|
||||
$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é.';
|
||||
$PHPMAILER_LANG['smtp_detail'] = 'Détails : ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Échec de la connexion SMTP.';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Impossible d’initialiser ou de réinitialiser une variable : ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Impossible d\'initialiser ou de réinitialiser une variable : ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : ';
|
||||
|
|
|
|||
|
|
@ -4,32 +4,24 @@
|
|||
* 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['smtp_code'] = 'SMTP कोड: ';
|
||||
$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: ';
|
||||
$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। ';
|
||||
$PHPMAILER_LANG['smtp_detail'] = 'विवरण: ';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';
|
||||
|
|
|
|||
|
|
@ -3,35 +3,26 @@
|
|||
/**
|
||||
* Japanese PHPMailer language file: refer to English translation for definitive list
|
||||
* @package PHPMailer
|
||||
* @author Mitsuhiro Yoshida <https://mitstek.com>
|
||||
* @author Mitsuhiro Yoshida <http://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['empty_message'] = 'Message body empty';
|
||||
$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['invalid_header'] = '不正なヘッダー名またはその内容';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = '不正なホストエントリー: ';
|
||||
$PHPMAILER_LANG['invalid_host'] = '不正なホスト: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
|
||||
//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
|
||||
$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
|
||||
$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['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: ';
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
<?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'] = 'درێژکراوە نەماوە: ';
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<?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'] = 'Өргөтгөл байхгүй: ';
|
||||
|
|
@ -3,35 +3,24 @@
|
|||
/**
|
||||
* 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['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: ';
|
||||
$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: ';
|
||||
|
|
|
|||
|
|
@ -4,35 +4,26 @@
|
|||
* 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 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';
|
||||
$PHPMAILER_LANG['encoding'] = 'Onbekende codering: ';
|
||||
$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 afzenderadres is mislukt: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: ';
|
||||
$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_detail'] = 'Detail: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: ';
|
||||
$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: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: ';
|
||||
|
|
|
|||
|
|
@ -5,29 +5,23 @@
|
|||
* @package PHPMailer
|
||||
*/
|
||||
|
||||
$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['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['file_access'] = 'Brak dostępu do pliku: ';
|
||||
$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['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['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
|
||||
$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['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: ';
|
||||
$PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zakończone niepowodzeniem.';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: ';
|
||||
|
|
|
|||
|
|
@ -3,32 +3,25 @@
|
|||
/**
|
||||
* Portuguese (European) PHPMailer language file: refer to English translation for definitive list
|
||||
* @package PHPMailer
|
||||
* @author João Vieira <mail@joaovieira.eu>
|
||||
* @author Jonadabe <jonadabe@hotmail.com>
|
||||
*/
|
||||
|
||||
$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['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['encoding'] = 'Codificação desconhecida: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
|
||||
$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['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_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['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: ';
|
||||
|
|
|
|||
|
|
@ -7,32 +7,24 @@
|
|||
* @author Lucas Guimarães <lucas@lucasguimaraes.com>
|
||||
* @author Phelipe Alves <phelipealvesdesouza@gmail.com>
|
||||
* @author Fabio Beneditto <fabiobeneditto@gmail.com>
|
||||
* @author Geidson Benício Coelho <geidsonc@gmail.com>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.';
|
||||
$PHPMAILER_LANG['buggy_php'] = 'Sua versão do PHP é afetada por um bug que por resultar em messagens corrompidas. Para corrigir, mude para enviar usando SMTP, desative a opção mail.add_x_header em seu php.ini, mude para MacOS ou Linux, ou atualize seu PHP para versão 7.0.17+ ou 7.1.3+ ';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Mensagem vazia';
|
||||
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: ';
|
||||
$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 de cabeçalho inválido';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'hostentry inválido: ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'host inválido: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: ';
|
||||
$PHPMAILER_LANG['signing'] = 'Erro de Assinatura: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.';
|
||||
$PHPMAILER_LANG['smtp_code'] = 'Código do servidor SMTP: ';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: ';
|
||||
$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais do servidor SMTP: ';
|
||||
$PHPMAILER_LANG['smtp_detail'] = 'Detalhes do servidor SMTP: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: ';
|
||||
|
|
|
|||
|
|
@ -3,31 +3,25 @@
|
|||
/**
|
||||
* Romanian PHPMailer language file: refer to English translation for definitive list
|
||||
* @package PHPMailer
|
||||
* @author Alex Florea <alecz.fia@gmail.com>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.';
|
||||
$PHPMAILER_LANG['buggy_php'] = 'Versiunea instalată de PHP este afectată de o problemă care poate duce la coruperea mesajelor Pentru a preveni această problemă, folosiți SMTP, dezactivați opțiunea mail.add_x_header din php.ini, folosiți MacOS/Linux sau actualizați versiunea de PHP la 7.0.17+ sau 7.1.3+.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.';
|
||||
$PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fișier: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Eroare fișier: Nu se poate deschide următorul fișier: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Funcția mail nu a putut fi inițializată.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: ';
|
||||
$PHPMAILER_LANG['invalid_header'] = 'Numele sau valoarea header-ului nu este validă: ';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry invalid: ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'Host invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugați cel puțin o adresă de email.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eșuat: ';
|
||||
$PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. ';
|
||||
$PHPMAILER_LANG['smtp_code'] = 'Cod SMTP: ';
|
||||
$PHPMAILER_LANG['smtp_code_ex'] = 'Informații SMTP adiționale: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.';
|
||||
$PHPMAILER_LANG['smtp_detail'] = 'Detalii SMTP: ';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: ';
|
||||
|
|
|
|||
|
|
@ -5,32 +5,24 @@
|
|||
* @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['buggy_php'] = 'В вашей версии PHP есть ошибка, которая может привести к повреждению сообщений. Чтобы исправить, переключитесь на отправку по SMTP, отключите опцию mail.add_x_header в ваш php.ini, переключитесь на MacOS или Linux или обновите PHP до версии 7.0.17+ или 7.1.3+.';
|
||||
$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['extension_missing'] = 'Расширение отсутствует: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: ';
|
||||
$PHPMAILER_LANG['invalid_header'] = 'Неверное имя или значение заголовка';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Неверная запись хоста: ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'Неверный хост: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Вы должны указать хотя бы один адрес электронной почты получателя.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: Ошибка следующих получателей: ';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: ';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: ';
|
||||
$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_connect_failed'] = 'Ошибка соединения с SMTP-сервером';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: ';
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
<?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 එක සැකසීමට හෝ නැවත සැකසීමට නොහැක: ';
|
||||
|
|
@ -9,28 +9,23 @@
|
|||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.';
|
||||
$PHPMAILER_LANG['buggy_php'] = 'Na vašo PHP različico vpliva napaka, ki lahko povzroči poškodovana sporočila. Če želite težavo odpraviti, preklopite na pošiljanje prek SMTP, onemogočite možnost mail.add_x_header v vaši php.ini datoteki, preklopite na MacOS ali Linux, ali nadgradite vašo PHP zaličico na 7.0.17+ ali 7.1.3+.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.';
|
||||
$PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Operacija ni uspela: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: ';
|
||||
$PHPMAILER_LANG['invalid_header'] = 'Neveljavno ime ali vrednost glave';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: ';
|
||||
$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: ';
|
||||
$PHPMAILER_LANG['smtp_code'] = 'SMTP koda: ';
|
||||
$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatne informacije o SMTP: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.';
|
||||
$PHPMAILER_LANG['smtp_detail'] = 'Podrobnosti: ';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: ';
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Serbian PHPMailer language file: refer to English translation for definitive list
|
||||
* @package PHPMailer
|
||||
* @author Александар Јевремовић <ajevremovic@gmail.com>
|
||||
* @author Miloš Milanović <mmilanovic016@gmail.com>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.';
|
||||
$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: ';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.';
|
||||
$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: ';
|
||||
|
|
@ -11,28 +11,21 @@
|
|||
*/
|
||||
|
||||
$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ı: ';
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ $PHPMAILER_LANG['file_access'] = 'Немає доступу до фай
|
|||
$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Будь ласка, введіть хоча б одну email-адресу отримувача.';
|
||||
$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_address'] = 'Не відправлено через невірний формат email-адреси: ';
|
||||
$PHPMAILER_LANG['signing'] = 'Помилка підпису: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання з SMTP-сервером';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: ';
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
<?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'] = 'غلط ہیڈر کا نام یا قدر';
|
||||
|
|
@ -9,13 +9,11 @@
|
|||
*/
|
||||
|
||||
$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'] = '发送地址错误:';
|
||||
|
|
@ -24,13 +22,8 @@ $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['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'] = '详情:';
|
||||
$PHPMAILER_LANG['extension_missing'] = '丢失模块 Extension:';
|
||||
|
|
|
|||
|
|
@ -27,26 +27,13 @@
|
|||
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
|
||||
<exclude name="PSR12.Properties.ConstantVisibility.NotFound"/>
|
||||
</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 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>
|
||||
|
||||
</ruleset>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
|
||||
backupGlobals="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
convertDeprecationsToExceptions="true"
|
||||
verbose="true"
|
||||
colors="true"
|
||||
forceCoversAnnotation="false"
|
||||
|
|
|
|||
|
|
@ -1,245 +0,0 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* @copyright 2012 - 2020 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
|
||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
|
@ -35,6 +35,6 @@ class Exception extends \Exception
|
|||
*/
|
||||
public function errorMessage()
|
||||
{
|
||||
return '<strong>' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "</strong><br />\n";
|
||||
return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
* @copyright 2012 - 2020 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
|
||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
|
@ -29,11 +29,11 @@ use League\OAuth2\Client\Token\AccessToken;
|
|||
* OAuth - OAuth2 authentication wrapper class.
|
||||
* Uses the oauth2-client package from the League of Extraordinary Packages.
|
||||
*
|
||||
* @see https://oauth2-client.thephpleague.com
|
||||
* @see http://oauth2-client.thephpleague.com
|
||||
*
|
||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||
*/
|
||||
class OAuth implements OAuthTokenProvider
|
||||
class OAuth
|
||||
{
|
||||
/**
|
||||
* An instance of the League OAuth Client Provider.
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
<?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 - 2020 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;
|
||||
|
||||
/**
|
||||
* OAuthTokenProvider - OAuth2 token provider interface.
|
||||
* Provides base64 encoded OAuth2 auth strings for SMTP authentication.
|
||||
*
|
||||
* @see OAuth
|
||||
* @see SMTP::authenticate()
|
||||
*
|
||||
* @author Peter Scopes (pdscopes)
|
||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||
*/
|
||||
interface OAuthTokenProvider
|
||||
{
|
||||
/**
|
||||
* Generate a base64-encoded OAuth token ensuring that the access token has not expired.
|
||||
* The string to be base 64 encoded should be in the form:
|
||||
* "user=<user_email_address>\001auth=Bearer <access_token>\001\001"
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOauth64();
|
||||
}
|
||||
1136
src/PHPMailer.php
1136
src/PHPMailer.php
File diff suppressed because it is too large
Load Diff
30
src/POP3.php
30
src/POP3.php
|
|
@ -13,7 +13,7 @@
|
|||
* @copyright 2012 - 2020 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
|
||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
|
@ -45,9 +45,8 @@ 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 = '7.0.2';
|
||||
const VERSION = '6.3.0';
|
||||
|
||||
/**
|
||||
* Default POP3 port number.
|
||||
|
|
@ -251,9 +250,7 @@ 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(function () {
|
||||
call_user_func_array([$this, 'catchWarning'], func_get_args());
|
||||
});
|
||||
set_error_handler([$this, 'catchWarning']);
|
||||
|
||||
if (false === $port) {
|
||||
$port = static::DEFAULT_PORT;
|
||||
|
|
@ -311,7 +308,6 @@ class POP3
|
|||
{
|
||||
if (!$this->connected) {
|
||||
$this->setError('Not connected to POP3 server');
|
||||
return false;
|
||||
}
|
||||
if (empty($username)) {
|
||||
$username = $this->username;
|
||||
|
|
@ -340,21 +336,7 @@ class POP3
|
|||
*/
|
||||
public function disconnect()
|
||||
{
|
||||
// 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.
|
||||
try {
|
||||
$this->getResponse();
|
||||
} catch (Exception $e) {
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
$this->sendString('QUIT');
|
||||
//The QUIT command may cause the daemon to exit, which will kill our connection
|
||||
//So ignore errors here
|
||||
try {
|
||||
|
|
@ -362,10 +344,6 @@ class POP3
|
|||
} catch (Exception $e) {
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
// Clean up attributes.
|
||||
$this->connected = false;
|
||||
$this->pop_conn = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
246
src/SMTP.php
246
src/SMTP.php
|
|
@ -13,7 +13,7 @@
|
|||
* @copyright 2012 - 2020 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
|
||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
|
@ -34,9 +34,8 @@ 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 = '7.0.2';
|
||||
const VERSION = '6.3.0';
|
||||
|
||||
/**
|
||||
* SMTP line break constant.
|
||||
|
|
@ -52,18 +51,11 @@ 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://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.6
|
||||
* @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
|
|
@ -73,7 +65,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://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.5
|
||||
* @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
|
|
@ -153,28 +145,19 @@ class SMTP
|
|||
/**
|
||||
* Whether to use VERP.
|
||||
*
|
||||
* @see https://en.wikipedia.org/wiki/Variable_envelope_return_path
|
||||
* @see https://www.postfix.org/VERP_README.html Info on VERP
|
||||
* @see http://en.wikipedia.org/wiki/Variable_envelope_return_path
|
||||
* @see http://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 https://www.rfc-editor.org/rfc/rfc2821#section-4.5.3.2
|
||||
* @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
|
|
@ -197,28 +180,12 @@ 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})/',
|
||||
'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'
|
||||
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -291,8 +258,7 @@ class SMTP
|
|||
}
|
||||
//Is this a PSR-3 logger?
|
||||
if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) {
|
||||
//Remove trailing line breaks potentially added by calls to SMTP::client_send()
|
||||
$this->Debugoutput->debug(rtrim($str, "\r\n"));
|
||||
$this->Debugoutput->debug($str);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -305,7 +271,6 @@ class SMTP
|
|||
switch ($this->Debugoutput) {
|
||||
case 'error_log':
|
||||
//Don't output, just log
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
error_log($str);
|
||||
break;
|
||||
case 'html':
|
||||
|
|
@ -384,7 +349,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://www.rfc-editor.org/rfc/rfc5321#section-3.1
|
||||
//https://tools.ietf.org/html/rfc5321#section-3.1
|
||||
if ($responseCode === 554) {
|
||||
$this->quit();
|
||||
}
|
||||
|
|
@ -417,9 +382,7 @@ class SMTP
|
|||
$errstr = '';
|
||||
if ($streamok) {
|
||||
$socket_context = stream_context_create($options);
|
||||
set_error_handler(function () {
|
||||
call_user_func_array([$this, 'errorHandler'], func_get_args());
|
||||
});
|
||||
set_error_handler([$this, 'errorHandler']);
|
||||
$connection = stream_socket_client(
|
||||
$host . ':' . $port,
|
||||
$errno,
|
||||
|
|
@ -428,15 +391,14 @@ class SMTP
|
|||
STREAM_CLIENT_CONNECT,
|
||||
$socket_context
|
||||
);
|
||||
restore_error_handler();
|
||||
} else {
|
||||
//Fall back to fsockopen which should work in more places, but is missing some features
|
||||
$this->edebug(
|
||||
'Connection: stream_socket_client not available, falling back to fsockopen',
|
||||
self::DEBUG_CONNECTION
|
||||
);
|
||||
set_error_handler(function () {
|
||||
call_user_func_array([$this, 'errorHandler'], func_get_args());
|
||||
});
|
||||
set_error_handler([$this, 'errorHandler']);
|
||||
$connection = fsockopen(
|
||||
$host,
|
||||
$port,
|
||||
|
|
@ -444,8 +406,8 @@ class SMTP
|
|||
$errstr,
|
||||
$timeout
|
||||
);
|
||||
restore_error_handler();
|
||||
}
|
||||
restore_error_handler();
|
||||
|
||||
//Verify we connected properly
|
||||
if (!is_resource($connection)) {
|
||||
|
|
@ -495,16 +457,12 @@ 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(function () {
|
||||
call_user_func_array([$this, 'errorHandler'], func_get_args());
|
||||
});
|
||||
set_error_handler([$this, 'errorHandler']);
|
||||
$crypto_ok = stream_socket_enable_crypto(
|
||||
$this->smtp_conn,
|
||||
true,
|
||||
|
|
@ -524,7 +482,7 @@ class SMTP
|
|||
* @param string $username The user name
|
||||
* @param string $password The password
|
||||
* @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2)
|
||||
* @param OAuthTokenProvider $OAuth An optional OAuthTokenProvider instance for XOAUTH2 authentication
|
||||
* @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication
|
||||
*
|
||||
* @return bool True if successfully authenticated
|
||||
*/
|
||||
|
|
@ -595,8 +553,6 @@ class SMTP
|
|||
}
|
||||
//Send encoded username and password
|
||||
if (
|
||||
//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',
|
||||
base64_encode("\0" . $username . "\0" . $password),
|
||||
|
|
@ -636,48 +592,11 @@ class SMTP
|
|||
if (null === $OAuth) {
|
||||
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;
|
||||
}
|
||||
$oauth = $OAuth->getOauth64();
|
||||
|
||||
//Start authentication
|
||||
if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
@ -706,7 +625,7 @@ class SMTP
|
|||
}
|
||||
|
||||
//The following borrowed from
|
||||
//https://www.php.net/manual/en/function.mhash.php#27225
|
||||
//http://php.net/manual/en/function.mhash.php#27225
|
||||
|
||||
//RFC 2104 HMAC implementation for php.
|
||||
//Creates an md5 HMAC.
|
||||
|
|
@ -760,6 +679,7 @@ class SMTP
|
|||
*/
|
||||
public function close()
|
||||
{
|
||||
$this->setError('');
|
||||
$this->server_caps = null;
|
||||
$this->helo_rply = null;
|
||||
if (is_resource($this->smtp_conn)) {
|
||||
|
|
@ -770,30 +690,11 @@ 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 sent with the headers. Each header needs to be
|
||||
* finializing the mail transaction. $msg_data is the message
|
||||
* that is to be send 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>.
|
||||
|
|
@ -817,16 +718,15 @@ class SMTP
|
|||
* NOTE: this does not count towards line-length limit.
|
||||
*/
|
||||
|
||||
//Iterate over lines with normalized line breaks
|
||||
$lines = $this->iterateLines($msg_data);
|
||||
//Normalize line breaks before exploding
|
||||
$lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data));
|
||||
|
||||
/* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
|
||||
* of the first line (':' separated) does not contain a space then it _should_ be a header, and we will
|
||||
* 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.
|
||||
*/
|
||||
|
||||
$first_line = $lines->current();
|
||||
$field = substr($first_line, 0, strpos($first_line, ':'));
|
||||
$field = substr($lines[0], 0, strpos($lines[0], ':'));
|
||||
$in_headers = false;
|
||||
if (!empty($field) && strpos($field, ' ') === false) {
|
||||
$in_headers = true;
|
||||
|
|
@ -865,7 +765,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://www.rfc-editor.org/rfc/rfc5321#section-4.5.2
|
||||
//https://tools.ietf.org/html/rfc5321#section-4.5.2
|
||||
if (!empty($line_out) && $line_out[0] === '.') {
|
||||
$line_out = '.' . $line_out;
|
||||
}
|
||||
|
|
@ -983,15 +883,7 @@ 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> 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.
|
||||
* Implements RFC 821: MAIL <SP> FROM:<reverse-path> <CRLF>.
|
||||
*
|
||||
* @param string $from Source address of this message
|
||||
*
|
||||
|
|
@ -1000,11 +892,10 @@ class SMTP
|
|||
public function mail($from)
|
||||
{
|
||||
$useVerp = ($this->do_verp ? ' XVERP' : '');
|
||||
$useSmtputf8 = ($this->do_smtputf8 ? ' SMTPUTF8' : '');
|
||||
|
||||
return $this->sendCommand(
|
||||
'MAIL FROM',
|
||||
'MAIL FROM:<' . $from . '>' . $useSmtputf8 . $useVerp,
|
||||
'MAIL FROM:<' . $from . '>' . $useVerp,
|
||||
250
|
||||
);
|
||||
}
|
||||
|
|
@ -1070,25 +961,6 @@ 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.
|
||||
|
|
@ -1162,10 +1034,7 @@ class SMTP
|
|||
return false;
|
||||
}
|
||||
|
||||
//Don't clear the error store when using keepalive
|
||||
if ($command !== 'RSET') {
|
||||
$this->setError('');
|
||||
}
|
||||
$this->setError('');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1249,9 +1118,7 @@ class SMTP
|
|||
} else {
|
||||
$this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);
|
||||
}
|
||||
set_error_handler(function () {
|
||||
call_user_func_array([$this, 'errorHandler'], func_get_args());
|
||||
});
|
||||
set_error_handler([$this, 'errorHandler']);
|
||||
$result = fwrite($this->smtp_conn, $data);
|
||||
restore_error_handler();
|
||||
|
||||
|
|
@ -1300,7 +1167,7 @@ class SMTP
|
|||
if (!$this->server_caps) {
|
||||
$this->setError('No HELO/EHLO was sent');
|
||||
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!array_key_exists($name, $this->server_caps)) {
|
||||
|
|
@ -1312,7 +1179,7 @@ class SMTP
|
|||
}
|
||||
$this->setError('HELO handshake was used; No information about server extensions available');
|
||||
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
return $this->server_caps[$name];
|
||||
|
|
@ -1354,9 +1221,7 @@ 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(function () {
|
||||
call_user_func_array([$this, 'errorHandler'], func_get_args());
|
||||
});
|
||||
set_error_handler([$this, 'errorHandler']);
|
||||
$n = stream_select($selR, $selW, $selW, $this->Timelimit);
|
||||
restore_error_handler();
|
||||
|
||||
|
|
@ -1370,16 +1235,7 @@ 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 ||
|
||||
(
|
||||
// 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
|
||||
)
|
||||
) {
|
||||
if (stripos($message, 'interrupted system call') !== false) {
|
||||
$this->edebug(
|
||||
'SMTP -> get_lines(): retrying stream_select',
|
||||
self::DEBUG_LOWLEVEL
|
||||
|
|
@ -1452,26 +1308,6 @@ 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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @copyright 2010 - 2020 Marcus Bointon
|
||||
* @copyright 2004 - 2009 Andy Prevost
|
||||
* @copyright 2020 Juliette Reinders Folmer
|
||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||
*/
|
||||
|
||||
namespace PHPMailer\Test;
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
Testing 1-2-3
|
||||
|
|
@ -1 +0,0 @@
|
|||
Testing 1-2-3
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
-----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-----
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
-----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-----
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest` to test overruling an existing translation
|
||||
* file with a custom one by passing in a `$langPath` parameter.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['empty_message'] = "Custom path test success (fr)";
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest` to test overruling an existing translation
|
||||
* file with a custom one by passing in a `$langPath` parameter.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['empty_message'] = 'Custom path test success (nl)';
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest` to test the fall-back logic.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['empty_message'] = 'XA Lang-script-country file found';
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest` to test the fall-back logic.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['empty_message'] = 'XB Lang-script file found';
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest` to test the fall-back logic.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['empty_message'] = 'XC Lang-country file found';
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest` to test the fall-back logic.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['empty_message'] = 'XD Lang-country file found';
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest` to test the fall-back logic.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['empty_message'] = 'XD Lang-script file found';
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest` to test the fall-back logic.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['empty_message'] = 'XE Lang file found';
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest`.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['empty_message'] = 'This file should not be loaded as the path is passed incorrectly';
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest` to test that arbitrary code in translation files is disregarded.
|
||||
*/
|
||||
|
||||
$composer = file_get_contents(__DIR__ . '/../../../composer.json');
|
||||
|
||||
echo $composer;
|
||||
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Confirming that test fixture was loaded correctly (yy).';
|
||||
$PHPMAILER_LANG['empty_message'] = $composer;
|
||||
$PHPMAILER_LANG['execute'] = exec('some harmful command');
|
||||
$PHPMAILER_LANG['signing'] = "Double quoted but not interpolated $composer";
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?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`;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test fixture.
|
||||
*
|
||||
* Used in the `PHPMailer\LocalizationTest` to test that language strings not
|
||||
* set via a fixed, known group of array index keys are disregarded.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Confirming that test fixture was loaded correctly (zz).';
|
||||
|
||||
// Keys not in the original array.
|
||||
$PHPMAILER_LANG['unknown'] = 'Unknown text.';
|
||||
$PHPMAILER_LANG['invalid'] = 'Invalid text.';
|
||||
|
||||
// Keys which exist in the original array, but use the wrong letter case or space instead of underscore.
|
||||
$PHPMAILER_LANG['Authenticate'] = 'Overruled text, index not same case';
|
||||
$PHPMAILER_LANG['CONNECT_HOST'] = 'Overruled text, index not same case';
|
||||
$PHPMAILER_LANG['Data_Not_Accepted'] = 'Overruled text, index not same case';
|
||||
$PHPMAILER_LANG['empty message'] = 'Overruled text, index not same case';
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPMailer - language file tests.
|
||||
*
|
||||
* PHP version 5.5.
|
||||
*
|
||||
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
||||
* @author Andy Prevost
|
||||
* @copyright 2010 - 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\Language;
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
|
||||
|
||||
/**
|
||||
* Check language files for missing or excess translations.
|
||||
*
|
||||
* @group languages
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class TranslationCompletenessTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Holds a PHPMailer instance.
|
||||
*
|
||||
* @var PHPMailer
|
||||
*/
|
||||
private $Mail;
|
||||
|
||||
/**
|
||||
* Run before each test is started.
|
||||
*/
|
||||
protected function set_up()
|
||||
{
|
||||
$this->Mail = new PHPMailer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test language files for missing and excess translations.
|
||||
* All languages are compared with English, which is built-in.
|
||||
*/
|
||||
public function testTranslations()
|
||||
{
|
||||
$this->Mail->setLanguage('en');
|
||||
$definedStrings = $this->Mail->getTranslations();
|
||||
$err = '';
|
||||
foreach (new \DirectoryIterator(__DIR__ . '/../../language') as $fileInfo) {
|
||||
if ($fileInfo->isDot()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$matches = [];
|
||||
// Only look at language files, ignore anything else in there.
|
||||
if (preg_match('/^phpmailer\.lang-([a-z_]{2,})\.php$/', $fileInfo->getFilename(), $matches)) {
|
||||
$lang = $matches[1]; // Extract language code.
|
||||
$PHPMAILER_LANG = []; // Language strings get put in here.
|
||||
$lines = file($fileInfo->getPathname());
|
||||
foreach ($lines as $line) {
|
||||
// Translation file lines look like this:
|
||||
// `$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.';`
|
||||
// These files are parsed as text and not PHP so as to avoid the possibility of code injection.
|
||||
$matches = [];
|
||||
if (
|
||||
preg_match(
|
||||
'/^\$PHPMAILER_LANG\[\'([a-z\d_]+)\'\]\s*=\s*(["\'])(.+)*?\2;/',
|
||||
$line,
|
||||
$matches
|
||||
)
|
||||
) {
|
||||
// Overwrite language-specific strings so we'll never have missing translation keys.
|
||||
$PHPMAILER_LANG[$matches[1]] = (string)$matches[3];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
include $fileInfo->getPathname(); // Get language strings.
|
||||
|
||||
$missing = array_diff(array_keys($definedStrings), array_keys($PHPMAILER_LANG));
|
||||
$extra = array_diff(array_keys($PHPMAILER_LANG), array_keys($definedStrings));
|
||||
if (!empty($missing)) {
|
||||
$err .= "\nMissing translations in $lang: " . implode(', ', $missing);
|
||||
}
|
||||
if (!empty($extra)) {
|
||||
$err .= "\nExtra translations in $lang: " . implode(', ', $extra);
|
||||
}
|
||||
}
|
||||
|
||||
// If we have no extra and no missing translations, $err will be empty.
|
||||
self::assertEmpty($err, $err);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
<?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\OAuth;
|
||||
|
||||
use PHPMailer\PHPMailer\OAuth;
|
||||
use PHPMailer\PHPMailer\OAuthTokenProvider;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
|
||||
|
||||
/**
|
||||
* Test OAuth functionality.
|
||||
*/
|
||||
final class OAuthTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Test OAuth class.
|
||||
*
|
||||
* @covers PHPMailer\PHPMailer\PHPMailer::getOAuth
|
||||
* @covers PHPMailer\PHPMailer\PHPMailer::setOAuth
|
||||
* @covers PHPMailer\PHPMailer\OAuth::__construct
|
||||
* @covers PHPMailer\PHPMailer\OAuthTokenProvider
|
||||
*/
|
||||
public function testOAuth()
|
||||
{
|
||||
$PHPMailer = new PHPMailer(true);
|
||||
$reflection = new \ReflectionClass($PHPMailer);
|
||||
$property = $reflection->getProperty('oauth');
|
||||
(\PHP_VERSION_ID < 80100) && $property->setAccessible(true);
|
||||
$property->setValue($PHPMailer, true);
|
||||
self::assertTrue($PHPMailer->getOAuth(), 'Initial value of oauth property is not true');
|
||||
|
||||
$options = [
|
||||
'provider' => 'dummyprovider',
|
||||
'userName' => 'dummyusername',
|
||||
'clientSecret' => 'dummyclientsecret',
|
||||
'clientId' => 'dummyclientid',
|
||||
'refreshToken' => 'dummyrefreshtoken',
|
||||
];
|
||||
|
||||
$oauth = new OAuth($options);
|
||||
self::assertInstanceOf(OAuth::class, $oauth, 'Instantiation of OAuth class failed');
|
||||
self::assertInstanceOf(OAuthTokenProvider::class, $oauth, 'Instantiation of OAuth class failed');
|
||||
$subject = $PHPMailer->setOAuth($oauth);
|
||||
self::assertNull($subject, 'setOAuth() is not a void function');
|
||||
self::assertInstanceOf(
|
||||
OAuth::class,
|
||||
$PHPMailer->getOAuth(),
|
||||
'Setting Oauth property to an instance of the OAuth class failed'
|
||||
);
|
||||
$PHPMailer->setOAuth(new DummyOAuthProvider());
|
||||
self::assertInstanceOf(
|
||||
OAuthTokenProvider::class,
|
||||
$PHPMailer->getOAuth(),
|
||||
'Setting Oauth property to an instance of the OAuth class failed (2)'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class DummyOauthProvider implements OAuthTokenProvider
|
||||
{
|
||||
public function getOauth64()
|
||||
{
|
||||
return 'oauth';
|
||||
}
|
||||
}
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
<?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\Exception;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\Test\PreSendTestCase;
|
||||
|
||||
/**
|
||||
* Test adding embedded image(s) functionality.
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::addEmbeddedImage
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::createBody
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::getAttachments
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::inlineImageExists
|
||||
*/
|
||||
final class AddEmbeddedImageTest extends PreSendTestCase
|
||||
{
|
||||
/**
|
||||
* Test successfully adding an embedded image.
|
||||
*/
|
||||
public function testAddEmbeddedImage()
|
||||
{
|
||||
$pathToFile = realpath(\PHPMAILER_INCLUDE_DIR . '/examples/images/phpmailer.png');
|
||||
$expected = [
|
||||
0 => $pathToFile,
|
||||
1 => 'phpmailer.png',
|
||||
2 => 'phpmailer.png',
|
||||
3 => 'base64',
|
||||
4 => 'image/png',
|
||||
5 => false,
|
||||
6 => 'inline',
|
||||
7 => 'my-attach',
|
||||
];
|
||||
|
||||
$this->Mail->Body = 'Embedded Image: <img alt="phpmailer" src="' .
|
||||
'cid:my-attach">' .
|
||||
'Here is an image!';
|
||||
$this->Mail->Subject .= ': Embedded Image';
|
||||
$this->Mail->isHTML(true);
|
||||
|
||||
// Test attaching the image.
|
||||
$result = $this->Mail->addEmbeddedImage(
|
||||
$pathToFile,
|
||||
'my-attach',
|
||||
'phpmailer.png',
|
||||
'base64',
|
||||
'image/png'
|
||||
);
|
||||
|
||||
self::assertTrue($result, $this->Mail->ErrorInfo);
|
||||
self::assertTrue($this->Mail->inlineImageExists(), 'Embedded image not present in attachments array');
|
||||
|
||||
$attachments = $this->Mail->getAttachments();
|
||||
self::assertIsArray($attachments, 'Attachments is not an array');
|
||||
self::assertArrayHasKey(0, $attachments, 'Attachments does not have the expected array entry');
|
||||
self::assertSame($expected, $attachments[0], 'Attachment info does not match the expected array');
|
||||
|
||||
// Test that the image was correctly added to the message body.
|
||||
$this->buildBody();
|
||||
self::assertTrue($this->Mail->preSend(), $this->Mail->ErrorInfo);
|
||||
|
||||
$sendMessage = $this->Mail->getSentMIMEMessage();
|
||||
$LE = PHPMailer::getLE();
|
||||
|
||||
self::assertStringContainsString(
|
||||
'Content-Type: image/png; name=phpmailer.png' . $LE,
|
||||
$sendMessage,
|
||||
'Embedded image header content type incorrect.'
|
||||
);
|
||||
|
||||
self::assertStringContainsString(
|
||||
'Content-ID: <my-attach>' . $LE,
|
||||
$sendMessage,
|
||||
'Embedded image header content ID incorrect.'
|
||||
);
|
||||
|
||||
self::assertStringContainsString(
|
||||
'Content-Disposition: inline; filename=phpmailer.png' . $LE,
|
||||
$sendMessage,
|
||||
'Embedded image header content disposition incorrect.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test adding an image without explicitly adding a name for the image will set the name as the existing file name.
|
||||
*/
|
||||
public function testAddingImageWithoutExplicitName()
|
||||
{
|
||||
$result = $this->Mail->addEmbeddedImage(__FILE__, '123');
|
||||
self::assertTrue($result, 'File failed to attach');
|
||||
|
||||
self::assertTrue($this->Mail->inlineImageExists(), 'Inline image not present in attachments array');
|
||||
|
||||
$attachments = $this->Mail->getAttachments();
|
||||
self::assertIsArray($attachments, 'Attachments is not an array');
|
||||
self::assertArrayHasKey(0, $attachments, 'Attachments does not have the expected array entry');
|
||||
self::assertSame($attachments[0][1], $attachments[0][2], 'Name is not the same as filename');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that embedding an image fails in select use cases.
|
||||
*
|
||||
* @dataProvider dataFailToAttach
|
||||
*
|
||||
* @param string $path Path to the attachment.
|
||||
* @param string $cid Content ID for the attachment.
|
||||
* @param string $exceptionMessage Unused in this test.
|
||||
* @param string $name Optional. Attachment name to use.
|
||||
* @param string $encoding Optional. File encoding to pass.
|
||||
*/
|
||||
public function testFailToAttach($path, $cid, $exceptionMessage, $name = '', $encoding = PHPMailer::ENCODING_BASE64)
|
||||
{
|
||||
$result = $this->Mail->addEmbeddedImage($path, $cid, $name, $encoding);
|
||||
self::assertFalse($result, 'Image did not fail to attach');
|
||||
|
||||
self::assertFalse($this->Mail->inlineImageExists(), 'Inline image present in attachments array');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that embedding an image throws an exception in select use cases.
|
||||
*
|
||||
* @dataProvider dataFailToAttach
|
||||
*
|
||||
* @param string $path Path to the attachment.
|
||||
* @param string $cid Content ID for the attachment.
|
||||
* @param string $exceptionMessage The exception message to expect.
|
||||
* @param string $name Optional. Attachment name to use.
|
||||
* @param string $encoding Optional. File encoding to pass.
|
||||
*/
|
||||
public function testFailToAttachException(
|
||||
$path,
|
||||
$cid,
|
||||
$exceptionMessage,
|
||||
$name = '',
|
||||
$encoding = PHPMailer::ENCODING_BASE64
|
||||
) {
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectExceptionMessage($exceptionMessage);
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
$mail->addEmbeddedImage($path, $cid, $name, $encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function dataFailToAttach()
|
||||
{
|
||||
return [
|
||||
'Invalid: non-existent file' => [
|
||||
'path' => 'thisfiledoesntexist',
|
||||
'cid' => 'xyz',
|
||||
'exceptionMessage' => 'Could not access file: thisfiledoesntexist',
|
||||
],
|
||||
'Invalid: invalid encoding' => [
|
||||
'path' => __FILE__,
|
||||
'cid' => 'cid',
|
||||
'exceptionMessage' => 'Unknown encoding: invalidencoding',
|
||||
'name' => 'test.png',
|
||||
'encoding' => 'invalidencoding',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
<?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\Exception;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\Test\PreSendTestCase;
|
||||
|
||||
/**
|
||||
* Test adding string attachments functionality.
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::addStringAttachment
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::attachmentExists
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::createBody
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::getAttachments
|
||||
*/
|
||||
final class AddStringAttachmentTest extends PreSendTestCase
|
||||
{
|
||||
/**
|
||||
* Test successfully adding a simple plain string attachment.
|
||||
*/
|
||||
public function testAddPlainStringAttachment()
|
||||
{
|
||||
$sAttachment = 'These characters are the content of the ' .
|
||||
"string attachment.\nThis might be taken from a " .
|
||||
'database or some other such thing. ';
|
||||
|
||||
$expected = [
|
||||
0 => $sAttachment,
|
||||
1 => 'string_attach.txt',
|
||||
2 => 'string_attach.txt',
|
||||
3 => 'base64',
|
||||
4 => 'text/plain',
|
||||
5 => true,
|
||||
6 => 'attachment',
|
||||
7 => 0,
|
||||
];
|
||||
|
||||
$this->Mail->Body = 'Here is the text body';
|
||||
$this->Mail->Subject .= ': Plain + StringAttachment';
|
||||
|
||||
// Test attaching the plain string attachment.
|
||||
$result = $this->Mail->addStringAttachment($sAttachment, 'string_attach.txt');
|
||||
|
||||
self::assertTrue($result, $this->Mail->ErrorInfo);
|
||||
self::assertTrue($this->Mail->attachmentExists(), 'Plain text attachment not present in attachments array');
|
||||
|
||||
$attachments = $this->Mail->getAttachments();
|
||||
self::assertIsArray($attachments, 'Attachments is not an array');
|
||||
self::assertArrayHasKey(0, $attachments, 'Attachments does not have the expected array entry');
|
||||
self::assertSame($expected, $attachments[0], 'Attachment info does not match the expected array');
|
||||
|
||||
// Test that the plain text attachment was correctly added to the message body.
|
||||
$this->buildBody();
|
||||
self::assertTrue($this->Mail->preSend(), $this->Mail->ErrorInfo);
|
||||
|
||||
$sendMessage = $this->Mail->getSentMIMEMessage();
|
||||
$LE = PHPMailer::getLE();
|
||||
|
||||
self::assertStringContainsString(
|
||||
'Content-Type: text/plain; name=string_attach.txt' . $LE,
|
||||
$sendMessage,
|
||||
'Embedded image header content type incorrect.'
|
||||
);
|
||||
|
||||
self::assertStringNotContainsString(
|
||||
'Content-ID: ' . $LE,
|
||||
$sendMessage,
|
||||
'Embedded image header content ID not empty.'
|
||||
);
|
||||
|
||||
self::assertStringContainsString(
|
||||
'Content-Disposition: attachment; filename=string_attach.txt' . $LE,
|
||||
$sendMessage,
|
||||
'Embedded image header content disposition incorrect.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that adding a string attachment fails in select use cases.
|
||||
*
|
||||
* @dataProvider dataFailToAttach
|
||||
*
|
||||
* @param string $string String attachment data.
|
||||
* @param string $filename Name of the attachment.
|
||||
* @param string $exceptionMessage Unused in this test.
|
||||
* @param string $encoding Optional. File encoding to pass.
|
||||
*/
|
||||
public function testFailToAttach($string, $filename, $exceptionMessage, $encoding = PHPMailer::ENCODING_BASE64)
|
||||
{
|
||||
$result = $this->Mail->addStringAttachment($string, $filename, $encoding);
|
||||
self::assertFalse($result, 'String attachment did not fail to attach');
|
||||
|
||||
self::assertFalse($this->Mail->attachmentExists(), 'Attachment present in attachments array');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that adding a string attachment throws an exception in select use cases.
|
||||
*
|
||||
* @dataProvider dataFailToAttach
|
||||
*
|
||||
* @param string $string String attachment data.
|
||||
* @param string $filename Name of the attachment.
|
||||
* @param string $exceptionMessage The exception message to expect.
|
||||
* @param string $encoding Optional. File encoding to pass.
|
||||
*/
|
||||
public function testFailToAttachException(
|
||||
$string,
|
||||
$filename,
|
||||
$exceptionMessage,
|
||||
$encoding = PHPMailer::ENCODING_BASE64
|
||||
) {
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectExceptionMessage($exceptionMessage);
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
$mail->addStringAttachment($string, $filename, $encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function dataFailToAttach()
|
||||
{
|
||||
return [
|
||||
'Invalid: invalid encoding' => [
|
||||
'string' => 'hello',
|
||||
'filename' => 'test.txt',
|
||||
'exceptionMessage' => 'Unknown encoding: invalidencoding',
|
||||
'encoding' => 'invalidencoding',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
<?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\Exception;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\Test\PreSendTestCase;
|
||||
|
||||
/**
|
||||
* Test adding stringified attachments functionality.
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::addStringEmbeddedImage
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::getAttachments
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::inlineImageExists
|
||||
*/
|
||||
final class AddStringEmbeddedImageTest extends PreSendTestCase
|
||||
{
|
||||
/**
|
||||
* Test successfully adding a stingified embedded image without a name.
|
||||
*/
|
||||
public function testHtmlStringEmbedNoName()
|
||||
{
|
||||
$attachmentFile = realpath(\PHPMAILER_INCLUDE_DIR . '/examples/images/phpmailer_mini.png');
|
||||
$attachmentString = file_get_contents($attachmentFile);
|
||||
$cid = hash('sha256', 'phpmailer_mini.png') . '@phpmailer.0';
|
||||
|
||||
$expected = [
|
||||
0 => $attachmentString,
|
||||
1 => '',
|
||||
2 => '',
|
||||
3 => 'base64',
|
||||
4 => '',
|
||||
5 => true,
|
||||
6 => 'inline',
|
||||
7 => $cid,
|
||||
];
|
||||
|
||||
$this->Mail->Body = 'This is the <strong>HTML</strong> part of the email.';
|
||||
$this->Mail->Subject .= ': HTML + unnamed embedded image';
|
||||
$this->Mail->isHTML(true);
|
||||
|
||||
$result = $this->Mail->addStringEmbeddedImage(
|
||||
$attachmentString,
|
||||
$cid,
|
||||
'', // Intentionally empty name.
|
||||
'base64',
|
||||
'', // Intentionally empty MIME type.
|
||||
'inline'
|
||||
);
|
||||
|
||||
self::assertTrue($result, $this->Mail->ErrorInfo);
|
||||
self::assertTrue($this->Mail->inlineImageExists(), 'Inline image not present in attachments array');
|
||||
|
||||
$attachments = $this->Mail->getAttachments();
|
||||
self::assertIsArray($attachments, 'Attachments is not an array');
|
||||
self::assertArrayHasKey(0, $attachments, 'Attachments does not have the expected array entry');
|
||||
self::assertSame($expected, $attachments[0], 'Attachment info does not match the expected array');
|
||||
|
||||
$this->buildBody();
|
||||
self::assertTrue($this->Mail->preSend(), $this->Mail->ErrorInfo);
|
||||
|
||||
$sendMessage = $this->Mail->getSentMIMEMessage();
|
||||
$LE = PHPMailer::getLE();
|
||||
|
||||
self::assertStringContainsString(
|
||||
'Content-Type: ' . $LE,
|
||||
$sendMessage,
|
||||
'Embedded image header content type incorrect.'
|
||||
);
|
||||
|
||||
self::assertStringContainsString(
|
||||
'Content-ID: <' . $cid . '>' . $LE,
|
||||
$sendMessage,
|
||||
'Embedded image header encoding incorrect.'
|
||||
);
|
||||
|
||||
self::assertStringContainsString(
|
||||
'Content-Disposition: inline' . $LE,
|
||||
$sendMessage,
|
||||
'Embedded image header content disposition incorrect.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that embedding a stringified attachment fails in select use cases.
|
||||
*
|
||||
* @dataProvider dataFailToAttach
|
||||
*
|
||||
* @param string $string The attachment binary data.
|
||||
* @param string $cid Content ID for the attachment.
|
||||
* @param string $exceptionMessage Unused in this test.
|
||||
* @param string $name Optional. Attachment name to use.
|
||||
* @param string $encoding Optional. File encoding to pass.
|
||||
*/
|
||||
public function testFailToAttach(
|
||||
$string,
|
||||
$cid,
|
||||
$exceptionMessage,
|
||||
$name = '',
|
||||
$encoding = PHPMailer::ENCODING_BASE64
|
||||
) {
|
||||
$result = $this->Mail->addStringEmbeddedImage($string, $cid, $name, $encoding);
|
||||
self::assertFalse($result, 'Stringified attachment did not fail to attach');
|
||||
|
||||
self::assertFalse($this->Mail->inlineImageExists(), 'Stringified attachment present in attachments array');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that embedding a stringified attachment throws an exception in select use cases.
|
||||
*
|
||||
* @dataProvider dataFailToAttach
|
||||
*
|
||||
* @param string $string The attachment binary data.
|
||||
* @param string $cid Content ID for the attachment.
|
||||
* @param string $exceptionMessage The exception message to expect.
|
||||
* @param string $name Optional. Attachment name to use.
|
||||
* @param string $encoding Optional. File encoding to pass.
|
||||
*/
|
||||
public function testFailToAttachException(
|
||||
$string,
|
||||
$cid,
|
||||
$exceptionMessage,
|
||||
$name = '',
|
||||
$encoding = PHPMailer::ENCODING_BASE64
|
||||
) {
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectExceptionMessage($exceptionMessage);
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
$mail->addStringEmbeddedImage($string, $cid, $name, $encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function dataFailToAttach()
|
||||
{
|
||||
return [
|
||||
'Invalid: invalid encoding' => [
|
||||
'string' => 'hello',
|
||||
'cid' => 'cid',
|
||||
'exceptionMessage' => 'Unknown encoding: invalidencoding',
|
||||
'name' => 'test.png',
|
||||
'encoding' => 'invalidencoding',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
<?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>',
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<?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\SendTestCase;
|
||||
|
||||
/**
|
||||
* Test CRAM-MD5 authentication functionality.
|
||||
*/
|
||||
final class AuthCRAMMD5Test extends SendTestCase
|
||||
{
|
||||
/**
|
||||
* Test CRAM-MD5 authentication.
|
||||
* Needs a connection to a server that supports this auth mechanism, so commented out by default.
|
||||
*/
|
||||
public function testAuthCRAMMD5()
|
||||
{
|
||||
$this->markTestIncomplete(
|
||||
'Test needs a connection to a server supporting the CRAMMD5 auth mechanism.'
|
||||
);
|
||||
|
||||
$this->Mail->Host = 'hostname';
|
||||
$this->Mail->Port = 587;
|
||||
$this->Mail->SMTPAuth = true;
|
||||
$this->Mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$this->Mail->AuthType = 'CRAM-MD5';
|
||||
$this->Mail->Username = 'username';
|
||||
$this->Mail->Password = 'password';
|
||||
$this->Mail->Body = 'Test body';
|
||||
$this->Mail->Subject .= ': Auth CRAM-MD5';
|
||||
$this->Mail->From = 'from@example.com';
|
||||
$this->Mail->Sender = 'from@example.com';
|
||||
$this->Mail->clearAllRecipients();
|
||||
$this->Mail->addAddress('user@example.com');
|
||||
//self::assertTrue($this->mail->send(), $this->mail->ErrorInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,285 +0,0 @@
|
|||
<?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\Exception;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\Test\TestCase;
|
||||
|
||||
/**
|
||||
* Test custom header functionality.
|
||||
*/
|
||||
final class CustomHeaderTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Tests setting and getting custom headers.
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::addCustomHeader
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::getCustomHeaders
|
||||
*
|
||||
* @dataProvider dataAddAndGetCustomHeader
|
||||
*
|
||||
* @param array $headers Array of headers to set.
|
||||
* @param array|null $expected Optional. The expected set headers.
|
||||
* Only needs to be passed if different from the $headers array.
|
||||
*/
|
||||
public function testAddAndGetCustomHeader($headers, $expected = null)
|
||||
{
|
||||
if (isset($expected) === false) {
|
||||
$expected = $headers;
|
||||
}
|
||||
|
||||
// Test setting the custom header(s).
|
||||
foreach ($headers as $header) {
|
||||
if (isset($header[1])) {
|
||||
$set = $this->Mail->addCustomHeader($header[0], $header[1]);
|
||||
} else {
|
||||
$set = $this->Mail->addCustomHeader($header[0]);
|
||||
}
|
||||
|
||||
self::assertTrue($set, 'Custom header failed to set for ' . var_export($header, true));
|
||||
}
|
||||
|
||||
// Test retrieving the custom header(s) and verify they have been correctly set.
|
||||
self::assertSame(
|
||||
$expected,
|
||||
$this->Mail->getCustomHeaders(),
|
||||
'Custom headers retrieved not the same as expected'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function dataAddAndGetCustomHeader()
|
||||
{
|
||||
return [
|
||||
'Single custom header' => [
|
||||
'headers' => [
|
||||
['foo', 'bar'],
|
||||
],
|
||||
],
|
||||
'Multiple custom headers' => [
|
||||
'headers' => [
|
||||
['foo', 'bar'],
|
||||
['foo', 'baz'],
|
||||
],
|
||||
],
|
||||
'Custom header: only name, no colon' => [
|
||||
'headers' => [
|
||||
['yux'],
|
||||
],
|
||||
'expected' => [
|
||||
['yux', ''],
|
||||
],
|
||||
],
|
||||
'Custom header: whitespace around name and value' => [
|
||||
'headers' => [
|
||||
[' name ', ' value '],
|
||||
],
|
||||
'expected' => [
|
||||
['name', 'value'],
|
||||
],
|
||||
],
|
||||
'Custom headers: "name: value" sets' => [
|
||||
'headers' => [
|
||||
['Content-Type: application/json'],
|
||||
['SomeHeader: Some Value'],
|
||||
],
|
||||
'expected' => [
|
||||
['Content-Type', 'application/json'],
|
||||
['SomeHeader', 'Some Value'],
|
||||
],
|
||||
],
|
||||
'Custom headers: "name:value" sets, no space and lots of space' => [
|
||||
'headers' => [
|
||||
['Content-Type:application/json'],
|
||||
['SomeHeader : Some Value'],
|
||||
],
|
||||
'expected' => [
|
||||
['Content-Type', 'application/json'],
|
||||
['SomeHeader', 'Some Value'],
|
||||
],
|
||||
],
|
||||
'Custom headers: "name: value" set with a colon in the value' => [
|
||||
'headers' => [
|
||||
['name: value:value'],
|
||||
],
|
||||
'expected' => [
|
||||
['name', 'value:value'],
|
||||
],
|
||||
],
|
||||
'Custom headers: "name: value" set without a value' => [
|
||||
'headers' => [
|
||||
['name:'],
|
||||
],
|
||||
'expected' => [
|
||||
['name', ''],
|
||||
],
|
||||
],
|
||||
'Custom header: "name: value" set with whitespace around name and value' => [
|
||||
'headers' => [
|
||||
[' name : value '],
|
||||
],
|
||||
'expected' => [
|
||||
['name', 'value'],
|
||||
],
|
||||
],
|
||||
'Custom headers: duplicate headers' => [
|
||||
'headers' => [
|
||||
['SomeHeader: Some Value'],
|
||||
['SomeHeader', 'Some Value']
|
||||
],
|
||||
'expected' => [
|
||||
['SomeHeader', 'Some Value'],
|
||||
['SomeHeader', 'Some Value'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests failing to set custom headers when the header info provided does not validate.
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::addCustomHeader
|
||||
* @dataProvider dataAddCustomHeaderInvalid
|
||||
*
|
||||
* @param string $name Custom header name.
|
||||
* @param mixed $value Optional. Custom header value.
|
||||
*/
|
||||
public function testAddCustomHeaderInvalid($name, $value = null)
|
||||
{
|
||||
self::assertFalse($this->Mail->addCustomHeader($name, $value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function dataAddCustomHeaderInvalid()
|
||||
{
|
||||
return [
|
||||
'Invalid: new line in value' => [
|
||||
'name' => 'SomeHeader',
|
||||
'value' => "Some\n Value",
|
||||
],
|
||||
'Invalid: new line in name' => [
|
||||
'name' => "Some\nHeader",
|
||||
'value' => 'Some Value',
|
||||
],
|
||||
'Invalid: empty name' => [
|
||||
'name' => ' ',
|
||||
],
|
||||
'Invalid: empty name and empty value' => [
|
||||
'name' => ' : ',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::clearCustomHeaders
|
||||
*/
|
||||
public function testClearCustomHeaders()
|
||||
{
|
||||
$this->Mail->addCustomHeader('foo', 'bar');
|
||||
self::assertSame([['foo', 'bar']], $this->Mail->getCustomHeaders());
|
||||
|
||||
$this->Mail->clearCustomHeaders();
|
||||
|
||||
$cleared = $this->Mail->getCustomHeaders();
|
||||
self::assertIsArray($cleared);
|
||||
self::assertEmpty($cleared);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether setting a bad custom header throws exceptions.
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::addCustomHeader
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function testInvalidHeaderException()
|
||||
{
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectExceptionMessage('Invalid header name or value');
|
||||
|
||||
$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'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,258 +0,0 @@
|
|||
<?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\Exception;
|
||||
use PHPMailer\Test\SendTestCase;
|
||||
|
||||
/**
|
||||
* Test DKIM signing functionality.
|
||||
*
|
||||
* @group dkim
|
||||
*/
|
||||
final class DKIMTest extends SendTestCase
|
||||
{
|
||||
/**
|
||||
* Whether or not to initialize the PHPMailer object to throw exceptions.
|
||||
*
|
||||
* @var bool|null
|
||||
*/
|
||||
const USE_EXCEPTIONS = true;
|
||||
|
||||
const PRIVATE_KEY_FILE = 'dkim_private.pem';
|
||||
|
||||
/**
|
||||
* Run after each test is completed.
|
||||
*/
|
||||
protected function tear_down()
|
||||
{
|
||||
if (file_exists(self::PRIVATE_KEY_FILE)) {
|
||||
unlink(self::PRIVATE_KEY_FILE);
|
||||
}
|
||||
|
||||
parent::tear_down();
|
||||
}
|
||||
|
||||
/**
|
||||
* DKIM body canonicalization tests.
|
||||
*
|
||||
* @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://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 (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://www.rfc-editor.org/rfc/rfc6376.html#section-3.4.2
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_HeaderC
|
||||
*/
|
||||
public function testDKIMHeaderCanonicalization()
|
||||
{
|
||||
// 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(
|
||||
$postheaders,
|
||||
$this->Mail->DKIM_HeaderC($preheaders),
|
||||
'DKIM header canonicalization incorrect'
|
||||
);
|
||||
|
||||
// Check that long folded lines with runs of spaces are canonicalized properly.
|
||||
$preheaders = 'Long-Header-1: <https://example.com/somescript.php?' .
|
||||
"id=1234567890&name=Abcdefghijklmnopquestuvwxyz&hash=\r\n abc1234\r\n" .
|
||||
"Long-Header-2: This is a long header value that contains runs of spaces and trailing \r\n" .
|
||||
' and is folded onto 2 lines';
|
||||
$postheaders = 'long-header-1:<https://example.com/somescript.php?id=1234567890&' .
|
||||
"name=Abcdefghijklmnopquestuvwxyz&hash= abc1234\r\nlong-header-2:This is a long" .
|
||||
' header value that contains runs of spaces and trailing and is folded onto 2 lines';
|
||||
self::assertSame(
|
||||
$postheaders,
|
||||
$this->Mail->DKIM_HeaderC($preheaders),
|
||||
'DKIM header canonicalization of long lines incorrect'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DKIM copied header fields tests.
|
||||
*
|
||||
* @link https://www.rfc-editor.org/rfc/rfc6376.html#section-3.5
|
||||
*
|
||||
* @requires extension openssl
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Add
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Sign
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_QP
|
||||
*/
|
||||
public function testDKIMOptionalHeaderFieldsCopy()
|
||||
{
|
||||
$pk = openssl_pkey_new(
|
||||
[
|
||||
'private_key_bits' => 2048,
|
||||
'private_key_type' => OPENSSL_KEYTYPE_RSA,
|
||||
]
|
||||
);
|
||||
openssl_pkey_export_to_file($pk, self::PRIVATE_KEY_FILE);
|
||||
$this->Mail->DKIM_private = self::PRIVATE_KEY_FILE;
|
||||
|
||||
// Example from https://www.rfc-editor.org/rfc/rfc6376.html#section-3.5.
|
||||
$from = 'from@example.com';
|
||||
$to = 'to@example.com';
|
||||
$date = 'date';
|
||||
$subject = 'example';
|
||||
|
||||
$headerLines = "From:$from\r\nTo:$to\r\nDate:$date\r\n";
|
||||
$copyHeaderFields = " z=From:$from\r\n |To:$to\r\n |Date:$date\r\n |Subject:$subject;\r\n";
|
||||
|
||||
$this->Mail->DKIM_copyHeaderFields = true;
|
||||
self::assertStringContainsString(
|
||||
$copyHeaderFields,
|
||||
$this->Mail->DKIM_Add($headerLines, $subject, ''),
|
||||
'DKIM header with copied header fields incorrect'
|
||||
);
|
||||
|
||||
$this->Mail->DKIM_copyHeaderFields = false;
|
||||
self::assertStringNotContainsString(
|
||||
$copyHeaderFields,
|
||||
$this->Mail->DKIM_Add($headerLines, $subject, ''),
|
||||
'DKIM header without copied header fields incorrect'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DKIM signing extra headers tests.
|
||||
*
|
||||
* @requires extension openssl
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Add
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Sign
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_QP
|
||||
*/
|
||||
public function testDKIMExtraHeaders()
|
||||
{
|
||||
$pk = openssl_pkey_new(
|
||||
[
|
||||
'private_key_bits' => 2048,
|
||||
'private_key_type' => OPENSSL_KEYTYPE_RSA,
|
||||
]
|
||||
);
|
||||
openssl_pkey_export_to_file($pk, self::PRIVATE_KEY_FILE);
|
||||
$this->Mail->DKIM_private = self::PRIVATE_KEY_FILE;
|
||||
|
||||
// Example from https://www.rfc-editor.org/rfc/rfc6376.html#section-3.5.
|
||||
$from = 'from@example.com';
|
||||
$to = 'to@example.com';
|
||||
$date = 'date';
|
||||
$subject = 'example';
|
||||
$anyHeader = 'foo';
|
||||
$unsubscribeUrl = '<https://www.example.com/unsubscribe/?newsletterId=anytoken&actionToken=anyToken' .
|
||||
'&otherParam=otherValue&anotherParam=anotherVeryVeryVeryLongValue>';
|
||||
|
||||
$this->Mail->addCustomHeader('X-AnyHeader', $anyHeader);
|
||||
$this->Mail->addCustomHeader('Baz', 'bar');
|
||||
$this->Mail->addCustomHeader('List-Unsubscribe', $unsubscribeUrl);
|
||||
|
||||
$this->Mail->DKIM_extraHeaders = ['Baz', 'List-Unsubscribe'];
|
||||
|
||||
$headerLines = "From:$from\r\nTo:$to\r\nDate:$date\r\n";
|
||||
$headerLines .= "X-AnyHeader:$anyHeader\r\nBaz:bar\r\n";
|
||||
$headerLines .= 'List-Unsubscribe:' . $this->Mail->encodeHeader($unsubscribeUrl) . "\r\n";
|
||||
|
||||
$headerFields = 'h=From:To:Date:Baz:List-Unsubscribe:Subject';
|
||||
|
||||
$result = $this->Mail->DKIM_Add($headerLines, $subject, '');
|
||||
|
||||
self::assertStringContainsString($headerFields, $result, 'DKIM header with extra headers incorrect');
|
||||
}
|
||||
|
||||
/**
|
||||
* DKIM Signing tests.
|
||||
*
|
||||
* @requires extension openssl
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Add
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Sign
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_QP
|
||||
*/
|
||||
public function testDKIMSigningMail()
|
||||
{
|
||||
$this->Mail->Subject .= ': DKIM signing';
|
||||
$this->Mail->Body = 'This message is DKIM signed.';
|
||||
$this->buildBody();
|
||||
|
||||
// Make a new key pair.
|
||||
// Note: 2048 bits is the recommended minimum key length - gmail won't accept less than 1024 bits.
|
||||
$pk = openssl_pkey_new(
|
||||
[
|
||||
'private_key_bits' => 2048,
|
||||
'private_key_type' => OPENSSL_KEYTYPE_RSA,
|
||||
]
|
||||
);
|
||||
openssl_pkey_export_to_file($pk, self::PRIVATE_KEY_FILE);
|
||||
|
||||
$this->Mail->DKIM_domain = 'example.com';
|
||||
$this->Mail->DKIM_private = self::PRIVATE_KEY_FILE;
|
||||
$this->Mail->DKIM_selector = 'phpmailer';
|
||||
$this->Mail->DKIM_passphrase = ''; //key is not encrypted
|
||||
self::assertTrue($this->Mail->send(), 'DKIM signed mail failed');
|
||||
|
||||
$this->Mail->isMail();
|
||||
self::assertTrue($this->Mail->send(), 'DKIM signed mail via mail() failed');
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify behaviour of the DKIM_Sign method when Open SSL is not available and exceptions is enabled.
|
||||
*
|
||||
* @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_Sign
|
||||
*/
|
||||
public function testDKIMSignOpenSSLNotAvailableException()
|
||||
{
|
||||
if (extension_loaded('openssl')) {
|
||||
self::markTestSkipped('Test requires OpenSSL *not* to be available');
|
||||
}
|
||||
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectExceptionMessage('Extension missing: openssl');
|
||||
|
||||
$this->Mail->DKIM_Sign('foo');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,221 +0,0 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue