gpt4 book ai didi

ruby-on-rails - Rails actionmailer,gmail 有效,office 365 无效。

转载 作者:行者123 更新时间:2023-12-04 17:48:09 24 4
gpt4 key购买 nike

我有 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

最佳答案

事实证明,微软要求 smtp_settings 使用相同的电子邮件地址。和 :from字段在 emailer.rb .

关于ruby-on-rails - Rails actionmailer,gmail 有效,office 365 无效。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26151495/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com