txthinking / mailer
A very lightweight PHP SMTP mail sender
Installs: 79 335
Dependents: 5
Suggesters: 0
Security: 0
Stars: 95
Watchers: 12
Forks: 35
Open Issues: 6
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-12-22 23:06:49 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