[1]script/plugin install? -f? svn://rubyforge.org/var/svn/slantwise/yaml_mail_config/trunk
[2]edit config/email.yml
development:
??? server: 192.168.1.18
??? port: 25
??? domain: yyyyy.com
??? authentication: login
??? username: xxxxxx
??? password: xxxxxx
#? production:
#??? server: mail.domain.com
#??? port: 465
#??? domain: domain.com
#??? authentication: login
#??? username: email_account_login
#??? password: email_account_password
#??? tls: true
[3]script/general mailer OrderMailer
???? def order_placed(receiver,subject,message,send_at)
?
??? recipients receiver
??? bcc ["xxx@yyyyy.com"]
??? from "service@yyyyy.com"
??? subject "this is the subject"
??? body "this is the body"
???
? end?
[4]send
mail OrderMailer.create_order_placed("aaa@xxxxyyy.com","here is subject","here is message",Time.now)
OrderMailer.deliver(mail)
ok
|----------------------------------------------------------------------------------------|
版權(quán)聲明 版權(quán)所有 @zhyiwww
引用請注明來源 http://www.tkk7.com/zhyiwww
|----------------------------------------------------------------------------------------|
posted on 2009-03-25 11:49
zhyiwww 閱讀(321)
評論(0) 編輯 收藏 所屬分類:
ruby on rails