added basic library,
added instruscions into README
This commit is contained in:
27
examples/example1.php
Normal file
27
examples/example1.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/../src/Emailer.php';
|
||||
|
||||
use TPsoft\Emailer\Emailer;
|
||||
|
||||
$config = array(
|
||||
'smtp' => array(
|
||||
'host' => 'smtp.gmail.com',
|
||||
'port' => 465,
|
||||
'username' => 'username',
|
||||
'password' => 'password',
|
||||
'encryption' => 'ssl'
|
||||
),
|
||||
'imap' => array(
|
||||
'host' => 'imap.gmail.com',
|
||||
'port' => 993,
|
||||
'encryption' => 'ssl',
|
||||
'folder' => 'Sent',
|
||||
'username' => 'username',
|
||||
'password' => 'password'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$emailer = new Emailer($config);
|
||||
$emailer->send('joe@exemple.com', 'Test at ' . date('Y-m-d H:i:s'), 'Plain text message', '<html><body style="color: red;">HTML message</body></html>');
|
Reference in New Issue
Block a user