Rails 使用 ActionMailer 发送邮件

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'rubygems'
require 'action_mailer'

class Emailer < ActionMailer::Base
  def test_email(email_address, email_body)
    recipients(email_address)
    from "me@myDomain.net"
    subject "This is a test e-mail"
    body email_body
  end
end

Emailer.deliver_test_email('me@myDomain.net', 'This is a test e-mail!')