【发布时间】:2015-01-11 10:19:15
【问题描述】:
我的以下代码部分基于 Mailgun 文档。我在错误日志中得到了这个:
2014 年 11 月 14 日 04:21:52 UTC] PHP 解析错误:语法错误,意外 ')' 在 /home/[USERNAME]/public_html/m/FileName.php 第 36 行
这是我的源代码:
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
date_default_timezone_set('EST');
# Include the Autoloader (see "Libraries" for install instructions)
require 'vendor/autoload.php';
require 'html2text.php';
use Mailgun\Mailgun;
# Instantiate the client.
$mgClient = new Mailgun('[KEY]');
$domain = "[DOMAIN]";
$html = $_POST["message"];
$text = convert_html_to_text($html);
$date = date('l, F jS ');
# Make the call to the client.
$result = $mgClient->sendMessage($domain, array(
'from' => '[EMAIL]',
'to' => '[EMAIL]',
'cc' => '[EMAIL]',
'subject' => 'New reminder for ' . $date,
'text' => 'Hey, ' . "\n" . $text . "\n" . 'More text',
'html' => '<html><body>Hey, ' . "\n" . $html . "\n" . 'More Text.</body></html>'
), );
print '<h1>Sent successfully</h1>';
?>
对正在发生的事情有任何想法吗?第 36 行是结束数组的行。
【问题讨论】:
标签: php syntax-error mailgun