2017 © Pedro Peláez
 

library zf2-mail-module

image

digitaledgeit/zf2-mail-module

  • Monday, June 16, 2014
  • by jameslnewell
  • Repository
  • 1 Watchers
  • 0 Stars
  • 94 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ZF2 Mail Module

A module simplifying use of ZF2 Mail., (*1)

Installation

Add the module to your composer.json file and run composer install:, (*2)

"digitaledgeit/zf2-mail-module": "dev-master"

Configuration

Add the module to the modules key in your config/application.config.php file:, (*3)

'modules' => [
    'DeitMailModule',
],

Add the configuration to your local.php and module.config.php:, (*4)

'deit_mail' => [

    //an array containing type and options keys or a string containing a service name
    'transport' => [
        'type'      => '',              //null, file, sendmail or smtp
        'options'   => [                //see the transport options for selected type at http://framework.zend.com/manual/2.1/en/modules/zend.mail.introduction.html
        ],
    ],

    'renderer'  => 'ViewRenderer'        //a string containing a service name
],

Sending mail

//get the service
$service = $serviceManager->get('deit_mail_service');

//send a message containing plain text and HTML versions
$service->sendMixedMessage(
    [
        'to'            => 'fred@example.com',
        'from'          => 'wilma@example.com',
        'subject'       => 'A test message from my app',
        'attachments'   => [
            [
                'type'      => 'text/html',
                'name'      => 'test1.html',
                'content'   => '<html><head><title>Test HTML Page</title></head><body><h1>Test HTML Page</h1></body></html>'
            ],
            [
                'type'      => 'text/html',
                'name'      => 'test2.html',
                'content'   => './path/to/the-file.html'
            ]
        ]
    ],
    [
        'text/plain'    => 'email/hello-text',
        'text/html'     => 'email/hello-html'
    ],
    [
        'name' => 'World!'
    ]
);

The Versions

16/06 2014

dev-master

9999999-dev http://digitaledgeit.com.au/

  Sources   Download

The Requires

 

The Development Requires

by James Newell

16/06 2014

0.1.0

0.1.0.0 http://digitaledgeit.com.au/

  Sources   Download

The Requires

 

The Development Requires

by James Newell