【发布时间】:2014-10-01 22:07:41
【问题描述】:
我有 Actionmailer 使用 gmail 发送电子邮件,设置如下:
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:user_name => "user_name@gmail.com",
:password => "password",
:authentication => "plain",
:enable_starttls_auto => true
}
但是,我无法让 Office 365 邮件正常工作,我有以下设置:
ActionMailer::Base.smtp_settings = {
:address => "smtp.office365.com",
:port => 587,
:domain => "my_domain.com",
:user_name => "username@my_domain.onmicrosoft.com",
:password => "password",
:authentication => :login,
:enable_starttls_auto => true
}
如果我尝试向该客户发送电子邮件,我会收到:
Net::SMTPFatalError
550 5.7.1 Client does not have permissions to send as this sender
【问题讨论】:
-
您好,您的问题解决了吗?我有同样的问题。谢谢!
-
嗨,我发现这是一个内部 IT 问题,我的代码没有任何问题 - 他们只是没有正确设置权限。
标签: ruby-on-rails actionmailer office365