- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我有以下部分基于 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/
Mailgun 是否可以仅将电子邮件的非附件部分 POST 到我的 API,以防止大附件影响应用程序的性能? 最佳答案 Mailgun 可以通过入站功能为您托管附件。 您可以使用事件 API 命令 s
我尝试通过更改帐户设置上的时区来更改日志上的时区,但未应用。如何更改日志上的时区? 最佳答案 如果没有改变,也许您可以在每封发送的电子邮件上添加您的日期和 o:deliverytime date(
免费计划 Mailgun 帐户每月可以发送 10,000 封电子邮件。我想知道是否有办法通过 API 查看发送和接收了多少电子邮件? 最佳答案 我认为您正在寻找的是 stats API 您可以使用它来
我有以下用例: 通过Mailgun批量发送发票 基本上我需要结合这些功能:- 收件人变量,以便每个收件人都能收到个性化的电子邮件- 每个收件人变量都包含已订购商品的列表- 每个项目都有属性,如:名称、
目前,当我从 Mailgun SMTP 发送邮件但未送达时,邮件会静静地丢弃,并且有关它的跟踪只会出现在日志中。是否可以像在标准电子邮件帐户中那样在递送失败时收到递送通知? (送货单如:这是自动生成的
我无法弄清楚如何在与 Mailgun 集成 SMTP 的电子邮件中添加取消订阅链接。 有什么想法吗? 最佳答案 Mailgun 为您提供了几个取消订阅变量: 1) %unsubscribe_url%
我正在通过 node.js 应用程序向 Mailgun 发送电子邮件。我不断收到 421 语法错误消息。有时消息最终会被传递,以下是一条消息的历史记录: Date/Time Summary 201
我有一个包含 Google Cloud DNS 的域名。我的 SPF 记录不适用于 mailgun 域验证 v=spf1 include:spf.protection.outlook.com incl
我正在使用 CMS 在提交表单时发送电子邮件。它配置为使用 smtp.mailgun.org:587 和用户名 postmaster@domain.com。我的电子邮件使用 Google Apps,因
我已经设置了一个新帐户,但没有验证我的域。在继续验证和添加付款信息之前,我想测试并确认邮件发送。 我已经尝试过使用沙箱方法和 api key (包括 smtp)来 curl 。我还尝试使用顶级帐户邮件
我尝试用图书馆发送电子邮件Mailgun在 Codeigniter 中使用 composer 安装。我收到一些错误: Fatal error: Sendmail cannot use Mailgun\
我在 Heroku 的生产环境中遇到了问题,使用 Devise 可确认的电子邮件。为此,我一直在使用 Mailgun,现在正在迁移到 Mandrill。所有对 Mailgun 的引用都已从代码中删除,
编辑:我尝试实现 gzip 但无法使其与 zipfile 库一起使用。文档似乎表明 zlib 是唯一兼容的库。我还尝试重新安装 zlib。 我在创建的 Python 脚本中遇到了一个奇怪的问题。该脚本
我想用 mailgun 处理交易电子邮件。 并使用 gsuite 作为我的“普通”商业电子邮件提供商。 在每个 mailgun 支持页面上,您都会看到以下消息: 警告 如果您已经有其他提供商处理您的域
我们正在支持在我们的应用程序中跟踪 Mailgun 事件。我们审查了提议的 event polling algorithm但发现自己不太适应。首先,我们不希望丢弃我们已经获取的数据,然后在暂停后从头开
我希望能够从 foo@*.mydomain.com 发送并接收响应,而无需为我感兴趣的每个子域(bar.mydomain.com、baz.mydomain.com 等)手动设置 MX 记录。 com
我正在开发的应用程序中使用 Mailgun。发送电子邮件工作正常,现在我正在尝试将其设置为接收传入电子邮件。 我根据 Mailgun 文档进行了设置,以便将所有内容自动转发到我常用的电子邮件地址。然后
我很快就会将很多客户从 Mandrill 迁移出去,而 Mailgun 听起来不错,所以我将一个小客户转移过来,但已经跳转到一个有效地址: 服务器响应:554 554 BigPond 入站连接被拒绝。
我正在使用 php 框架 Laravel 将带有 mailgun 的电子邮件发送到某个列表。电子邮件已发送,所有链接已更改为 email.mg.mydomain/c/.... 出于某种原因,在我发送的
在 here 有很好的例子这说明了如何从命令行发送电子邮件。我的问题是我不明白附件是如何工作的。这是示例代码: curl -s --user 'api:YOUR_API_KEY' \ http
我是一名优秀的程序员,十分优秀!