zhyiwww
用平实的笔,记录编程路上的点点滴滴………
posts - 536,comments - 394,trackbacks - 0
[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




|----------------------------------------------------------------------------------------|
                           版权声明  版权所有 @zhyiwww
            引用请注明来源 http://www.blogjava.net/zhyiwww   
|----------------------------------------------------------------------------------------|
posted on 2009-03-25 11:49 zhyiwww 阅读(317) 评论(0)  编辑  收藏 所属分类: ruby on rails

只有注册用户登录后才能发表评论。


网站导航: