我正在尝试使用php中的postmarkapp api发送电子邮件,我已经设法让它发送普通电子邮件。我已经将该类上传到了与index.php相同的目录中,但"use"函数似乎给了我一个我不知道的错误。
错误:
Parse error: syntax error, unexpected '.', expecting identifier (T_STRING) in /public_html/index.php on line 5
Index.php
// Import the Postmark Client Class.
use PostmarkModelsPostmarkAttachment;
use PostmarkPostmarkClient.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",
]);
同一目录邮戳/我有这个类(正式类)
https://github.com/wildbit/postmark-php/tree/master/src/Postmark
感谢您抽出时间阅读,非常感谢。
我认为您需要'使用Postmark\PostmarkClient;'而不是"使用Postmark\PostmarkClient.php;"