working through 14.5 and getting an awesome openssl error

This commit is contained in:
Dan Buch 2011-07-25 23:04:53 -04:00
parent e69ebabc5f
commit 5de7f2bd3a

24
cookbook/014/05.rb Normal file
View File

@ -0,0 +1,24 @@
require 'rubygems'
require 'action_mailer'
class SimpleMailer < ActionMailer::Base
def simple_message(recipient)
from 'dan@meatballhat.com'
recipients recipient
subject 'A single-part message for you'
body 'This message has a plain text body.'
end
end
puts 'generated message:'
puts SimpleMailer.simple_message('me@localhost')
ActionMailer::Base.sendmail_settings = {
:address => 'localhost',
:port => 25,
:domain => 'localhost'
}
SimpleMailer.simple_message('me@localhost').deliver