https://github.com/digitaledgeit/zf2-mail-module
ZF2 mail module
https://github.com/digitaledgeit/zf2-mail-module
Last synced: 25 days ago
JSON representation
ZF2 mail module
- Host: GitHub
- URL: https://github.com/digitaledgeit/zf2-mail-module
- Owner: digitaledgeit
- Created: 2014-03-31T08:58:24.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-16T10:58:14.000Z (almost 12 years ago)
- Last Synced: 2025-02-25T12:03:22.150Z (over 1 year ago)
- Language: PHP
- Size: 174 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ZF2 Mail Module
A module simplifying use of ZF2 Mail.
## Installation
Add the module to your `composer.json` file and run `composer install`:
"digitaledgeit/zf2-mail-module": "dev-master"
## Configuration
Add the module to the `modules` key in your `config/application.config.php` file:
'modules' => [
'DeitMailModule',
],
Add the configuration to your `local.php` and `module.config.php`:
'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' => 'Test HTML Page
Test HTML Page
'
],
[
'type' => 'text/html',
'name' => 'test2.html',
'content' => './path/to/the-file.html'
]
]
],
[
'text/plain' => 'email/hello-text',
'text/html' => 'email/hello-html'
],
[
'name' => 'World!'
]
);