Skip to content

Commit 51fe627

Browse files
committed
IHF: Email helpers docs added.
1 parent e24715c commit 51fe627

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,25 @@ $isEmail = is_email('[email protected]');
106106
// true
107107
```
108108
109+
#### `to_rfc2822_email()`
110+
111+
Converts passed array of laravel addresses to [RFC 2822](http://www.faqs.org/rfcs/rfc2822.html) string, suitable for PHP [mail()](http://ua2.php.net/manual/en/function.mail.php) function:
112+
```php
113+
$address = to_rfc2822_email([
114+
['address' => '[email protected]', 'name' => 'John Doe'],
115+
['address' => '[email protected]'],
116+
]);
117+
118+
119+
```
120+
121+
Also supports simplified way of usage with just one item:
122+
```php
123+
$address = to_rfc2822_email(['address' => '[email protected]', 'name' => 'John Doe']);
124+
125+
// John Doe <[email protected]>
126+
```
127+
109128
## Format
110129
111130
#### `format_bytes()`

0 commit comments

Comments
 (0)