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 运筹学中在线排序的时间在线排序的在线LPT算法
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧