2011-03-30 37 views

回答

5
def send_mail_persons(user) 
    @user = user 
    mail :to => @user.email, :subject => "Amusement.", :from => MAIL_ADDRESS 
end 

在這裏,我調用的方法send_mail_persons並通過了收件人信息作爲parameter.Also有一個簡單的方法..

def send_mail_persons 
    mail :to => MAILING_ADDRESS, :subject => "Amusement.", :from => MAIL_ADDRESS 
end 

和定義的常量都MAILING_ADDRESS和MAIL_ADDRESS。

感謝名單

+0

希望它能幫助,這是你問什麼... – Bijendra 2011-03-30 11:59:28

+0

http://api.rubyonrails.org/ ..mailer是更好地在這裏解釋 – Bijendra 2011-03-30 12:02:04