PHP code example of linio / mail

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

    

linio / mail example snippets




$app->register(new \Linio\Component\Mail\Provider\MailServiceProvider(), [
    'mail.adapter_name' => 'mandrill',
    'mail.adapter_options' => [
        'api_key' => '',
    ],
]);




use Linio\Component\Mail\Message;
use Linio\Component\Mail\Contact;

$message = new Message();
$message->setSubject('hello world');
$message->setFrom(new Contact('Barfoo', '[email protected]'));
$message->addTo(new Contact('Foobar', '[email protected]'));
$message->setTemplate('my_template');
$message->setData(['id' => '1']);

$app['mail.service']->send($message);