A lightweight PHP SMTP mail sender
Clone or download
Latest commit 49cd4e5 Dec 3, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Update Message.php Nov 30, 2018
tests support tlsv1.0 tlsv1.1 tlsv1.2 Oct 9, 2018
.gitattributes Remove blankline Sep 28, 2016
.gitignore Ignore phpunit.xml locally Sep 28, 2016
.travis.yml remove php5.6 test, next version will unsupport Oct 9, 2018
LICENSE change license Sep 25, 2013
README.md readme Jul 29, 2016
composer.json support tlsv1.0 tlsv1.1 tlsv1.2 Oct 9, 2018
phpunit.xml.dist Rename phpunit.xml to phpunit.xml.dist Sep 28, 2016

README.md

Mailer Build Status

A lightweight SMTP mail sender

Install

$ composer require txthinking/mailer

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