LoginSignup
0
0

More than 5 years have passed since last update.

Mailgun-PHPで"Puli Factory is not available"エラーが出た時

Posted at

Mailgun-PHP (v2.0)をREADMEの

$mailgun = new \Mailgun\Mailgun('api_key');
$domain = "example.com";
$mailgun->sendMessage($domain,[..送信データ])

のように使おうとしたら

RuntimeException: Puli Factory is not available

というエラーが出てしまいました。
調べると

http://stackoverflow.com/questions/36443480/fatal-error-uncaught-exception-runtimeexception-with-message-puli-factory-is

こちらのstackoverflowで解決方法のひとつが見つかりました。

まずはGuzzle6HTTPAdapterをインストール

$ composer require php-http/guzzle6-adapter

そして

$client = new \Http\Adapter\Guzzle6\Client(); 
$mailgun = new \Mailgun\Mailgun('api_key', $client);
$domain = "example.com";
$mailgun->sendMessage($domain,[..送信データ])

このようにしたらとりあえず使えるようになりました。
Mailgun-PHPのバージョンが上がるなどしてこの問題が解決したらソースを元に戻すことになるかもしれません。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0