Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • AddressList
  • AddressListHeader
  • BccHeader
  • CcHeader
  • ContentTypeHeader
  • FileDeliverer
  • FromHeader
  • Header
  • Hooks
  • MailDeliverer
  • Mailer
  • Message
  • MessagePart
  • ToHeader
  • ValueHeader

Interfaces

  • Deliverer

Class AddressList

An address list.

<?php

use ICanBoogie\Mailer\AddressList;

$list = new AddressList;
$list[] = "olivier.laviale@gmail.com";
# or
$list["olivier.laviale@gmail.com"] = true;
# or, with a name
$list["olivier.laviale@gmail.com"] = "Olivier Laviale";

# Creating a collection from an array

$list = new AddressList([

    'person1@example.com',
    'person2@example.org',
    'person3@example.net' => 'Person 3 Name',
    'person4@example.org',
    'person5@example.net' => 'Person 5 Name'

]);

isset($list['person1@example.com']); // true
# remove mailbox
unset($list['person1@example.com']);
isset($list['person1@example.com']); // false
ICanBoogie\Mailer\AddressList implements ArrayAccess, IteratorAggregate

Direct known subclasses

ICanBoogie\Mailer\AddressListHeader

Indirect known subclasses

ICanBoogie\Mailer\BccHeader, ICanBoogie\Mailer\CcHeader, ICanBoogie\Mailer\FromHeader, ICanBoogie\Mailer\ToHeader

Namespace: ICanBoogie\Mailer
See: http://tools.ietf.org/html/rfc5322#section-3.4
Located at vendor/icanboogie/mailer/lib/address-list.php

Methods summary

public static ICanBoogie\Mailer\AddressList
# from( string|array|ICanBoogie\Mailer\AddressList $address_list )

Creates a ICanBoogie\Mailer\AddressList instance from the provided source.

Creates a ICanBoogie\Mailer\AddressList instance from the provided source.

Parameters

$address_list
string|array|ICanBoogie\Mailer\AddressList
$address_list The address list can be specified as a string, an array or an ICanBoogie\Mailer\AddressList instance. While specified as a string, the address list must be separated by a comma. The display-name of the address can be defined using the following notation : "display-name <email>", where display-name is the name of the recipient and email is its email address.

Returns

ICanBoogie\Mailer\AddressList

See

http://tools.ietf.org/html/rfc5322#section-3.4
public static array[string]string
# parse( string $address_list )

Parses an address-list string and returns an array of mailbox/display-name pairs.

Parses an address-list string and returns an array of mailbox/display-name pairs.

Parameters

$address_list
string
$address_list

Returns

array[string]string
An array where each key/value pair represents a mailbox and a display-name, or an integer and a mailbox.
public static string
# escape_display_name( string $display_name )

Escapes the specified display name according to the specification.

Escapes the specified display name according to the specification.

<?php

use ICanBoogie\Mailer\AddressList;

echo AddressList('Joe Q. Public');    // "Joe Q. Public"
echo AddressList('Mary Smith');       // Mary Smith
echo AddressList('Who?');             // Who?
echo AddressList('Giant; "Big" Box'); // "Giant; \"Big\" Box"
echo AddressList('ACME, Inc.');       // "ACME, Inc."

Parameters

$display_name
string
$display_name The display name to escape.

Returns

string

See

http://tools.ietf.org/html/rfc5322#section-3.2.3
http://tools.ietf.org/html/rfc5322#appendix-A.1.2
public
# __construct( array $address_list = array() )

Initializes the ICanBoogie\Mailer\AddressList::$address_list property.

Initializes the ICanBoogie\Mailer\AddressList::$address_list property.

Note: The method uses the ArrayAccess interface to set the mailboxes.

Parameters

$address_list
array
$address_list An address list, such as one provided by the ICanBoogie\Mailer\AddressList::parse() method.
public `true`
# offsetExists( mixed $mailbox )

Checks if the recipient exists in the collection.

Checks if the recipient exists in the collection.

Returns

`true`
if the recipient exists, false otherwise.

Implementation of

ArrayAccess::offsetExists()
public
# offsetSet( mixed $mailbox, mixed $display_name )

Add or set a recipient.

Add or set a recipient.

Implementation of

ArrayAccess::offsetSet()
public
# offsetGet( string $mailbox )

Returns the recipient name.

Returns the recipient name.

Parameters

$mailbox
string
$mailbox The email of the recipient.

Implementation of

ArrayAccess::offsetGet()
public
# offsetUnset( string $mailbox )

Removes a recipient.

Removes a recipient.

Parameters

$mailbox
string
$mailbox The email of the recipient.

Implementation of

ArrayAccess::offsetUnset()
public
# getIterator( )

Implementation of

IteratorAggregate::getIterator()
public string
# __toString( )

Returns a string representation of the instance.

Returns a string representation of the instance.

Note: The returned string is not suitable for a header field, use a ICanBoogie\Mailer\AddressListHeader instance for that.

Returns

string
An address-list string that can be parsed by the ICanBoogie\Mailer\AddressList::parse() method.

Magic methods summary

Properties summary

protected array $address_list
#

A collection of recipient.

A collection of recipient.

Each key/value pair represents a mailbox and a display-name, which might be true if the display-name of mailbox was not provided.

Autodoc API documentation generated by ApiGen 2.8.0