這是/config/initializers/setup_mail.rb
我的配置文件:Actionmailer - 我如何設置「from」部分?
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: "[email protected]"
def forgot_password(user)
@reset_password_link = reset_password_url(user.perishable_token)
mail(:from => "[email protected]", :to => user.email, :subject => "New passwordt")
end
end
發送郵件是工作,我的問題是,在電子郵件的場從始終是my_user_name而不是[email protected]。
問題在哪裏?爲什麼仍然使用我的Gmail名稱?
對不起老兄我剛剛在第一次見到你的時候給出了同樣的解釋, – dennis