问题描述
我正在使用laravel 5.2和mailgun。尝试向用户发送电子邮件,以便用户重置密码。我收到这个错误 RequestException.php行107中的ClientException:
客户端错误: POST https://api.mailgun.net /v3/sandbox7337ad8917084e1883b28134ba711960.mailgun.org/messages.mime
导致一个 400 BAD REQUEST
响应:
{
消息:沙盒子域名仅用于测试目的,请添加您自己的域名或添加地址到authoriz(截断...)
这是我的一部分 .env文件
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 =沙箱.. ........ mailgun.org
MAILGUN_SECRET = key -.........
config / services.php文件
'mailgun'=> [
'domain'=> env('MAILGUN_DOMAIN'),
'secret'=> env('MAILGUN_SECRE T'),
],
config / mail.php文件
'driver'=> env('MAIL_DRIVER','smtp'),
host'=> env('MAIL_HOST','smtp.mailgun.org'),
'port'=> env('MAIL_PORT',2525),
'from'=> ['address'=> '[email protected]','name'=> 'myName'],
'encryption'=> env('MAIL_ENCRYPTION','tls'),
'username'=> env('MAIL_USERNAME'),
'password'=> env('MAIL_PASSWORD'),
'sendmail'=> '/ usr / sbin / sendmail -bs',
请帮忙。 $ b
这是沙箱域。您需要验证自己的域名或验证收件人才能发送电子邮件给他人。
按照链接添加收件人:
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
[email protected]
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' => '[email protected]', 'name' => 'myName'],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
Please, help.
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
这篇关于从邮件邮件发送邮件从laravel 5.2应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!