mailgun / mailgun-php

Mailgun's Official SDK for PHP
http://www.mailgun.com
MIT License
1.1k stars 314 forks source link

DiscoveryFailedException: Could not find resource using any discovery strategy #835

Closed stccorp closed 2 years ago

stccorp commented 2 years ago

I use the example code from mailgun composer.json { "require": { "mailgun/mailgun-php": "3.5.2" } }

test.php require 'vendor/autoload.php'; use Mailgun\Mailgun; $mg = Mailgun::create('my- key-here'); // For US servers

$mg->messages()->send('my-domain-here', [ 'from' => 'bob@example.com', 'to' => 'sally@example.com', 'subject' => 'The PHP SDK is awesome!', 'text' => 'It is so simple to send a message.' ]);

Error:

PHP Fatal error: Uncaught Http\Discovery\Exception\DiscoveryFailedException: Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors

stccorp commented 2 years ago

Forgot to read the instructions and include symfony/http-client nyholm/psr7