0

我正在尝试使用 php 中的 postmarkapp api 发送电子邮件,我已经设法让它发送普通电子邮件。我已将该类上传到与 index.php 相同的目录,但“使用”功能似乎给了我一个我不知道的错误。

错误:

Parse error: syntax error, unexpected '.', expecting identifier (T_STRING) in /public_html/index.php on line 5

索引.php

// Import the Postmark Client Class.
use Postmark\Models\PostmarkAttachment;
use Postmark\PostmarkClient\.php;

// Create Client
$client = new PostmarkClient("MY API KEY - CENSORED");

// Make a request
$sendResult = $client->sendEmailWithTemplate(
  "sender@example.com",
  "recipient@example.com", 
  TEMPLATEID-CENSORED,
  [
  "product_name" => "product_name_Value",
  "name" => "name_Value",
  "action_url" => "action_url_Value",
  "username" => "username_Value",
  "sender_name" => "sender_name_Value",
  "product_address_line1" => "product_address_line1_Value",
  "product_address_line2" => "product_address_line2_Value",
]);

同目录 Postmark/ 我有这个课(官方课)

https://github.com/wildbit/postmark-php/tree/master/src/Postmark

感谢您花时间阅读,非常感谢。

4

1 回答 1

0

我认为你需要'使用 Postmark\PostmarkClient;' 而不是“使用 Postmark\PostmarkClient.php;”

于 2015-10-30T01:06:53.963 回答