Emailer/examples/example1.php
igor 8d9ee9a498 added basic library,
added instruscions into README
2025-06-21 18:33:36 +02:00

28 lines
610 B
PHP

<?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>');