class Mail (View source)
Provides helpers to ensure emails are compliant with RFCs.
Constants
| RFC_2822_SPECIALS |
RFC-2822 "specials" characters. |
Methods
static string
formatDisplayName(string $string)
Return a RFC-2822 compliant "display-name" component.
Details
static string
formatDisplayName(string $string)
Return a RFC-2822 compliant "display-name" component.
The "display-name" component is used in mail header "Originator" fields (From, Sender, Reply-to) to give a human-friendly description of the address, i.e. From: My Display Name xyz@example.org. RFC-822 and RFC-2822 define its syntax and rules. This method gets as input a string to be used as "display-name" and formats it to be RFC compliant.