2016-04-06 16 views
7

kullanarak posta gönderme, ancak mesajın 'Puli Factory is not available' ile Fatal error: Uncaught exception 'RuntimeException' elde ederken mesajla yakalanmamış özel durum 'RuntimeException' 'Puli Fabrika kullanılamaz' . Lütfen bir çözüm bulmama yardım edin, teşekkürler!Önemli hata: Aşağıdaki kodu kullanarak posta göndermeye çalışıyorum ve <code>guzzlehttp</code> kullanıyorum Mailgun

İşte benim kodudur:

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')); 

ve benim orjinali ile anahtarı ve etki alanını değiştirdik.

+0

Bu çözüm bulunamadı mı? https://github.com/php-http/discovery/pull/39 – Andrewus

cevap

7

Aynı problem vardı.

Dene: Sonra

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

:

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

sana yardımı Umut.

+3

Çalışması için 6 numaralı çarkı çekmeniz gerekecek. (php composer.phar php-http/guzzle6 adaptörü gerektirir:^1.0) – dorondo

+0

Bu sadece Gp 5 ile çalışacak mı? –

İlgili konular