Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_Attachment
  • Swift_EmbeddedFile
  • Swift_Image
  • Swift_Message
  • Swift_Mime_Attachment
  • Swift_Mime_ContentEncoder_Base64ContentEncoder
  • Swift_Mime_ContentEncoder_NativeQpContentEncoder
  • Swift_Mime_ContentEncoder_PlainContentEncoder
  • Swift_Mime_ContentEncoder_QpContentEncoder
  • Swift_Mime_EmbeddedFile
  • Swift_Mime_Grammar
  • Swift_Mime_HeaderEncoder_Base64HeaderEncoder
  • Swift_Mime_HeaderEncoder_QpHeaderEncoder
  • Swift_Mime_Headers_AbstractHeader
  • Swift_Mime_Headers_DateHeader
  • Swift_Mime_Headers_IdentificationHeader
  • Swift_Mime_Headers_MailboxHeader
  • Swift_Mime_Headers_ParameterizedHeader
  • Swift_Mime_Headers_PathHeader
  • Swift_Mime_Headers_UnstructuredHeader
  • Swift_Mime_MimePart
  • Swift_Mime_SimpleHeaderFactory
  • Swift_Mime_SimpleHeaderSet
  • Swift_Mime_SimpleMessage
  • Swift_Mime_SimpleMimeEntity
  • Swift_MimePart

Interfaces

  • Swift_Mime_CharsetObserver
  • Swift_Mime_ContentEncoder
  • Swift_Mime_EncodingObserver
  • Swift_Mime_Header
  • Swift_Mime_HeaderEncoder
  • Swift_Mime_HeaderFactory
  • Swift_Mime_HeaderSet
  • Swift_Mime_Message
  • Swift_Mime_MimeEntity
  • Swift_Mime_ParameterizedHeader
  • Overview
  • Package
  • Class
  • Todo
  • Download

Class Swift_Mime_Headers_MailboxHeader

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

Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header
Extended by Swift_Mime_Headers_MailboxHeader
Package: Swift\Mime
Author: Chris Corbyn
Located at classes/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php
Methods summary
public
# __construct( string $name, Swift_Mime_HeaderEncoder $encoder, Swift_Mime_Grammar $grammar )

Creates a new MailboxHeader with $name.

Creates a new MailboxHeader with $name.

Parameters

$name
of Header
$encoder
$grammar

Overrides

Swift_Mime_Headers_AbstractHeader::__construct()
public integer
# getFieldType( )

Get the type of Header that this instance represents.

Get the type of Header that this instance represents.

Returns

integer

See

Swift_Mime_Header::TYPE_TEXT, Swift_Mime_Header::TYPE_PARAMETERIZED, Swift_Mime_Header::TYPE_MAILBOX
Swift_Mime_Header::TYPE_DATE, Swift_Mime_Header::TYPE_ID, Swift_Mime_Header::TYPE_PATH
public
# setFieldBodyModel( mixed $model )

Set the model for the field body. This method takes a string, or an array of addresses.

Set the model for the field body. This method takes a string, or an array of addresses.

Parameters

$model

Throws

Swift_RfcComplianceException
public array
# getFieldBodyModel( )

Get the model for the field body. This method returns an associative array like Swift_Mime_Headers_MailboxHeader::getNameAddresses()

Get the model for the field body. This method returns an associative array like Swift_Mime_Headers_MailboxHeader::getNameAddresses()

Returns

array

Throws

Swift_RfcComplianceException
public
# 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:

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

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:

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

Parameters

$mailboxes

Throws

Swift_RfcComplianceException

See

Swift_Mime_Headers_MailboxHeader::__construct()
Swift_Mime_Headers_MailboxHeader::setAddresses()
setValue()
public string[]
# getNameAddressStrings( )

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

<?php
$header = new Swift_Mime_Headers_MailboxHeader('From',
 array('chris@swiftmailer.org' => 'Chris Corbyn',
 'mark@swiftmailer.org' => 'Mark Corbyn')
 );
print_r($header->getNameAddressStrings());
// array (
// 0 => Chris Corbyn <chris@swiftmailer.org>,
// 1 => Mark Corbyn <mark@swiftmailer.org>
// )
?>

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

<?php
$header = new Swift_Mime_Headers_MailboxHeader('From',
 array('chris@swiftmailer.org' => 'Chris Corbyn',
 'mark@swiftmailer.org' => 'Mark Corbyn')
 );
print_r($header->getNameAddressStrings());
// array (
// 0 => Chris Corbyn <chris@swiftmailer.org>,
// 1 => Mark Corbyn <mark@swiftmailer.org>
// )
?>

Returns

string[]

Throws

Swift_RfcComplianceException

See

Swift_Mime_Headers_MailboxHeader::getNameAddresses()
Swift_Mime_Headers_AbstractHeader::toString()
public 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:

<?php
$header = new Swift_Mime_Headers_MailboxHeader('From',
 array('chris@swiftmailer.org' => 'Chris Corbyn',
 'mark@swiftmailer.org' => 'Mark Corbyn')
 );
print_r($header->getNameAddresses());
// array (
// chris@swiftmailer.org => Chris Corbyn,
// mark@swiftmailer.org => Mark Corbyn
// )
?>

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:

<?php
$header = new Swift_Mime_Headers_MailboxHeader('From',
 array('chris@swiftmailer.org' => 'Chris Corbyn',
 'mark@swiftmailer.org' => 'Mark Corbyn')
 );
print_r($header->getNameAddresses());
// array (
// chris@swiftmailer.org => Chris Corbyn,
// mark@swiftmailer.org => Mark Corbyn
// )
?>

Returns

string[]

See

Swift_Mime_Headers_MailboxHeader::getAddresses()
Swift_Mime_Headers_MailboxHeader::getNameAddressStrings()
public
# setAddresses( string[] $addresses )

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

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

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

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

Parameters

$addresses

Throws

Swift_RfcComplianceException

See

Swift_Mime_Headers_MailboxHeader::setNameAddresses()
setValue()
public string[]
# getAddresses( )

Get all email addresses in this Header.

Get all email addresses in this Header.

Returns

string[]

See

Swift_Mime_Headers_MailboxHeader::getNameAddresses()
public
# removeAddresses( string|string[] $addresses )

Remove one or more addresses from this Header.

Remove one or more addresses from this Header.

Parameters

$addresses
public 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 Swift_Mime_Headers_AbstractHeader::toString() for that).

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 Swift_Mime_Headers_AbstractHeader::toString() for that).

Returns

string

Throws

Swift_RfcComplianceException

See

Swift_Mime_Headers_AbstractHeader::toString()
protected string[]
# normalizeMailboxes( array $mailboxes )

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

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

Parameters

$mailboxes

Returns

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

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

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

Parameters

$displayName
as displayed
$shorten
the first line to make remove for header name

Returns

string
protected string
# createMailboxListString( array $mailboxes )

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

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

Parameters

$mailboxes

Returns

string

Throws

Swift_RfcComplianceException
protected boolean
# tokenNeedsEncoding( string $token )

Redefine the encoding requirements for mailboxes. Commas and semicolons are used to separate multiple addresses, and should therefore be encoded

Redefine the encoding requirements for mailboxes. Commas and semicolons are used to separate multiple addresses, and should therefore be encoded

Parameters

$token

Returns

boolean

Overrides

Swift_Mime_Headers_AbstractHeader::tokenNeedsEncoding()
private string[]
# _createNameAddressStrings( array $mailboxes )

Return an array of strings conforming the the name-addr spec of RFC 2822.

Return an array of strings conforming the the name-addr spec of RFC 2822.

Parameters

$mailboxes

Returns

string[]
private
# _assertValidAddress( string $address )

Throws an Exception if the address passed does not comply with RFC 2822.

Throws an Exception if the address passed does not comply with RFC 2822.

Parameters

$address

Throws

Swift_RfcComplianceException
If invalid.
Methods inherited from Swift_Mime_Headers_AbstractHeader
__toString(), clearCachedValueIf(), createPhrase(), encodeWords(), generateTokenLines(), getCachedValue(), getCharset(), getEncodableWordTokens(), getEncoder(), getFieldName(), getGrammar(), getLanguage(), getMaxLineLength(), getTokenAsEncodedWord(), setCachedValue(), setCharset(), setEncoder(), setFieldName(), setGrammar(), setLanguage(), setMaxLineLength(), toString(), toTokens()
Constants inherited from Swift_Mime_Header
TYPE_DATE, TYPE_ID, TYPE_MAILBOX, TYPE_PARAMETERIZED, TYPE_PATH, TYPE_TEXT
Properties summary
private string[] $_mailboxes

The mailboxes used in this Header.

The mailboxes used in this Header.

# array()
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen