txthinking/mailer

A very lightweight PHP SMTP mail sender

v2.0.1 2018-10-09 10:47 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