Composer final class
Minn\Mail\Composer · public/minn/src/Minn/Mail/Composer.php · 253 lines
A message as the reference's mailer writes it: the header block (Date, the address lines, Subject, Message-ID, X-Mailer, custom headers, MIME-Version), the MIME header for its type, and the body, multipart when it has an alternative, inline parts or attachments. Boundaries are "b1=_{id}" to "b3=_{id}"; a 7-bit-clean body declared 8bit goes out as 7bit us-ascii, and a body with a line past 998 characters as quoted-printable.
Constants and properties
| private | ICAL_METHODS = array ( 0 => 'REQUEST', 1 => 'PUBLISH', 2 => 'REPLY', 3 => 'ADD', 4 => 'CANCEL', 5 => 'REFRESH', 6 => 'COUNTER', 7 => 'DECLINECOUNTER', ) |
Public
| static | body(Minn\Mail\Draft $d, string $id): array# | The body and the encoding a single-part message declares. @return array{body: string, encoding: string} | |||
| static | headers(Minn\Mail\Draft $d, string $id, string $hostname, string $encoding): string# | The header block, MIME-Version and the MIME header included. | |||
| static | mimeHeaders(Minn\Mail\Draft $d, string $id, string $encoding): string# | The MIME header for the message's type: the content type (with its boundary) and the transfer encoding. | |||
| static | mailOnlyHeaders(Minn\Mail\Draft $d): string# | The To and Subject lines PHP's mail() takes as arguments, written after the headers in the sent copy. | |||
| static | addressLine(Minn\Mail\Draft $d, string $name, array $list): string# | "Name: a, b" for a list of [address, name] pairs.
| |||
| static | address(Minn\Mail\Draft $d, array $pair): string# | One address as a header writes it: the address alone, or the name (as a phrase) and the address in angle brackets.
| |||
| static | secure(string $text): string# | Header text with any line break taken out. | |||
| static | messageId(string $given, string $id, string $hostname): string# | The message id given when it is well formed, else one made from the id and the host name. |
Internals 11
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | encodingFor(Minn\Mail\Draft $d, string $text): array# | @return array{0: string, 1: string} the encoding and charset a body part declares | |||
| private | partHead(Minn\Mail\Draft $d, string $boundary, string $charset, string $contentType, string $encoding): string# | ||||
| private | related(Minn\Mail\Draft $d, string $outer, string $inner): string# | ||||
| private | alternative(Minn\Mail\Draft $d, string $outer, string $inner): string# | ||||
| private | end(Minn\Mail\Draft $d, string $boundary): string# | ||||
| private | calendar(Minn\Mail\Draft $d, string $boundary, string $after): string# | A text/calendar part when the message carries one, followed by $after; its method is the calendar's own (upper-cased) when it is a known one. | |||
| private | date(string $given): string# | The date given when it reads as a moment already past, else now; either way as RFC 5322 writes it. | |||
| private | attachAll(Minn\Mail\Draft $d, string $disposition, string $boundary): string# | Every attachment of one disposition as parts of the boundary, then the boundary's end; an identical one, or a repeated inline id, goes once. | |||
| private | attachmentHead(Minn\Mail\Draft $d, array $a, string $boundary): string# |
| |||
| private | attachmentData(array $a): string# |
| |||
| private | extraLines(Minn\Mail\Draft $d): array# | @return list<string> X-Priority, X-Mailer, Disposition-Notification-To and the custom headers |
Nothing matches.