PHP code example of starring-jane / wordplate-mail

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

    

starring-jane / wordplate-mail example snippets


use StarringJane\WordplateMail\WordplateMail;

WordplateMail::register();

MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=465
MAIL_USERNAME=user
MAIL_PASSWORD=pass
MAIL_ENCRYPTION=tls
MAIL_FROM_NAME="Sender Name"
MAIL_FROM_ADDRESS="[email protected]"

MAIL_DRIVER=mail
MAIL_HOST=localhost
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_NAME="Sender Name"
MAIL_FROM_ADDRESS="[email protected]"

use StarringJane\WordplateMail\WordplateMail;

WordplateMail::register()
    ->set('MAIL_FROM_NAME', 'Starring Jane')
    ->set('MAIL_FROM_ADDRESS', function () {
        $domain = str_replace('www.', '', $_SERVER['SERVER_NAME']);
        return 'no-reply@' . $domain;
    });