gpt4 book ai didi

php mailgun 错误意外)

转载 作者:搜寻专家 更新时间:2023-10-31 22:02:12 24 4
gpt4 key购买 nike

我有以下部分基于 Mailgun 文档的代码。我在错误日志中得到这个:

14-Nov-2014 04:21:52 UTC] PHP Parse error: syntax error, unexpected ')' in /home/[USERNAME]/public_html/m/FileName.php on line 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 mailgun 错误意外),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26922970/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com