ActionMailer

K

Kevin Brown

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.
 
J

Jeremy Kemper

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm trying to use ActionMailer without rails. Perhaps I'm tired,
but I am
quite confused by the following:

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 "(e-mail address removed)"
recipients user_email
body "Get large, #{user_email}!@"
end
end

Emailer.deliver_test_email('(e-mail address removed)')

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDgDTTAQHALep9HFYRAiwLAJ9k12/qlnOTvHFuxdkrR4rqsxMuFACgrQWz
7nd1WtzgK5KoMrw/vYTL8D0=
=Hccn
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top