定制 phphleb/muller 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phphleb/muller

最新稳定版本:v2.0.0

Composer 安装命令:

composer require phphleb/muller

包简介

Mailer for PHP Framework HLEB2

README 文档

README

HLEB1 HLEB2 PHP PHP License: MIT

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

$ composer require phphleb/muller

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

// Include or autoload
include '<vendor directory>/phphleb/muller/Src/DefaultMail.php';
include '<vendor directory>/phphleb/muller/Src/Errors.php';
include '<vendor directory>/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('<storage directory>/logs');
$mail->saveOnlyToFile(false);
$mail->saveFileIntoDirectory('<storage directory>/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('
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body style="margin: 0; padding: 0; background-color: #E1D2C1; color: #000000">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td> 
                    Test letter text.
                </td>
            </tr>
        </table>
    </body>
</html>
');
$mail->send();

var_dump($mail->getErrors());

统计信息

  • 总下载量: 850
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-24