PHP code example of simplement / mailqueue

1. Go to this page and download the library: Download simplement/mailqueue 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/ */

    

simplement / mailqueue example snippets


 $message = new Nette\Mail\Message;
 
 :
 
 /** @var Nette\DI\Container $container */
 $container = ...;
 
 $mailer = $container->getByType('Nette\Mail\IMailer');
 or
 $mailer = $container->getService('mail.mailer');
 or
 $mailer = $container->getService('nette.mailer');
 
 /** @var Simplement\MailQueue\Mailer $mailer */
 $mailer->send($message, $priority = 1, $useQueue = TRUE);
sh
php www/index.php mailqueue:sendfronted