2017 © Pedro Peláez
 

library mail

Send email in a simple and beautiful way

image

komicho/mail

Send email in a simple and beautiful way

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Komicho Mail

You can send electronic mail or more using the templates, (*1)

Install via composer

Add orm to composer.json configuration file., (*2)

$ composer require komicho/mail

And update the composer, (*3)

$ composer update

code

require 'vendor/autoload.php';

use komicho\mail;

$mail = new mail;

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

tem

Choose the template file, (*4)

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

demo

Certain before transmission, (*5)

$mail -> demo();

send

To Send Email use, (*6)

$mail -> send();

out

Output the result as a array, (*7)

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

example

We establish the code to send mail and file template, (*8)

file template : tems/default.php, (*9)

<html>
<body>
    <section style="width: auto; background: #f5f5f5;border-top: 5px solid #09c; padding: 25px;">
        <h1>username : <?=$name?></h1>
        <h2>password : <?=$pass?></h2>
        <ul>
            <?php foreach($loop as $v): ?>
            <li><?=$v?></li>
            <?php endforeach; ?>
        </ul>
    </section>
</body>
</html>

some examples

require 'vendor/autoload.php';

use komicho\mail;

$mail = new mail;

$mail -> from('from@mail.com');
$mail -> to('to@mail.com');
$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);

Another example

require 'vendor/autoload.php';

use komicho\mail;

$mail = new mail;

$res = $mail
    -> from('from@mail.com')
    -> to('to@mail.com')
    -> subject('subject')
    -> tem('tems/default')
    -> data([
        'name' => 'karim',
        'pass' => '132456',
        'loop' => ['users','admin']
    ])
    -> demo()
    -> out();
echo '

<

pre>';
print_r($res);

The Versions

21/08 2017

dev-master

9999999-dev https://github.com/komichoLab/mail

Send email in a simple and beautiful way

  Sources   Download

mail php komicho

21/08 2017

V1.0.0

1.0.0.0 https://github.com/komichoLab/mail

Send email in a simple and beautiful way

  Sources   Download

mail php komicho