Fatal error: "RuntimeException" exception was thrown with the message "Puli Factory is unavailable" when sending mail using mailgun

I try to send mail using the following code and I use guzzlehttp but I get Fatal error: Uncaught exception 'RuntimeException' with the message 'Puli Factory is not available' . Please help me find a solution, thanks!

Here is my code:

 require 'vendor/autoload.php'; use Mailgun\Mailgun; # Instantiate the client. $mgClient = new Mailgun('key-'); $domain = "domain"; # Make the call to the client. $result = $mgClient->sendMessage("$domain", array('from' => 'Mailgun Sandbox < xxxxxx@sandbox.mailgun.org >', 'to' => 'John Doe< xxxxx@abc.com >', 'subject' => 'Hello John Doe', 'text' => 'Email Text')); 

and I replaced the key and domain with my original.

+7
php guzzle mailgun
source share
1 answer

I had the same problem.

Try:

 $client = new \Http\Adapter\Guzzle6\Client(); $mailgun = new \Mailgun\Mailgun('api_key', $client); 

Then:

 $mailgun->sendMessage(.....) 

I hope he helps you.

+7
source share

All Articles