承接 duta/duta-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

duta/duta-php

Composer 安装命令:

composer require duta/duta-php

包简介

Official PHP SDK for Duta — transactional email for developers.

README 文档

README

Official PHP client for Duta. Uses cURL, no third-party dependencies.

Install

composer require duta/duta-php

Quickstart

require 'vendor/autoload.php';

$duta = new \Duta\Client('duta_live_xxx');

$result = $duta->emails->send([
    'from' => 'hello@yourdomain.com',
    'to' => 'user@example.com',
    'subject' => 'Welcome to Duta',
    'html' => '<p>Thanks for signing up!</p>',
]);

echo "Sent: " . $result['id'];

Get an API key from the dashboard. The sender domain must be verified first.

Error handling

Methods throw \Duta\DutaException on failure:

use Duta\DutaException;

try {
    $duta->emails->send([ /* ... */ ]);
} catch (DutaException $e) {
    echo $e->statusCode . ' ' . $e->name . ': ' . $e->getMessage();
    // $e->name: authentication_error | permission_denied | rate_limit_exceeded | ...
}

API

new \Duta\Client(string $apiKey, string $baseUrl = ..., int $timeout = 30)

$duta->emails->send(array $params)

$params keys: from, to (string or array), subject, html, text, reply_to, tags (assoc array). Returns an array with id and status.

$duta->emails->get(string $id)

Retrieve one email. Requires a full-access API key.

$duta->emails->list(int $page = 1, int $limit = 20)

List emails, newest first. Requires a full-access API key.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固