mozgomoika/mailer

This package is abandoned and no longer maintained. No replacement package was suggested.

dev-default 2018-04-26 16:36 UTC

This package is not auto-updated.

Last update: 2018-09-28 00:37:11 UTC


README

PHP mail()

<?php

use Mozgomoika\Mailer;

require_once 'vendor/autoload.php';

try {
    $mailer = new Mailer('Имя отправителя по умолчанию');
    $mailer->from('from@email.com', 'Вася Пупкин');
    $mailer->address('to@email.com', 'Петя Сидоров');
    $mailer->subject('Тестовое письмо');
    $mailer->text('тест');
    $mailer->send();
} catch (\Exception $e) {
    echo $e->getMessage();
}

SMTP

<?php

use Mozgomoika\Mailer;

require_once 'vendor/autoload.php';

try {
    $mailer = new Mailer('Имя отправителя по умолчанию');
    $mailer->smtp('smtp.email.com', 'from@email.com', 'password', 'ssl', 465);
    $mailer->address('to@email.com', 'Петя Сидоров');
    $mailer->subject('Тестовое письмо');
    $mailer->image('example.jpg', 'example');
    $mailer->html('<h1>Тест</h1>');
    $mailer->send();
} catch (\Exception $e) {
    echo $e->getMessage();
}