## Class Swift_Mime_Headers_MailboxHeader

(line 20)

## Description

    Swift_Mime_Headers_AbstractHeader
       |
       --Swift_Mime_Headers_MailboxHeader

Located in File: /vendors/swiftMailer/classes/Swift/Mime/Headers/MailboxHeader.php

##### A Mailbox Address MIME Header for something like From or Sender.

- author: - Chris Corbyn

## Class Variables

Summary:

## Class Constants

Summary:

## Method Detail

Summary:
Swift_Mime_Headers_MailboxHeader __construct (string $name, Swift_Mime_HeaderEncoder $encoder)
string createDisplayNameString (string $displayName, [boolean $shorten = false])
string createMailboxListString ( $mailboxes)
string[] getAddresses ()
string getFieldBody ()
array getFieldBodyModel ()
int getFieldType ()
string[] getNameAddresses ()
string[] getNameAddressStrings ()
string[] normalizeMailboxes ( $mailboxes)
void removeAddresses (string|string[] $addresses)
void setAddresses (string[] $addresses)
void setFieldBodyModel (mixed $model)
void setNameAddresses (string|string[] $mailboxes)

#### Constructor __construct (line 35)

#### Swift_Mime_Headers_MailboxHeader __construct( string $name, Swift_Mime_HeaderEncoder $encoder)

##### Creates a new MailboxHeader with $name.

#### Parameters

- string $name: of Header
- Swift_Mime_HeaderEncoder $encoder:

#### Info

- access - public

#### Method createDisplayNameString (line 253)

#### string createDisplayNameString( string $displayName, [boolean $shorten = false])

##### Produces a compliant, formatted display-name based on the string given.

#### Parameters

- string $displayName: as displayed
- boolean $shorten: the first line to make remove for header name

#### Info

- access - protected

#### Method createMailboxListString (line 267)

#### string createMailboxListString( $mailboxes)

##### Creates a string form of all the mailboxes in the passed array.

#### Parameters

- string[] $mailboxes:

#### Info

- throws - Swift_RfcComplianceException
- access - protected

#### Method getAddresses (line 179)

#### string[] getAddresses( )

##### Get all email addresses in this Header.

#### Info

- see - Swift_Mime_Headers_MailboxHeader::getNameAddresses()
- access - public

#### Method getFieldBody (line 205)

#### string getFieldBody( )

##### Get the string value of the body in this Header.

This is not necessarily RFC 2822 compliant since folding white space will not be added at this stage (see toString() for that).

#### Info

- see - Swift_Mime_Headers_AbstractHeader::toString()
- throws - Swift_RfcComplianceException
- access - public

#### Method getFieldBodyModel (line 70)

#### array getFieldBodyModel( )

##### Get the model for the field body.

This method returns an associative array like getNameAddresses()

#### Info

- throws - Swift_RfcComplianceException
- access - public

#### Method getFieldType (line 48)

#### int getFieldType( )

##### Get the type of Header that this instance represents.

#### Info

- see - TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX
- see - TYPE_DATE, TYPE_ID, TYPE_PATH
- access - public

#### Method getNameAddresses (line 148)

#### string[] getNameAddresses( )

##### Get all mailboxes in this Header as key=>value pairs.

The key is the address and the value is the name (or null if none set). Example:

1. <?php
2. $header = new Swift_Mime_Headers_MailboxHeader ('From',
3. array('chris@swiftmailer.org' => 'Chris Corbyn',
4. 'mark@swiftmailer.org' => 'Mark Corbyn')
5. );
6. print_r ($header-> getNameAddresses ());
7. // array (
8. // chris@swiftmailer.org => Chris Corbyn,
9. // mark@swiftmailer.org => Mark Corbyn
10. // )
11. ?>

#### Info

- see - Swift_Mime_Headers_MailboxHeader::getAddresses()
- see - Swift_Mime_Headers_MailboxHeader::getNameAddressStrings()
- access - public

#### Method getNameAddressStrings (line 122)

#### string[] getNameAddressStrings( )

##### Get the full mailbox list of this Header as an array of valid RFC 2822 strings.

Example:

1. <?php
2. $header = new Swift_Mime_Headers_MailboxHeader ('From',
3. array('chris@swiftmailer.org' => 'Chris Corbyn',
4. 'mark@swiftmailer.org' => 'Mark Corbyn')
5. );
6. print_r ($header-> getNameAddressStrings ());
7. // array (
8. // 0 => Chris Corbyn <chris@swiftmailer.org>,
9. // 1 => Mark Corbyn <mark@swiftmailer.org>
10. // )
11. ?>

#### Info

- see - Swift_Mime_Headers_AbstractHeader::toString()
- see - Swift_Mime_Headers_MailboxHeader::getNameAddresses()
- throws - Swift_RfcComplianceException
- access - public

#### Method normalizeMailboxes (line 223)

#### string[] normalizeMailboxes( $mailboxes)

##### Normalizes a user-input list of mailboxes into consistent key=>value pairs.

#### Parameters

- string[] $mailboxes:

#### Info

- access - protected

#### Method removeAddresses (line 188)

#### void removeAddresses( string|string[] $addresses)

##### Remove one or more addresses from this Header.

#### Parameters

- string|string[] $addresses:

#### Info

- access - public

#### Method setAddresses (line 169)

#### void setAddresses( string[] $addresses)

##### Makes this Header represent a list of plain email addresses with no names.

Example:

1. <?php
2. //Sets three email addresses as the Header data
3. $header-> setAddresses (
4. array('one@domain.tld', 'two@domain.tld', 'three@domain.tld')
5. );
6. ?>

#### Parameters

- string[] $addresses:

#### Info

- see - setValue()
- see - Swift_Mime_Headers_MailboxHeader::setNameAddresses()
- throws - Swift_RfcComplianceException
- access - public

#### Method setFieldBodyModel (line 59)

#### void setFieldBodyModel( mixed $model)

##### Set the model for the field body.

This method takes a string, or an array of addresses.

#### Parameters

- mixed $model:

#### Info

- throws - Swift_RfcComplianceException
- access - public

#### Method setNameAddresses (line 95)

#### void setNameAddresses( string|string[] $mailboxes)

##### Set a list of mailboxes to be shown in this Header.

The mailboxes can be a simple array of addresses, or an array of key=>value pairs where (email => personalName). Example:

1. <?php
2. //Sets two mailboxes in the Header, one with a personal name
3. $header-> setNameAddresses (array(
4. 'chris@swiftmailer.org' => 'Chris Corbyn',
5. 'mark@swiftmailer.org' //No associated personal name
6. ));
7. ?>

#### Parameters

- string|string[] $mailboxes:

#### Info

- see - setValue()
- see - Swift_Mime_Headers_MailboxHeader::setAddresses()
- see - Swift_Mime_Headers_MailboxHeader::__construct()
- throws - Swift_RfcComplianceException
- access - public

## Inherited Variables

### Inherited Class Variable Summary

## Inherited Methods

### Inherited Method Summary

#### Inherited From Class Swift_Mime_Headers_AbstractHeader

#### Swift_Mime_Headers_AbstractHeader::clearCachedValueIf() - Clear the cached value if $condition is met.

#### Swift_Mime_Headers_AbstractHeader::createPhrase() - Produces a compliant, formatted RFC 2822 'phrase' based on the string given.

#### Swift_Mime_Headers_AbstractHeader::encodeWords() - Encode needed word tokens within a string of input.

#### Swift_Mime_Headers_AbstractHeader::escapeSpecials() - Escape special characters in a string (convert to quoted-pairs).

#### Swift_Mime_Headers_AbstractHeader::generateTokenLines() - Generates tokens from the given string which include CRLF as individual tokens.

#### Swift_Mime_Headers_AbstractHeader::getCachedValue() - Get the value in the cache.

#### Swift_Mime_Headers_AbstractHeader::getCharset() - Get the character set used in this Header.

#### Swift_Mime_Headers_AbstractHeader::getEncodableWordTokens() - Splits a string into tokens in blocks of words which can be encoded quickly.

#### Swift_Mime_Headers_AbstractHeader::getEncoder() - Get the encoder used for encoding this Header.

#### Swift_Mime_Headers_AbstractHeader::getFieldName() - Get the name of this header (e.g. charset).

#### Swift_Mime_Headers_AbstractHeader::getGrammar() - Get the grammar defined for $name token.

#### Swift_Mime_Headers_AbstractHeader::getLanguage() - Get the language used in this Header.

#### Swift_Mime_Headers_AbstractHeader::getMaxLineLength() - Get the maximum permitted length of lines in this Header.

#### Swift_Mime_Headers_AbstractHeader::getTokenAsEncodedWord() - Get a token as an encoded word for safe insertion into headers.

#### Swift_Mime_Headers_AbstractHeader::initializeGrammar() - Initialize some RFC 2822 (and friends) ABNF grammar definitions.

#### Swift_Mime_Headers_AbstractHeader::setCachedValue() - Set a value into the cache.

#### Swift_Mime_Headers_AbstractHeader::setCharset() - Set the character set used in this Header.

#### Swift_Mime_Headers_AbstractHeader::setEncoder() - Set the encoder used for encoding the header.

#### Swift_Mime_Headers_AbstractHeader::setFieldName() - Set the name of this Header field.

#### Swift_Mime_Headers_AbstractHeader::setLanguage() - Set the language used in this Header.

#### Swift_Mime_Headers_AbstractHeader::setMaxLineLength() - Set the maximum length of lines in the header (excluding EOL).

#### Swift_Mime_Headers_AbstractHeader::tokenNeedsEncoding() - Test if a token needs to be encoded or not.

#### Swift_Mime_Headers_AbstractHeader::toString() - Get this Header rendered as a RFC 2822 compliant string.

#### Swift_Mime_Headers_AbstractHeader::toTokens() - Generate a list of all tokens in the final header.

#### Swift_Mime_Headers_AbstractHeader::__toString() - Returns a string representation of this object.

Documentation generated on Fri, 12 Nov 2010 20:45:24 +0000 by phpDocumentor 1.4.3