PHP code example of mirkhamidov / yii2-mail

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

    

mirkhamidov / yii2-mail example snippets


$_mailRecipient = '[email protected]';
$_mailMoreData = [
    'someParamInEmail' => 'will be replaced with this text',
];
$_mailParams['attach'] = [
    [
        'file' => $model->params['file']['fileFullPath'],
        'params' => [
            // for details look at http://www.yiiframework.com/doc-2.0/yii-mail-messageinterface.html#attach()-detail
        ],
    ],
];

MMail::sendMail($_mailAlias, $_mailRecipient, $_mailMoreData, $_mailParams);