Download the PHP package janmalte/jm-mail-service without Composer
On this page you can find all versions of the php package janmalte/jm-mail-service. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download janmalte/jm-mail-service
More information about janmalte/jm-mail-service
Files in janmalte/jm-mail-service
Package jm-mail-service
Short Description ZF2 mail service module to ease the use of ZendMail
License Apache-2.0
Informations about the package jm-mail-service
JmMailService
Created by Malte Gerth
Introduction
Mail service to ease the use of the ZF2 mail component. It supports adding attachments and sending HTML messages. The Zend Mail coponents can be used to modify the message before sending.
Requirements
- Zend Framework 2 (2.2.*)
Features
- Use Zend View Scripts with view helpers as message template
- Use Zend Mail components without modifications
- Ease the handling of sending multipart messages
- Add attachments easily by calling one single method
- Use of native Zend Mail Transport classes
Installation
-
Add this project and JmMailService in your composer.json:
-
Now tell composer to download JmMailService by running the command:
- Enable the module in your
application.config.php
file.
Options
The JmMailService module has some options to allow you to customize the
functionality. After installing JmMailService, create a new config file in
./config/autoload/
or change an existing one to set the values as need.
The following options are available under the configuration key
jm-mail-service
:
- mail_transport_key - Service manager key of the transport service to use.
- mail_service - Options for the mail service. Have a look at the next section.
Options for the Mail Service
The following options are available under the configuration key
mail_service
of the JmMailService options:
- default_from - Default mail address to use as sender for the mail service.
- default_from_name - Default name to use as sender for the mail service.
Usage
The Mail Service is registered at the Service Manager and can be retrieved from
it by calling get('JanMalte\JmMailService\Service\Mail')
To send a mail message you need only a few commands.
Method chaning is provided, so you can shorten the commands to the following:
The template files have to be under the same path as the other view scripts.
Typically this would be <vendor>/<module>/view/