Emailer/examples/example1.php
2025-06-21 20:58:04 +02:00

28 lines
614 B
PHP

<?php
require_once __DIR__ . '/../vendor/autoload.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>');