PHPMailer::preSend(): bool
- Source
wp-includes/PHPMailer/PHPMailer.php:1689
Compatibility
- WordPress
- core
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Return value
bool
Performance profile
How much work a call to PHPMailer::preSend() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Heavy
- Scaling
- Scales with input
- Instructions
- 49–186
- Plugin surface
- None
- Called by
- 0
Reads or writes the filesystem via file_exists().
The body loops, so the work grows with how much data it finds.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 292.
Nothing here hands control to plugin code.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- filesystemfilesystem access
file_exists()called directly
What one call costs · 90 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost PHPMailer::preSend() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 49–51 | ::setLE(), strtolower(), array_merge(), ::lang() |
->anyAddressHasUnicodeLocalPart() | 57–59 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ::lang() |
empty($value) | 60–66 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ::lang() |
| always | 65–67 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ::lang() |
->anyAddressHasUnicodeLocalPart() && empty($value) | 68–74 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ::lang() |
| always | 71–73 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ::lang() |
empty($value) | 73–87 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader() |
!->anyAddressHasUnicodeLocalPart() | 75–78 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ::lang() |
empty($value) | 76–82 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ::lang() |
->anyAddressHasUnicodeLocalPart() && empty($value) | 81–95 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader() |
empty($value) | 82–88 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ::lang() |
!empty($address_kind) && !::validateAddress() | 84–88 | ::setLE(), strtolower(), array_merge(), ->punyencodeAddress(), ::validateAddress(), ::lang(), ->setError(), ->edebug() |
78 further outcomes, up to 186 instructions
!::isPermittedPath() | 85–93 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath() |
!->anyAddressHasUnicodeLocalPart() && empty($value) | 86–93 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ::lang() |
empty($value) | 89–103 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader() |
::isPermittedPath() && !file_exists() | 90–98 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath(), file_exists() |
->anyAddressHasUnicodeLocalPart() && !empty($address_kind) && !::validateAddress() | 92–96 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->punyencodeAddress(), ::validateAddress(), ::lang(), ->setError(), ->edebug() |
->anyAddressHasUnicodeLocalPart() && !::isPermittedPath() | 93–101 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath() |
empty($value) | 95–109 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader() |
empty($value) | 97–111 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine() |
->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && !file_exists() | 98–106 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath(), file_exists() |
!->anyAddressHasUnicodeLocalPart() && empty($value) | 99–114 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader() |
empty($value) | 100–114 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine() |
!empty($address_kind) && !::validateAddress() | 100–104 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->punyencodeAddress(), ::validateAddress(), ::lang(), ->setError(), ->edebug() |
!::isPermittedPath() | 101–109 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath() |
->anyAddressHasUnicodeLocalPart() && empty($value) | 105–119 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine() |
::isPermittedPath() && !file_exists() | 106–114 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath(), file_exists() |
!empty($address_kind) && !::validateAddress() | 106–110 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->punyencodeAddress(), ::validateAddress(), ::lang(), ->setError(), ->edebug() |
!::isPermittedPath() | 107–115 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath() |
->anyAddressHasUnicodeLocalPart() && empty($value) | 108–122 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine() |
!::isPermittedPath() | 109–117 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath() |
!->anyAddressHasUnicodeLocalPart() && !empty($address_kind) && !::validateAddress() | 110–115 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->punyencodeAddress(), ::validateAddress(), ::lang(), ->setError(), ->edebug() |
!empty($value) | 111–119 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!->anyAddressHasUnicodeLocalPart() && !::isPermittedPath() | 111–120 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath() |
!::isPermittedPath() | 112–120 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath() |
::isPermittedPath() && !file_exists() | 112–120 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath(), file_exists() |
empty($value) | 113–127 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine() |
::isPermittedPath() && !file_exists() | 114–122 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists() |
empty($value) | 116–130 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine() |
!->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && !file_exists() | 116–125 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath(), file_exists() |
::isPermittedPath() && !file_exists() | 117–125 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists() |
->anyAddressHasUnicodeLocalPart() && !::isPermittedPath() | 117–125 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath() |
->anyAddressHasUnicodeLocalPart() && !empty($value) | 119–127 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
empty($value) | 119–133 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine() |
->anyAddressHasUnicodeLocalPart() && !::isPermittedPath() | 120–128 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath() |
->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && !file_exists() | 122–130 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists() |
empty($value) | 122–136 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine() |
!->anyAddressHasUnicodeLocalPart() && empty($value) | 123–138 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine() |
::isPermittedPath() && file_exists() | 124–132 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && !file_exists() | 125–133 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists() |
!::isPermittedPath() | 125–133 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath() |
!->anyAddressHasUnicodeLocalPart() && empty($value) | 126–141 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine() |
!empty($value) | 127–135 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!::isPermittedPath() | 128–136 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath() |
::isPermittedPath() && !file_exists() | 130–138 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists() |
!::isPermittedPath() | 131–139 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath() |
->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && file_exists() | 132–140 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
::isPermittedPath() && !file_exists() | 133–141 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists() |
!empty($value) | 133–141 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!::isPermittedPath() | 134–142 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath() |
!empty($value) | 135–143 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!->anyAddressHasUnicodeLocalPart() && !::isPermittedPath() | 135–144 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath() |
::isPermittedPath() && !file_exists() | 136–144 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists() |
!->anyAddressHasUnicodeLocalPart() && !empty($value) | 137–146 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!empty($value) | 138–146 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!->anyAddressHasUnicodeLocalPart() && !::isPermittedPath() | 138–147 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath() |
::isPermittedPath() && !file_exists() | 139–147 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists() |
::isPermittedPath() && file_exists() | 140–148 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && !file_exists() | 140–149 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists() |
->anyAddressHasUnicodeLocalPart() && !empty($value) | 143–151 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && !file_exists() | 143–152 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists() |
->anyAddressHasUnicodeLocalPart() && !empty($value) | 146–154 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
::isPermittedPath() && file_exists() | 146–154 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
::isPermittedPath() && file_exists() | 148–156 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && file_exists() | 150–159 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
::isPermittedPath() && file_exists() | 151–159 | ::setLE(), strtolower(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!empty($value) | 151–159 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!empty($value) | 154–162 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && file_exists() | 156–164 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!empty($value) | 157–165 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && file_exists() | 159–167 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!empty($value) | 160–168 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!->anyAddressHasUnicodeLocalPart() && !empty($value) | 161–170 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
::isPermittedPath() && file_exists() | 164–172 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!->anyAddressHasUnicodeLocalPart() && !empty($value) | 164–173 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
::isPermittedPath() && file_exists() | 167–175 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
::isPermittedPath() && file_exists() | 170–178 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
::isPermittedPath() && file_exists() | 173–181 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && file_exists() | 174–183 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->headerLine(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
!->anyAddressHasUnicodeLocalPart() && ::isPermittedPath() && file_exists() | 177–186 | ::setLE(), strtolower(), ->anyAddressHasUnicodeLocalPart(), array_keys(), ->anyAddressHasUnicodeLocalPart(), ->anyAddressHasUnicodeLocalPart(), ->addressHasUnicodeLocalPart(), array_merge(), ->alternativeExists(), ->setMessageType(), ->createBody(), ->createHeader(), ->addrAppend(), ->secureHeader(), ->encodeHeader(), ->headerLine(), ::isPermittedPath(), file_exists(), ->secureHeader(), ->encodeHeader(), ->DKIM_Add(), ::stripTrailingWSP(), ::normalizeBreaks() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 292 | 49–186 | 29 | |
| 8.5 | 292 | 49–186 | 29 | |
| 8.4 | 292 | 49–186 | 29 | 5 fewer instructions than PHP 8.3 |
| 8.3 | 297 | 49–188 | 29 | |
| 8.2 | 297 | 49–188 | 29 | |
| 8.1 | 297 | 49–188 | 29 | 5 fewer instructions than PHP 7.4 |
| 7.4 | 302 | 49–188 | 31 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 22
- stripos()
- static::setLE()
- \PHPMailer\PHPMailer\PHPMailer::lang()
- \PHPMailer\PHPMailer\PHPMailer::anyAddressHasUnicodeLocalPart()
- \PHPMailer\PHPMailer\PHPMailer::addressHasUnicodeLocalPart()
- \PHPMailer\PHPMailer\PHPMailer::punyencodeAddress()
- \PHPMailer\PHPMailer\Exception::__construct()
- static::validateAddress()
- \PHPMailer\PHPMailer\PHPMailer::setError()
- \PHPMailer\PHPMailer\PHPMailer::edebug()
- \PHPMailer\PHPMailer\PHPMailer::alternativeExists()
- \PHPMailer\PHPMailer\PHPMailer::setMessageType()
Show all 22
- \PHPMailer\PHPMailer\PHPMailer::createBody()
- \PHPMailer\PHPMailer\PHPMailer::createHeader()
- \PHPMailer\PHPMailer\PHPMailer::addrAppend()
- \PHPMailer\PHPMailer\PHPMailer::headerLine()
- \PHPMailer\PHPMailer\PHPMailer::encodeHeader()
- \PHPMailer\PHPMailer\PHPMailer::secureHeader()
- static::isPermittedPath()
- \PHPMailer\PHPMailer\PHPMailer::DKIM_Add()
- static::stripTrailingWSP()
- static::normalizeBreaks()
Source code
public function preSend() { if ( 'smtp' === $this->Mailer || ('mail' === $this->Mailer && (\PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0)) ) { //SMTP mandates RFC-compliant line endings //and it's also used with mail() on Windows static::setLE(self::CRLF); } else { //Maintain backward compatibility with legacy Linux command line mailers static::setLE(PHP_EOL); } //Check for buggy PHP versions that add a header with an incorrect line break if ( 'mail' === $this->Mailer && ((\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70017) || (\PHP_VERSION_ID >= 70100 && \PHP_VERSION_ID < 70103)) && ini_get('mail.add_x_header') === '1' && stripos(PHP_OS, 'WIN') === 0 ) { trigger_error(self::lang('buggy_php'), E_USER_WARNING); } try { $this->error_count = 0; //Reset errors $this->mailHeader = ''; //The code below tries to support full use of Unicode, //while remaining compatible with legacy SMTP servers to //the greatest degree possible: If the message uses //Unicode in the local parts of any addresses, it is sent //using SMTPUTF8. If not, it it sent using //punycode-encoded domains and plain SMTP. if ( static::CHARSET_UTF8 === strtolower($this->CharSet) && ($this->anyAddressHasUnicodeLocalPart($this->RecipientsQueue) || $this->anyAddressHasUnicodeLocalPart(array_keys($this->all_recipients)) || $this->anyAddressHasUnicodeLocalPart($this->ReplyToQueue) || $this->addressHasUnicodeLocalPart($this->From)) ) { $this->UseSMTPUTF8 = true; } //Dequeue recipient and Reply-To addresses with IDN foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { if (!$this->UseSMTPUTF8) { $params[1] = $this->punyencodeAddress($params[1]); } call_user_func_array([$this, 'addAnAddress'], $params); } if (count($this->to) + count($this->cc) + count($this->bcc) < 1) { throw new Exception(self::lang('provide_address'), self::STOP_CRITICAL); } //Validate From, Sender, and ConfirmReadingTo addresses foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { if ($this->{$address_kind} === null) { $this->{$address_kind} = ''; continue; } $this->{$address_kind} = trim($this->{$address_kind}); if (empty($this->{$address_kind})) { continue; } $this->{$address_kind} = $this->punyencodeAddress($this->{$address_kind}); if (!static::validateAddress($this->{$address_kind})) { $error_message = sprintf( '%s (%s): %s', self::lang('invalid_address'), $address_kind, $this->{$address_kind} ); $this->setError($error_message); $this->edebug($error_message); if ($this->exceptions) { throw new Exception($error_message); } return false; }Changelog
Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/PHPMailer/PHPMailer.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.