如何使用 Laravel 4 邮件方法设置 hotmail?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21355926/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to setup hotmail with laravel 4 mail method?
提问by WXR
I searched around but people seem to be using gmail setting with laravel instead of hotmail. I tried with the gmail setting and it works perfectly so I'm trying with hotmail but can't seem to get it to work. Can someone please give me a hand? I tried few different settings but none of them works at all. I tried things like
我四处搜索,但人们似乎在使用带有 Laravel 而不是 hotmail 的 gmail 设置。我尝试了 gmail 设置,它运行良好,所以我正在尝试使用 hotmail,但似乎无法让它工作。有人可以帮我一把吗?我尝试了几种不同的设置,但它们都不起作用。我试过这样的事情
'driver' => 'smtp',
'host' => 'smtp.live.com',
'port' => 25,
'encryption' => 'ssl',
the above I tried port 587 and port 465 and changed encryption to TLS but none of them works and instead I get errors like
上面我尝试了端口 587 和端口 465 并将加密更改为 TLS 但它们都不起作用,而是出现了类似的错误
Connection could not be established with host smtp.live.com [ #0]
无法与主机 smtp.live.com [#0] 建立连接
or error about taking too long to connect to the server that it's not responding.
或关于连接到服务器的时间过长而没有响应的错误。
if I change the 'driver' to 'mail' the page will load without error but nothing in the email is received
如果我将“驱动程序”更改为“邮件”,页面将正确加载,但不会收到电子邮件中的任何内容
I even tried
我什至试过
'driver' => 'mail',
'host' => 'pop3.live.com',
'port' => 995,
'encryption' => 'ssl',
I still got nothing and if I change the driver to smtp I get errors
我仍然一无所获,如果我将驱动程序更改为 smtp,则会出现错误
Can someone give me a hand with this?
有人可以帮我解决这个问题吗?
Thanks a lot~
非常感谢~
回答by WXR
Nevermind I found out. Finally.....
没关系我发现了。最后.....
this is how it needs to be setup
这是它需要设置的方式
'driver' => 'smtp',
'host' => 'smtp-mail.outlook.com',
'port' => 587, ( or 25)
'encryption' => 'tls',