PHP code example of hakito / cakephp-mailqueue-plugin

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

    

hakito / cakephp-mailqueue-plugin example snippets


$this->addPlugin('MailQueue');

'EmailTransport' => [
    'MailQueue' => [
        // eueTransport::class,
        'queueFolder' => TMP . 'mailqueue', // storage location for mailqueue

        // optional:
        'requeue' => [300, 500, 1000] // requeue after x seconds in case of an error
    ]
],

'Email' => [
    'default' => [
        'transport' => 'MailQueue',
    ],
    'smtp' => [
        // configure your real mailer here
    ]
]

$mailer = new Mailer('default');
// place your content in $email
$mailer->deliver();