没有明显原因,MailGun参数无效

我有一个非常简单的代码,在我的Symfony2应用程序中使用MailGun:</ p>

  public function sendNewEmail()
{
$ message = \ Swift_Message :: newInstance()
  • &gt; setSubject('Any random subject')
  • &gt; setFrom('welcome@mycompany.com ')
  • &gt; setTo('myemail@email.com')
  • &gt; setBody('Mybody');
    $ this-&gt; mailer-&gt; send($ message);

    返回null;
    }
    </ code> </ pre>

    此代码用于工作非常好,但几天前它就不再起作用了。 它最后返回错误。</ p>

    一旦我没有改变代码中的任何内容,我不知道这个问题是什么。</ p>

    我怎么才能发现它是什么?</ p>


    request.CRITICAL:未捕获的PHP异常
    Mailgun \ Connection \ Exceptions \ MissingRequiredParameters:“传递给API的
    参数 检查您的输入!Sandbox
    子域名仅用于测试目的。请添加您自己的域名或
    将域名添加到域设置中的授权收件人。“ at
    /srv/www/MyCodeSource/vendor/mailgun/mailgun-php/src/Mailgun/Connection/RestClient.php
    第169行{“exception”:“[object]
    (Mailgun \ Connection \ Exceptions \ MissingRequiredParameters (代码:0):
    传递给API的参数无效。请检查您的输入!
    沙盒子域名仅用于测试目的。请添加您自己的域名或将域名添加到域设置中的授权收件人。 n at
    /srv/www/MyCodeSource/vendor/mailgun/mailgun-php/src/Mailgun/Connection/RestClient.php:169)"}
    [] </ p>
    </ blockquote>
    < / DIV>

展开原文

原文

I have a very simple code that uses MailGun in my Symfony2 application:

public function sendNewEmail()
{
    $message = \Swift_Message::newInstance()
                    ->setSubject('Any random subject')
                    ->setFrom('welcome@mycompany.com')
                    ->setTo('myemail@email.com')
                    ->setBody('Mybody');
    $this->mailer->send($message);

    return null;
}

This code use to work very fine, but after some days ago it simply doesn't work anymore. It returns the error in the end.

I have no idea of what this problem can be once I haven't changed almost anything in code.

How could I discover what is?

request.CRITICAL: Uncaught PHP Exception Mailgun\Connection\Exceptions\MissingRequiredParameters: "The parameters passed to the API were invalid. Check your inputs! Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in domain settings." at /srv/www/MyCodeSource/vendor/mailgun/mailgun-php/src/Mailgun/Connection/RestClient.php line 169 {"exception":"[object] (Mailgun\Connection\Exceptions\MissingRequiredParameters(code: 0): The parameters passed to the API were invalid. Check your inputs! Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in domain settings. at /srv/www/MyCodeSource/vendor/mailgun/mailgun-php/src/Mailgun/Connection/RestClient.php:169)"} []

douguo6472
douguo6472 当我编辑我的答案时,他们在他们的系统中进行了更新,强制要求自定义域
接近 4 年之前 回复
dtt5830659
dtt5830659 我检查了这个答案,但不是我的情况,我已经使用了很多个月我的代码。现在它已停止工作了
接近 4 年之前 回复
doujiayao8433
doujiayao8433 stackoverflow.com/questions/39140281/mailgun-invalid-parameters看看这个。
接近 4 年之前 回复

2个回答



是的,它看起来像我正在使用的沙箱域导致了这个问题。</ p>

我添加了一个自定义域并在我的DNS等中添加了条目...现在它正在工作</ p>

但最奇怪的是我使用它几个月而且我已经 从来没有这个问题。 何时,也许这是一个异常,最终由MailGun修复。</ p>


更新</ strong>
只是为了确认我上面说的话:我 收到了MailGun的电子邮件</ p>


我们实施了已公布的变更,并从11月1日开始向客户发送了几条通知。 2016年12月1日...所有域,无论创建日期如何,都需要验证域以继续发送和接收消息。</ p>
</ blockquote>

< 这就是我的电子邮件突然停止的原因。 在他们解释我应该更改域名之后,设置DNS配置等... </ p>

好吧,他们在我完成后发送了说明,但他们有一个很好的 ,快速而明确的支持。 只是给予信任...... </ p>
</ div>

展开原文

原文

Yeah, it looks like it was the sandbox domain that I was using that was causing the problem.

I added a custom domain and added the entries in my DNS, etc... and now it's working

But the weirdest is that I was using it for months and I've never had this problem. When, maybe it was an exception that was eventually fixed by MailGun.


Update Just to confirm what I said above: I received an email of MailGun

We've implemented changes that were announced and several notifications were sent out informing customers starting from November 1st. On December 1st, 2016...All domains, regardless of the creation date, will be required to verify the domain to continue sending and receiving messages.

That is why my email stopped suddenly. And after they explained that I should change the domain, set the DNS configuration, etc...

And well, they sent the instructions after I've done them, but they had a nice, fast and clear support. Just giving the credit...

展开原文

原文

立即提问
相关内容推荐