-
Notifications
You must be signed in to change notification settings - Fork 630
Permission denied, wrong credentials when using sendgrid-php 6.0.0 on PHP 7.2.3 #584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like downstream dependency is properly broken — 2 last patches have introduced different regressions, see sendgrid/php-http-client@46dcffa. Workaround is to pin |
@thedotedge makes sense. Thanks! |
Correction: it's actually 3.8.0 that works, all subsequent versions are broken. I wonder if it even makes sense to depend on In fact, even API is broken after |
@thedotedge Pinning to 3.9.0 introduced a notice (seen below), but 3.8.0 seems to do the trick. Thanks!
|
Please try php-http-client 3.9.2, that version should be good to go. Thanks! |
@thinkingserious does it work for you? For me every request was returning 401. |
@thinkingserious I also receive a 401 when using php-http-client 3.9.2. It appears the problem might lie in Client.php around lines 192-196: if (isset($headers)) {
$headers = array_merge($this->headers, $headers);
} else {
$headers = []; // If $headers is null, $this->headers never gets used in the request.
} Should probably be changed to: if (isset($headers)) {
$headers = array_merge($this->headers, $headers);
} else {
$headers = $this->headers; // If $headers is null, $this->headers will still be used in the request.
} When this change is made, I'm able to successfully send email. I'm not too familiar with the library, so this might not be the best/correct place to solve the issue. |
It was working for me when using With Best Regards, Elmer |
Thanks again to everyone on this thread for helping get a fix pushed out quickly. I have verified that this bug is fixed using 3.9.3 in Thanks again! |
Related to #585. |
Issue Summary
When attempting to call
$sg->client->mail()->send()->post($mail);
per the Quick Start in README.md, I'm receiving the error "Permission denied, wrong credentials". I have verified that the API key I am using is correct and also have tried creating new API keys.Where it gets interesting is that if I downgrade the sendgrid-php library to version 5.0.0, I'm able to successfully send an email.
Any thoughts here would be helpful! Thanks
Steps to Reproduce
Run the code from the Quick Start in README.md.
Technical details
The text was updated successfully, but these errors were encountered: