Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.12.34.96
<?php
// If you are using Composer (recommended)
//require 'vendor/autoload.php';
// If you are not using Composer
require("sendgrid-php/lib/sendgrid-php.php");
error_reporting(E_ALL);
ini_set('display_errors', 'on');
$from = new SendGrid\Email("Example User", "support@logisys.org");
$subject = "Sending with SendGrid is Fun";
$to = new SendGrid\Email("Example User", "prashanth.k@logisys.org");
$content = new SendGrid\Content("text/plain", "and easy to do anywhere, even with PHP");
$mail = new SendGrid\Mail($from, $subject, $to, $content);
$apiKey = getenv('SENDGRID_API_KEY');
$apiKey = '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';
$sg = new \SendGrid($apiKey);
$response = $sg->client->mail()->send()->post($mail);
echo $response->statusCode();
print_r($response->headers());
echo $response->body();
|