我正在尝试使用以下代码发送邮件,我正在使用 guzzlehttp
,但收到 Fatal error: Uncaught exception 'RuntimeException'
消息 '埔里工厂不可用'
.请帮我找到解决方案,谢谢!
这是我的代码:
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'));
并且我已经用原来的替换了 key 和域。
最佳答案
我遇到了同样的问题。
尝试:
$client = new \Http\Adapter\Guzzle6\Client();
$mailgun = new \Mailgun\Mailgun('api_key', $client);
然后:
$mailgun->sendMessage(.....)
希望对你有帮助。
关于php - fatal error : Uncaught exception 'RuntimeException' with message 'Puli Factory is not available' while sending mail using mailgun,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36443480/