Forum: Ruby ActionMailer

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fee23d1fc58edee59e05d7a52dcf172e?d=identicon&s=25 blargity (Guest)
on 2005-11-20 08:22
(Received via mailing list)
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/Ba...
http://am.rubyonrails.org/

But I'm still at a loss.
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 drbrain (Guest)
on 2005-11-20 08:58
(Received via mailing list)
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:

You'll get the fastest, best answers on the Rails mailing list:

http://lists.rubyonrails.org/mailman/listinfo/rails
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 jeremy (Guest)
on 2005-11-20 09:34
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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:

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

iD8DBQFDgDTTAQHALep9HFYRAiwLAJ9k12/qlnOTvHFuxdkrR4rqsxMuFACgrQWz
7nd1WtzgK5KoMrw/vYTL8D0=
=Hccn
-----END PGP SIGNATURE-----
This topic is locked and can not be replied to.