A lightweight SMTP mail sender
$ composer require txthinking/mailer
# or
$ composer require txthinking/mailer:dev-master
<?php
use Tx\Mailer;
$ok = (new Mailer())
->setServer('smtp.server.com', 25)
->setAuth('[email protected]', 'password')
->setFrom('Tom', '[email protected]')
->setFakeFrom('Obama', '[email protected]') // if u want, a fake name, a fake email
->addTo('Jerry', '[email protected]')
->setSubject('Hello')
->setBody('Hi, Jerry! I <strong>love</strong> you.')
->addAttachment('host', '/etc/hosts')
->send();
var_dump($ok);
More Example