drrhr20884 2016-07-17 17:09
浏览 139
已采纳

从laravel 5.2应用程序发送来自mailgun的邮件

I am using laravel 5.2 with mailgun. Tried sending an email to a user in order that the user resets password. I get this error

ClientException in RequestException.php line 107: Client error: POST https://api.mailgun.net/v3/sandbox7337ad8917084e1883b28134ba711960.mailgun.org/messages.mime resulted in a 400 BAD REQUEST response: { "message": "Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authoriz (truncated...)

This is a section of my .env file

MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=2525
MAIL_USERNAME=postmaster@sandbox......mailgun.org
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls

MAILGUN_DOMAIN=sandbox..........mailgun.org
MAILGUN_SECRET=key-.........

config/services.php file

'mailgun' => [
        'domain' => env('MAILGUN_DOMAIN'),
        'secret' => env('MAILGUN_SECRET'),
    ],

config/mail.php file

'driver' => env('MAIL_DRIVER', 'smtp'),
host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 2525),
'from' => ['address' => 'myemail@gmail.com', 'name' => 'myName'],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',

Please, help.

  • 写回答

1条回答 默认 最新

  • donglu5612 2016-07-28 19:56
    关注

    This is the sandbox domain. You need to verify your own domain or verify the recipient in order to send an email to others.

    Follow the link to add recipients: https://mailgun.com/app/testing/recipients

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥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,如何解決?