SendGrid的PHP库中的sendgrid-php.php文件在哪里


Where is the sendgrid-php.php file in SendGrid's PHP library?

我需要

包含在脚本中的 sendgrid-php.php 文件在哪里,以便使用 Github 的 SendGrid 的 PHP 库通过 SendGrid 发送邮件?

我已经从 https://github.com/sendgrid/sendgrid-php 下载了SendGrid的PHP库,我希望在我的脚本中包含sendgrid-php.php。我没有使用作曲家。

我的包含看起来像:

require("../lib/sendgrid-2016/sendgrid-php.php");
$from = new SendGrid'Email(null, "from@test.com");
$subject = "Hello World from the SendGrid PHP Library";
$to = new SendGrid'Email(null, "to@test.com");
$content = new SendGrid'Content("text/plain", "some text here");
$mail = new SendGrid'Mail($from, $subject, $to, $content);
$apiKey = getenv('MY API KEY');
$sg = new 'SendGrid($apiKey);
$response = $sg->client->mail()->send()->post($mail);
echo $response->statusCode();
echo $response->headers();
echo $response->body(); 

当我运行脚本时,出现错误:

致命错误:require():需要打开失败 '../lib/sendgrid-2016/sendgrid-php.php'

查看 Github 上的 zip 中包含的文件,我什至没有看到该文件:来自 GitHub 的文件列表

似乎您可能已经下载了存储库.zip(由 github 生成),而不是自述文件中提到的打包 zip:https://github.com/sendgrid/sendgrid-php#alternative-install-package-from-zip