水静压/浏览-Mailgun 脚本

浏览-Mailgun:一个使用Curl的轻量级Mailgun脚本。

支持包维护!
Issuehunt
Ko Fi

0.29.0 2017-10-15 21:35 UTC

This package is not auto-updated.

Last update: 2024-09-20 18:39:17 UTC


README

Browning 是一个用于通过 Mailgun 发送电子邮件的微型 PHP 函数,它使用 CURL 而不是 Mailgun 的(略为臃肿的)库。

Normal Code Climate

设置

在使用此脚本之前,尽可能确保已安装以下包。某些包可能无需安装即可工作,但所有包都是推荐安装的。CURL 是必需的。libmagic-dev php-dev libcurl3 php-curl

使用方法

使用时,可以这样操作。

require '_settings/browning.default.php';
include '_settings/browning.custom.php';
require '_functions/browning/function.browning.php';

$Mail = Browning(
	'recepient@example.com',
	'Message Subject',
	'Text or HTML Body',
	'Sender Name',
	'reply-to@example.com',
	true // debug
);

if ( $Mail['Success'] ) {
	echo '<h2>Success! We managed to send the E-Mail.</h2>'.PHP_EOL;
	echo '<p class="sub-title">Thanks for believeing in us.</p>'.PHP_EOL;
} else {
	echo '<h2>Sorry, we failed to send the E-Mail.</h2>'.PHP_EOL;
	echo '<p class="sub-title error">'.$Mail['Error'].'</p>'.PHP_EOL;
	echo '<!--'.PHP_EOL;
	var_dump($Mail);
	echo PHP_EOL.'-->'.;
}