simonmao / simple-mailer
A simple mail client based on the phpmailer package.
dev-develop
2020-07-11 12:32 UTC
Requires
- phpmailer/phpmailer: ^6.1
This package is auto-updated.
Last update: 2025-04-11 22:59:12 UTC
README
Usage
composer require simonmao/simple-mailer
Example
Mail Config
config.yaml
email: debug: true host: smtpserver.com port: 587 username: yourname@domain.com password: password encryption: tls # tls/ssl fromEmail: yourname@domain.com fromName: "Mailer"
Load Config
$conf = Noodlehaus\Config::load('config.yaml') ->get('email');
Initialization
$mailer = new \SimpleMailer\SimpleMailer($conf);
Send Text Mail
$bool = $mailer->sendText('xxx@email.com', 'Title', 'hello'); var_dump($bool);
Send HTML Mail
$bool = $mailer->sendHTML('xxx@email.com', 'Title', '<h1>hello</h1>'); var_dump($bool);
Dependents
phpmailer/phpmailer