Method | Description | |
---|---|---|
__construct ( string $name, Swift_Mime_HeaderEncoder $encoder, Egulias\EmailValidator\EmailValidator $emailValidator ) | Creates a new MailboxHeader with $name. | |
getAddresses ( ) : string[] | Get all email addresses in this Header. | |
getFieldBody ( ) : string | Get the string value of the body in this Header. | |
getFieldBodyModel ( ) : array | Get the model for the field body. | |
getFieldType ( ) : integer | Get the type of Header that this instance represents. | |
getNameAddressStrings ( ) : string[] | Get the full mailbox list of this Header as an array of valid RFC 2822 strings. | |
getNameAddresses ( ) : string[] | Get all mailboxes in this Header as key=>value pairs. | |
removeAddresses ( string | string[] $addresses ) | Remove one or more addresses from this Header. | |
setAddresses ( string[] $addresses ) | Makes this Header represent a list of plain email addresses with no names. | |
setFieldBodyModel ( mixed $model ) | Set the model for the field body. | |
setNameAddresses ( string | string[] $mailboxes ) | Set a list of mailboxes to be shown in this Header. |
Method | Description | |
---|---|---|
createDisplayNameString ( string $displayName, boolean $shorten = false ) : string | Produces a compliant, formatted display-name based on the string given. | |
createMailboxListString ( array $mailboxes ) : string | Creates a string form of all the mailboxes in the passed array. | |
normalizeMailboxes ( array $mailboxes ) : string[] | Normalizes a user-input list of mailboxes into consistent key=>value pairs. | |
tokenNeedsEncoding ( string $token ) : boolean | Redefine the encoding requirements for mailboxes. |
Method | Description | |
---|---|---|
assertValidAddress ( string $address ) | Throws an Exception if the address passed does not comply with RFC 2822. | |
createNameAddressStrings ( array $mailboxes ) : string[] | Return an array of strings conforming the the name-addr spec of RFC 2822. |
public __construct ( string $name, Swift_Mime_HeaderEncoder $encoder, Egulias\EmailValidator\EmailValidator $emailValidator ) | ||
$name | string | of Header |
$encoder | Swift_Mime_HeaderEncoder | |
$emailValidator | Egulias\EmailValidator\EmailValidator |
protected createMailboxListString ( array $mailboxes ) : string | ||
$mailboxes | array | |
return | string |
public getAddresses ( ) : string[] | ||
return | string[] |
public getFieldBody ( ) : string | ||
return | string |
public getFieldBodyModel ( ) : array | ||
return | array |
public getFieldType ( ) : integer | ||
return | integer |
'Chris Corbyn',
'[email protected]' => 'Mark Corbyn')
);
print_r($header->getNameAddressStrings());
array (
0 => Chris Corbyn ,
1 => Mark Corbyn
)
?>
public getNameAddressStrings ( ) : string[] | ||
return | string[] |
'Chris Corbyn',
'[email protected]' => 'Mark Corbyn')
);
print_r($header->getNameAddresses());
array (
[email protected] => Chris Corbyn,
[email protected] => Mark Corbyn
)
?>
public getNameAddresses ( ) : string[] | ||
return | string[] |
protected normalizeMailboxes ( array $mailboxes ) : string[] | ||
$mailboxes | array | |
return | string[] |
public removeAddresses ( string | string[] $addresses ) | ||
$addresses | string | string[] |
setAddresses(
array('[email protected]', '[email protected]', '[email protected]')
);
?>
public setAddresses ( string[] $addresses ) | ||
$addresses | string[] |
public setFieldBodyModel ( mixed $model ) | ||
$model | mixed |
setNameAddresses(array(
'[email protected]' => 'Chris Corbyn',
'[email protected]' //No associated personal name
));
?>
public setNameAddresses ( string | string[] $mailboxes ) | ||
$mailboxes | string | string[] |
protected tokenNeedsEncoding ( string $token ) : boolean | ||
$token | string | |
return | boolean |