laravel 无法使用 office365 设置发送 SMTP 邮件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/54784431/
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
Unable to send SMTP mails using office365 settings
提问by Milind Patel
I am using SMTP mail for sending mail using Laravel. Everything working perfect other than office365 mail settings.
我正在使用 SMTP 邮件使用 Laravel 发送邮件。除了 office365 邮件设置之外,一切都完美无缺。
Settings I have used is as below:
我使用的设置如下:
SMTP HOST = smtp.office365.com
SMTP PORT = 587
SMTP ENCRYPTION = tls
SMTP USER = username(email)
SMTP PASS = password
Error i am getting is:
我得到的错误是:
554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message
554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; 由于消息的永久异常,无法处理消息无法提交消息
I have already searched google a lot for this error everybody says about clutter like this link Solution to this errorBut I personally don't find any clutter after followed all the steps mentioned.
我已经在谷歌上搜索了很多关于这个错误每个人都说这个链接的混乱 解决方案但是我个人在按照提到的所有步骤之后没有发现任何混乱。
I cannot log in this email as it's our client email id and I don't have permission to log in.
我无法登录此电子邮件,因为它是我们的客户电子邮件 ID,而且我没有登录权限。
I also created one outlook email id and test this email setting. It worked like charm. I don't know what is wrong with Client email id.
我还创建了一个 Outlook 电子邮件 ID 并测试了此电子邮件设置。它的作用就像魅力一样。我不知道客户电子邮件 ID 有什么问题。
Any suggestions would be great.
任何建议都会很棒。
回答by Milind Patel
Outlook doesn't provide to send using different from address other than your username to log in.
Outlook 不提供使用不同于您的用户名登录的地址发送。
You need both email address same.
您需要两个电子邮件地址相同。
You can add one or more sender in your admin panel after that you can send easily from different addresses.
您可以在管理面板中添加一个或多个发件人,然后您可以轻松地从不同的地址发送。
回答by Dmitry Streblechenko
The error means the user whose credentials you specified in the SMTP connection cannot submit messages on behalf of the user specified in the From
/Sender
MIME headers or the FROM
SMTP command.
该错误意味着您在 SMTP 连接中指定其凭据的用户无法代表From
/ Sender
MIME 标头或FROM
SMTP 命令中指定的用户提交邮件。
回答by aprabu_2000
After trying for 4 days, mails started to triggered with port:25, so instead of trying with 587 or 465. Try with other port numbers.
尝试了 4 天后,邮件开始使用端口:25 触发,因此不要尝试使用 587 或 465。尝试使用其他端口号。
host: "smtp.office***.*", port:25, secureConnection: false, requireTLS: true, tls: { ciphers: 'SSLv3' }, auth: { user: *, pass: *** }
主机:“smtp.office***. *”,端口:25,安全连接:false,requireTLS:true,tls:{密码:'SSLv3'},身份验证:{用户:*,通过:***}