0

我正在使用邮戳入站电子邮件功能构建一个 PHP 脚本 - 演示 PHP 代码为我抛出了各种错误。我从演示页面几乎逐字复制了代码,但 \ 似乎导致了 PHP 错误。演示代码主页在这里

我正在使用的代码:

require_once '/postmark/Autoloader.php';
\Postmark\Autoloader::register();

// this file should be the target of the callback you set in your postmark account
$inbound = new \Postmark\Inbound(file_get_contents('php://input'));

错误:

解析错误:语法错误,第 10 行 /home/path/page.api.email.php 中的意外 T_STRING

第 10 行是:\Postmark\Autoloader::register();

4

2 回答 2

1

听起来您可能没有运行 PHP >= 5.3 -命名空间(\Postmark\Autoloader) 仅在 >= 5.3 中受支持

于 2012-08-28T12:29:58.983 回答
0

尝试这个:

require_once '../postmark/Autoloader.php';
\Postmark\Autoloader::register();

// this file should be the target of the callback you set in your postmark account
$inbound = new \Postmark\Inbound(file_get_contents('php://input'));
于 2016-06-14T12:28:56.947 回答