PHP code example of codemonster-ru / mail

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

    

codemonster-ru / mail example snippets


use Codemonster\Mail\MailManager;
use Codemonster\Mail\Message;

$manager = new MailManager([
    'default' => 'array',
    'mailers' => [
        'array' => [
            'transport' => 'array',
        ],
    ],
]);

$manager->mailer()->send(
    Message::make()
        ->from('[email protected]', 'Annabel')
        ->to('[email protected]')
        ->subject('Welcome')
        ->text('Welcome to Annabel.'),
);

$manager = new MailManager([
    'default' => 'smtp',
    'mailers' => [
        'smtp' => [
            'transport' => 'smtp',
            'dsn' => 'smtp://user:[email protected]:587',
        ],
    ],
]);