Php Mailgun无效参数

Php Mailgun无效参数,php,api,mailgun,Php,Api,Mailgun,为什么此代码在向mailgun邮件列表发送电子邮件时出现错误 $mailgun->sendMessage(MAILGUN_DOMAIN,[ 'from' => 'test@samples.mailgun.org', 'to' => MAILGUN_LIST, 'subject' => $subject, 'html' => $body.'<br><br><a hre

为什么此代码在向mailgun邮件列表发送电子邮件时出现错误

$mailgun->sendMessage(MAILGUN_DOMAIN,[

'from'          => 'test@samples.mailgun.org',
'to'            => MAILGUN_LIST,
'subject'       => $subject,
'html'          => $body.'<br><br><a href="%unsubscribe_url%">Unsubscribe</a>'

                    ]);
我收到的致命错误如下所示:

致命错误:未捕获的Mailgun\Connection\Exceptions\MissingRequiredParameters:传递给API的参数无效。检查您的输入!沙盒子域仅用于测试目的。请在域设置中添加您自己的域或将地址添加到授权收件人。在C:\xampp\htdocs\webapp\vendor\mailgun\mailgun php\src\mailgun\Connection\RestClient.php:226堆栈跟踪:0 C:\xampp\htdocs\webapp\vendor\mailgun\mailgun\php\src\mailgun\Connection\RestClient.php99:mailgun\Connection\RestClient->responseHandlerObjectGuzzleHttp\Psr7\Response 1C:\xampp\htdocs\webapp\vendor\mailgun\mailgun php\src\mailgun\Connection\RestClient.php151:mailgun\Connection\RestClient->send'POST',sandboxb676bd53…',ObjectGuzzleHttp\Psr7\Stream,Array 2 C:\xampp\htdocs\webapp\vendor\mailgun\mailgun php\src\mailgun\mailgun.php118:mailgun\Connection\RestClient->POST'sandboxb676bd53…,Array,第226行C:\xampp\htdocs\webapp\vendor\mailgun\mailgun php\src\mailgun\mailgun.php61:mailgun\mailgun->post'沙箱中的C:\xampp\htdocs\webapp\vendor\mailgun\mailgun php\src\mailgun\Connection\RestClient.php

未捕获的Mailgun\Connection\Exceptions\MissingRequiredParameters: 传递给API的参数无效。检查您的输入!沙箱 子域仅用于测试目的。请添加您自己的域或 将地址添加到域设置中的授权收件人

如果您是从沙箱域发送,则需要配置允许的收件人列表(最多5个用户)。有关更多详细信息,请参阅

我也不确定它是否允许您发送到沙箱下的邮件列表。此外,您的发件人地址还应具有与沙箱域相同的域。

Mailgun电子邮件

                    $result = $mgClient->sendMessage($domain, array(
                    'from'    => ''.$txt_fname.' <'.$txt_femail.'>',
                    'to'      => ''.$email_address.'',
                    'subject' => ''.$txt_subject.'',
                    'text' =>''.$txt_only.'',
                    'html'    => '<html><body>'.$email_message.'</body></html>'
                ),$file_array);

我已将订阅列表中的邮件id添加到授权收件人列表中,但仍会引发相同的错误,我认为我们不需要在发件人地址中使用相同的域。每当我尝试从沙箱发送具有不同域的电子邮件时,它都会以静默方式失败。此外,列表中的收件人是否也设置为授权收件人?我不完全确定这是怎么回事。