PHP code example of bertoost / craft-ssmtpmailer

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

    

bertoost / craft-ssmtpmailer example snippets


return [
    // general for every environment
    '*' => [
        'modules' => [
            // ...
        ],
        'bootstrap' => [
            // ...
        ],
    ],

    // Staging environment settings
    'staging' => [
        // ...
    ],

    // Dev environment settings
    'dev' => [
        'components' => [
            'mailer' => function() {
                // Get the stored email settings
                $settings = Craft::$app->getSystemSettings()->getEmailSettings();
                $settings->transportType = bertoost\ssmtpmailer\mail\Ssmtp::class;
                $settings->transportSettings = [];

                return craft\helpers\MailerHelper::createMailer($settings);
            },
        ],
    ],
];