I'm trying to send mail using the following code and I'm using guzzlehttp
, but getting 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 <[email protected]>',
'to' => 'John Doe<[email protected]>',
'subject' => 'Hello John Doe',
'text' => 'Email Text'));
and i've replaced key and domain with my original.
I had the same problem.
Try:
$client = new \Http\Adapter\Guzzle6\Client();
$mailgun = new \Mailgun\Mailgun('api_key', $client);
Then:
$mailgun->sendMessage(.....)
Hope it help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With