简体   繁体   English

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

[英]MailGun parameters are invalid for no apparent reason

I have a very simple code that uses MailGun in my Symfony2 application: 我有一个非常简单的代码,在我的Symfony2应用程序中使用MailGun:

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." request.CRITICAL:未捕获的PHP异常Mailgun \\ Connection \\ Exceptions \\ MissingRequiredParameters:“传递给API的参数无效。请检查您的输入!沙箱子域仅用于测试目的。请添加您自己的域或将地址添加到以下地址的授权收件人域设置”。 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)"} [] 在/srv/www/MyCodeSource/vendor/mailgun/mailgun-php/src/Mailgun/Connection/RestClient.php行169 {“ exception”:“ [object](Mailgun \\ Connection \\ Exceptions \\ MissingRequiredParameters(code:0):传递给API的参数无效,请检查您的输入!沙箱子域仅用于测试目的,请添加您自己的域或将地址添加到域设置中的授权收件人:/ srv / www / MyCodeSource / vendor / mailgun / mailgun -php / src / Mailgun / Connection / RestClient.php:169)“} []

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 我添加了一个自定义域,并在DNS中添加了条目,等等...现在可以正常工作了

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. 也许这是最终由MailGun修复的异常。


Update Just to confirm what I said above: I received an email of MailGun 更新只是为了确认我上面所说的内容:我收到了MailGun的电子邮件

We've implemented changes that were announced and several notifications were sent out informing customers starting from November 1st. 从11月1日开始,我们已经实施了宣布的更改,并发出了一些通知,通知客户。 On December 1st, 2016...All domains, regardless of the creation date, will be required to verify the domain to continue sending and receiving messages. 2016年12月1日...所有域,无论创建日期如何,都将需要验证域以继续发送和接收消息。

That is why my email stopped suddenly. 这就是为什么我的电子邮件突然停止的原因。 And after they explained that I should change the domain, set the DNS configuration, etc... 在他们解释说我应该更改域,设置DNS配置等之后,...

And well, they sent the instructions after I've done them, but they had a nice, fast and clear support. 很好,他们在我完成说明后发送了说明,但是他们得到了很好,快速而明确的支持。 Just giving the credit... 只是赞扬...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM