1. Go to this page and download the library: Download enlitepro/enlite-mail library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use EnliteMail\Service;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
class MyService implements ServiceLocatorAwareInterface
{
use ServiceLocatorAwareTrait,
MailServiceTrait;
public function test()
{
$mailService = $this->getMailService();
// send any mail
$message = $mailService->factoryMessage(); // this is Zend\Mail\Message
// configure message
// ...
// send
$mailService->sendMessage($message);
// create mail from template and variables
// variable will be pass to template
$template = $mailService->createTemplate('my-module\controller\view', ['foo' => 'bar']);
$mailService->sendTemplate($template, '[email protected]');
// or, if you want operate message object before send
$message = $mailService->createMessageFromTemplate($template);
$mailService->sendMessage($message);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.