Hi,
I normally try to really figure things out before asking a stupid
question but I''m tight on time and the stack trace indicates a pretty
low-level problem... something scary for a newb.
I''m hoping that someone can just say "you forgot to polish the
widget
before turning the crank" or some other simple newbie-slap.
I''m trying to get actionmailer to send a simple test message.
My development.rb file has the following config:
ActionMailer::Base.server_settings = {
:address => "192.168.1.2",
:port => 25,
}
The code in my controller is:
def sendmail
mail = Notifications::create_contact_us()
Notifications::deliver(mail)
redirect_to :controller => "contact", :action =>
"index"
end
My "Notifications" contact_us method is:
def contact_us()
@subject = ''Notifications#contact_us''
@body = {}
@recipients = ''trevor@real_name_protected.com''
@from = ''test@real_name_protected.com''
@sent_on = Time.now
@headers = {}
end
and my view for "contact_us" is a simple, non-parameterised message of
success.
Unfortunately I get the following stack trace (note that using etherial
shows no packets at all across the network):
Errno::EINVAL in Contact#sendmail
Invalid argument
app/controllers/contact_controller.rb:11:in `sendmail''
script/server:48
Show framework trace
d:/trevor/ruby/lib/ruby/1.8/net/protocol.rb:197:in `sysread''
d:/trevor/ruby/lib/ruby/1.8/net/protocol.rb:197:in `rbuf_fill''
d:/trevor/ruby/lib/ruby/1.8/net/protocol.rb:196:in `timeout''
d:/trevor/ruby/lib/ruby/1.8/timeout.rb:55:in `timeout''
d:/trevor/ruby/lib/ruby/1.8/net/protocol.rb:196:in `rbuf_fill''
d:/trevor/ruby/lib/ruby/1.8/net/protocol.rb:160:in `readuntil''
d:/trevor/ruby/lib/ruby/1.8/net/protocol.rb:171:in `readline''
d:/trevor/ruby/lib/ruby/1.8/net/smtp.rb:664:in `recv_response''
d:/trevor/ruby/lib/ruby/1.8/net/smtp.rb:396:in `do_start''
d:/trevor/ruby/lib/ruby/1.8/net/smtp.rb:396:in `critical''
d:/trevor/ruby/lib/ruby/1.8/net/smtp.rb:396:in `do_start''
d:/trevor/ruby/lib/ruby/1.8/net/smtp.rb:378:in `start''
d:/trevor/ruby/lib/ruby/1.8/net/smtp.rb:316:in `start''
d:/trevor/ruby/lib/ruby/gems/1.8/gems/actionmailer-0.7.1/lib/action_mailer/base.rb:155:in
`perform_delivery_smtp''
d:/trevor/ruby/lib/ruby/gems/1.8/gems/actionmailer-0.7.1/lib/action_mailer/base.rb:145:in
`send''
d:/trevor/ruby/lib/ruby/gems/1.8/gems/actionmailer-0.7.1/lib/action_mailer/base.rb:145:in
`deliver''
d:/trevor/ruby/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/base.rb:678:in
`send''
I''ve cut off the rest of the trace because I''m not sure
it''s relevant
and I don''t want to clog the list with too much guff.
So... anyone seen and solved anything like this? Any pointers on how a
complete newb can debug the problem?
Thanks for looking,
Trevor