dounong5373 2016-12-05 09:43
浏览 124
已采纳

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

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)"} []

  • 写回答

2条回答 默认 最新

  • dongmu5596 2016-12-05 14:06
    关注

    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...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog