定制 hyperdigital/raw-email 二次开发

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

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

hyperdigital/raw-email

最新稳定版本:1.0.1

Composer 安装命令:

composer require hyperdigital/raw-email

包简介

Raw email library

README 文档

README

This library simplifies work with emails in PHP. The main class – RawEmail.php offers building a raw email. The raw email supports:

  • Attachments
  • Multiple recipients
  • Both HTML and Plain text versions

Install via composer

composer require hyperdigital/raw-email

Use

<?php

use Hyperdigital\RawEmail\RawEmail;

$html = "<h1>HTML version</h1>";
$rawEmail = new RawEmail("no-reply@hyperdigital.de", "no-reply@hyperdigital.de");
$rawData = $rawEmail->build(array('developer@hyperdigital.de'), 'Some subject', 'Plain text version', $html);

// Send the email data

Use with Amazon SES (example using ^2.8)

  • Install aws/aws-sdk-php via composer
composer require aws/aws-sdk-php ^2.8
<?php

use Aws\Common\Aws;
use Hyperdigital\RawEmail\RawEmail;

$html = "<h1>HTML version</h1>";
$rawEmail = new RawEmail("no-reply@hyperdigital.de", "no-reply@hyperdigital.de");
$rawData = $rawEmail->build(array('developer@hyperdigital.de'), 'Some subject', 'Plain text version', $html);

$aws = Aws::factory($credentials);
$ses = $aws->get('Ses');

$ses->sendRawEmail(array(
    'RawMessage' => array(
        'Data' => base64_encode($rawData),
        ),
    )
);

Advanced

If you need some additional functionality, feel free to inspect how RawEmail.php class works and use the component classes to create your customized emails.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2015-06-04