PHP code example of komicho / mail

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

    

komicho / mail example snippets



use komicho\mail;

$mail = new mail;

$mail -> from('[email protected]');
$mail -> to('[email protected]');
$mail -> subject('subject');
$mail -> tem('tems/default');
$mail -> data([
    'name' => 'karim',
    'pass' => '132456',
    'loop' => ['users','admin']
]);
$mail -> demo();

$mail -> tem('tems/default');

$mail -> demo();

$mail -> send();

$res = $mail -> out();
echo '<pre>';
print_r($res);


use komicho\mail;

$mail = new mail;

$mail -> from('[email protected]');
$mail -> to('[email protected]');
$mail -> subject('subject');
$mail -> tem('tems/default');
$mail -> data([
    'name' => 'karim',
    'pass' => '132456',
    'loop' => ['users','admin']
]);
$mail -> send();
$res = $mail->out();
echo '<pre>';
print_r($res);


use komicho\mail;

$mail = new mail;

$res = $mail
    -> from('[email protected]')
    -> to('[email protected]')
    -> subject('subject')
    -> tem('tems/default')
    -> data([
        'name' => 'karim',
        'pass' => '132456',
        'loop' => ['users','admin']
    ])
    -> demo()
    -> out();
echo '<pre>';
print_r($res);