bulldog/mailgun 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

bulldog/mailgun

Composer 安装命令:

composer require bulldog/mailgun

包简介

Simple PHP Client for Mailgun

README 文档

README

Build Status

While Mailgun does an excellent job at implementing the adapter pattern, coding to an interface, using PSR, and other things, this package does not. The curl extension is the only requirement for this package.

I often found myself needing a quick, simple solution for sending email when using PHP. I love Mailgun, but always felt like their PHP client included too many features for what I needed to do. So I wrote a very limited API client that only does one thing, and it does it well.

Installation

composer require bulldog/mailgun

Usage

Basic Usage

<?php
use Bulldog\Mailgun;
$mg = new Mailgun('mg.your-domain.com', 'key-tops3cretk3y');
$mg->send('to.someone@example.com', 'from.someone@example.com', 'Important Subject', 'Your message.');

Advanced Usage

The fifth param for the send method accepts an array. In that array you can add any of the params listed in the Mailgun docs. So if you need to cc someone, you would:

<?php
use Bulldog\Mailgun;
$mg = new Mailgun('mg.your-domain.com', 'key-tops3cretk3y');
$mg->send('to.someone@example.com', 'from.someone@example.com', 'Important Subject', 'Your message.', [
    'cc' => 'copy.someone@example.com',
]);

Or if you wanted to send an email, you could do the following:

<?php
use Bulldog\Mailgun;
$mg = new Mailgun('mg.your-domain.com', 'key-tops3cretk3y');
$mg->send('to.someone@example.com', 'from.someone@example.com', 'Important Subject', 'Your message.', [
    'html' => '<html><head></head><body><h1>Hi there</h1></body></html>',
]);

You can add as many additional params as you need.

<?php
use Bulldog\Mailgun;
$mg = new Mailgun('mg.your-domain.com', 'key-tops3cretk3y');
$mg->send('to.someone@example.com', 'from.someone@example.com', 'Important Subject', 'Your message.', [
    'cc' => 'copy.someone@example.com',
    'v:important' => 'true',
    'o:tag' => 'client_x_email',
]);

https://documentation.mailgun.com/en/latest/api-sending.html#sending

Compatibility

This package will work with, and tested on the following PHP versions:

  • 5.5
  • 5.6
  • 7.0
  • 7.1
  • 7.2
  • 7.3

You must have the curl extension installed to use this package.

Contributions

Always welcome! Just keep it simple, please. Open an issue for discussion, then fork the repo, create a topic branch, and do a pull request. We can figure everything else out later.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固