I'm trying to use ActionMailer without rails. Perhaps I'm tired, but I am
quite confused by the following:
irb(main):001:0> require 'action_mailer'
=> true
irb(main):002:0>
irb(main):003:0* class Emailer < ActionMailer::Base
irb(main):004:1> def initialize
irb(main):005:2> super()
irb(main):006:2> end
irb(main):007:1> end
=> nil
irb(main):008:0> email = Emailer.new
=> nil
Why am I getting nil out of that statement (it's not just irb, I checked)?
I've found the documentation at:
http://api.rubyonrails.com/classes/ActionMailer/Base.html#M000291
http://am.rubyonrails.org/
But I'm still at a loss.
You'll get the fastest, best answers on the Rails mailing list:
http://lists.rubyonrails.org/mailman/listinfo/rails
···
On Nov 19, 2005, at 11:20 PM, Kevin Brown wrote:
I'm trying to use ActionMailer without rails. Perhaps I'm tired, but I am
quite confused by the following:
--
Eric Hodel - drbrain@segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04
Follow the example code at the top of
http://api.rubyonrails.com/classes/ActionMailer/Base.html
A condensed example:
require 'action_mailer'
class Emailer < ActionMailer::Base
def test_email(user_email)
subject "Free C1Alis"
from "system@example.com"
recipients user_email
body "Get large, #{user_email}!@"
end
end
Emailer.deliver_test_email('testuser@gmail.com')
Delivery is via SMTP @ localhost by default.
Kindly take further Rails-specific discussion to the Rails list.
The Ruby list is mighty busy and Rails chatter decreases its S/N.
Best,
jeremy
···
On Nov 19, 2005, at 11:20 PM, Kevin Brown wrote:
I'm trying to use ActionMailer without rails. Perhaps I'm tired, but I am
quite confused by the following: