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条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!