MailHeaders final readonly class
Minn\Mail\MailHeaders · public/minn/src/Minn/Mail/MailHeaders.php · 83 lines
The headers argument of wp_mail() read the way the reference reads it: a string split into lines (CRLF or LF) or a list of lines; a line without a colon is skipped. From gives an address and a name (quotes dropped); Cc, Bcc and Reply-To add comma-separated entries (a comma inside quotes still splits); Content-Type gives a type and either a charset or a boundary (a boundary leaves the charset empty); every other header is kept by name, the last of a name winning.
Constants and properties
| prop | readonly ?string $fromEmail | Promoted from the constructor. |
| prop | readonly ?string $fromName | Promoted from the constructor. |
| prop | readonly array $cc | Promoted from the constructor. |
| prop | readonly array $bcc | Promoted from the constructor. |
| prop | readonly array $replyTo | Promoted from the constructor. |
| prop | readonly ?string $contentType | Promoted from the constructor. |
| prop | readonly ?string $charset | Promoted from the constructor. |
| prop | readonly string $boundary | Promoted from the constructor. |
| prop | readonly array $custom | Promoted from the constructor. |
Public
| new | __construct(?string $fromEmail, ?string $fromName, array $cc, array $bcc, array $replyTo, ?string $contentType, ?string $charset, string $boundary, array $custom)# |
| ||||||||||||
| static | parse(mixed $headers): self# | The headers argument, as a string of lines or a list of them. | ||||||||||||
| static | recipient(string $entry): array# | One recipient entry as [address, name]: "Name <address>" (the name as written) or a bare address. @return array{0: string, 1: string} |
Internals 2
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
Nothing matches.