Skip to content

Response status code 0 #348

@davidromani

Description

@davidromani

Issue Summary

I'm trying to execute this test script and it is always returning a zero error code status. No log, no more information about how to trace it. What can I do?

<?php
// If you are using Composer
require "<MY_PATH>/vendor/autoload.php";

$from = new SendGrid\Email(null, "<MY_FROM>@<EMAIL>");
$subject = "Hello World from the SendGrid PHP Library!";
$to = new SendGrid\Email(null, "<MY_TO>@<EMAIL>");
$content = new SendGrid\Content("text/plain", "Hello, Email!");
$mail = new SendGrid\Mail($from, $subject, $to, $content);

$sg = new \SendGrid("<MY_API_KEY>");

$response = $sg->client->mail()->send()->post($mail);
echo $response->statusCode() . PHP_EOL;
echo $response->body() . PHP_EOL;
echo implode(', ', $response->headers()) . PHP_EOL;

Steps to Reproduce

  1. git clone git@github.com:sendgrid/sendgrid-php.git
  2. write this test PHP script and replace my custom values
  3. execute test PHP script

Technical details:

  • sendgrid-php Version: master (latest commit: [46f85e6])
  • PHP Version: 7.0.8 (cli) (built: Jun 26 2016 12:30:44)
  • SO: OSX 10.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: help wantedrequesting help from the communitytype: questionquestion directed at the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions