Mailer icon indicating copy to clipboard operation
Mailer copied to clipboard

A lightweight PHP SMTP mail sender

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('[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