2011-08-25 32 views
0

在行動郵件程序面臨問題。 我的郵件是面對問題在行動郵件程序

def registration_confirmation(user) 
    subject "Password Reset Instructions" 
    from  "[email protected]" 
    recipients user.email 
    content_type "text/html" 
    body  "RESET your Password" 
    end 

的設置郵件是

require 'development_mail_interceptor' 

ActionMailer::Base.smtp_settings = { 
    :address    => "smtp.gmail.com", 
    :port     => 587, 
    :domain    => "domain.in", 
    :user_name   => "[email protected]", 
    :password    => "PASSWORD", 
    :authentication  => "plain", 
    :enable_starttls_auto => true 
} 

ActionMailer::Base.default_url_options[:host] = "localhost:3000" 
Mail.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development? 

和我的控制器是UserMailer.registration_confirmation(@new_user).deliver

郵件不會在user.email,它總是要管理@域名.in

我正在使用mail-v 2.2.19和rails 3.0.9

請幫忙。

回答

1

嘗試加入這一行(爲我的作品):

mail(:to => user.email, :subject => "Password Reset Instructions") 

您registration_confirmation的方法

def registration_confirmation(user) 
    from  "[email protected]" 
    content_type "text/html" 
    body  "RESET your Password" 
    mail(:to => user.email, :subject => "Password Reset Instructions") 
end