txthinking / mailer
A very lightweight PHP SMTP mail sender
Installs: 76 514
Dependents: 5
Suggesters: 0
Security: 0
Stars: 93
Watchers: 12
Forks: 37
Open Issues: 5
Requires
- php: >=5.3.2
- psr/log: ~1.0
Requires (Dev)
- monolog/monolog: ~1.13
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-10-27 22:30:36 UTC
README
A lightweight SMTP mail sender
Install
$ composer require txthinking/mailer
# or
$ composer require txthinking/mailer:dev-master
Usage
<?php
use Tx\Mailer;
$ok = (new Mailer())
->setServer('smtp.server.com', 25)
->setAuth('tom@server.com', 'password')
->setFrom('Tom', 'tom@server.com')
->setFakeFrom('Obama', 'fake@address.com') // if u want, a fake name, a fake email
->addTo('Jerry', 'jerry@server.com')
->setSubject('Hello')
->setBody('Hi, Jerry! I <strong>love</strong> you.')
->addAttachment('host', '/etc/hosts')
->send();
var_dump($ok);
More Example