1

我添加域的 api 调用失败,假设我的 apikey 是正确的,为什么它会告诉我传递给 API 的参数无效?我遵循了http://documentation.mailgun.com/api-domains.html#example上的示例代码——添加域。我是否必须已经设置了一个 smtp 密码,或者我是否要在通话中添加一个新密码?

我的代码:

    $mgClient = new Mailgun($this->getMailgunAPIKey());

    $domain = $this->getMailgunDomain();

    # Issue the call to the client.
    $result = $mgClient->post("domains", array(
          'name' => 'outbondxxx.mydomeainxxx.com',
          'smtp_password' => 'cagfavapassword'));

谢谢

PS 用 mailgun 开了一张关于这个的支持票。

4

1 回答 1

0

您使用该smtp_password属性设置的密码是在您指定的域中使用 SMTP的新密码。

对于调试,您可以尝试使用 cURL 手动添加域,例如。验证您使用的 API 密钥等是否正确。

开始这个调试路线我建议首先尝试数据获取GET调用以验证正确的设置 - 您可以简单地尝试首先使用您的凭据和/domains端点查询注册的域。

于 2014-03-22T06:52:45.650 回答