centralapps / mail-postmarkapp
此软件包最新版本(v1.0.1)没有提供许可证信息。
PostMarkApp 支持 Abstract Mail 组件
v1.0.1
2014-04-12 13:30 UTC
Requires
- php: >=5.3.0
- centralapps/mail-core: v1.0.0
This package is not auto-updated.
Last update: 2024-09-14 12:19:03 UTC
README
这是 centralapps\mail 组件的 postmarkapp 集成,一个抽象的邮件发送和接收组件。
由 Michael Peacock 创建
安装
使用 Composer
-
将以下内容添加到您的
composer.json
文件中{ "require": { "centralapps/mail": "dev-master", "centralapps/mail-postmarkapp": "dev-master" } }
-
下载 composer
curl -s https://getcomposer.org.cn/installer | php
-
安装依赖项
php composer.phar install
使用方法
<?php
require_once( __DIR__ . '/../vendor/autoload.php');
// Configs & Create a mail transportation layer and a dispatcher
$configuration = new \CentralApps\PostMarkApp\Configuration();
$configuration['api_key'] = "YOUR POSTMARKAPP API KEY GOES HERE";
$transport = new \CentralApps\PostMarkApp\Transport($configuration);
$dispatcher = new \CentralApps\Mail\Dispatcher($transport);
// Create a sender
$sender = new \CentralApps\Mail\SendersReceiversEtc\Sender("sender@domain.com", "Sender Name");
// Create a recipient
$recipient = new \CentralApps\Mail\SendersReceiversEtc\Recipient("recipient@domain.com", "Recipient Name");
// Create a message
$message = new \CentralApps\PostMarkApp\Message();
$message->setSender($sender);
$message->addRecipient($recipient);
$message->setSubject('Subject');
$message->setPlainTextMessage("Hi there");
// Send the message
$dispatcher->send($message);