【发布时间】:2012-05-08 23:07:56
【问题描述】:
这是我在/config/initializers/setup_mail.rb 中的配置文件:
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "...something...",
:user_name => "my_gmail_name",
:password => "my_gmail_pass",
:authentication => "plain",
:enable_starttls_auto => true
}
这是Mailer's 类和我使用的方法:
class Notifierpass < ActionMailer::Base
default from: "no-reply@my-domain.com"
def forgot_password(user)
@reset_password_link = reset_password_url(user.perishable_token)
mail(:from => "no-reply@my-domain.com", :to => user.email, :subject => "New passwordt")
end
end
发送电子邮件正常,我的问题是,在电子邮件的字段中 From 始终是 my_user_name 而不是 no-reply@my-domain.com。
问题出在哪里?为什么还用我的gmail名字?
【问题讨论】:
标签: ruby-on-rails-3 email actionmailer