An open API service indexing awesome lists of open source software.

https://github.com/phphleb/muller

Simple PHP Mailer
https://github.com/phphleb/muller

Last synced: 3 months ago
JSON representation

Simple PHP Mailer

Awesome Lists containing this project

README

          

## "Muller" is the strict Electronic Postman (PHP Mailer)

[![HLEB1](https://img.shields.io/badge/HLEB-1-olive)](https://github.com/phphleb/hleb) [![HLEB2](https://img.shields.io/badge/HLEB-2-darkcyan)](https://github.com/phphleb/hleb) ![PHP](https://img.shields.io/badge/PHP-7-blue) ![PHP](https://img.shields.io/badge/PHP-8-blue) [![License: MIT](https://img.shields.io/badge/License-MIT%20(Free)-brightgreen.svg)](https://github.com/phphleb/hleb/blob/master/LICENSE)

The `Muller` is not included in the original configuration of the framework [HLEB2](https://github.com/phphleb/hleb), so it must be copied to the folder with the vendor/phphleb libraries from the [github.com/phphleb/muller](https://github.com/phphleb/muller) repository or installed using Composer:

```bash
$ composer require phphleb/muller
```

Standard email sending via PHP function `mail(...)`. Used to confirm the registration of the framework, so SMTP is not supported.

```php
// Include or autoload
include '/phphleb/muller/Src/DefaultMail.php';
include '/phphleb/muller/Src/Errors.php';
include '/phphleb/muller/StandardMail.php';

$mail = new \Phphleb\Muller\StandardMail(true); // Allow sending to multiple destinations

$mail->setNameFrom('User Name');
$mail->setAddressFrom('mailbox@main-site.com');
$mail->setParameters('-fmailbox@main-site.com');
$mail->setTitle('Verification letter');

$mail->setDebug(true);
$mail->setDebugPath('/logs');
$mail->saveOnlyToFile(false);
$mail->saveFileIntoDirectory('/logs');

$mail->setTo('test-address-1@example-site.ru');
$mail->setTo('test-address-2@example-site.ru', 'Recipient 2');
$mail->setToMultiple(['test-address-3@example-site.ru' => 'Recipient 3', 'test-address-4@example-site.ru' => 'Recipient 4']);

$mail->setContent('








Test letter text.



');
$mail->send();

var_dump($mail->getErrors());

```