Iam new to ruby on rails
I read the one of the article in mail program.iam trying to execute
the program it shows the errors.here the error is
execution expired
RAILS_ROOT: C:/emailexample
Application Trace | Framework Trace | Full Trace
C:/Ruby186/lib/ruby/1.8/timeout.rb:60:in `rbuf_fill''
C:/Ruby186/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill''
C:/Ruby186/lib/ruby/1.8/net/protocol.rb:116:in `readuntil''
C:/Ruby186/lib/ruby/1.8/net/protocol.rb:126:in `readline''
C:/Ruby186/lib/ruby/1.8/net/smtp.rb:663:in `recv_response''
C:/Ruby186/lib/ruby/1.8/net/smtp.rb:395:in `do_start''
C:/Ruby186/lib/ruby/1.8/net/smtp.rb:685:in `critical''
C:/Ruby186/lib/ruby/1.8/net/smtp.rb:395:in `do_start''
C:/Ruby186/lib/ruby/1.8/net/smtp.rb:377:in `start''
C:/Ruby186/lib/ruby/1.8/net/smtp.rb:315:in `start''
C:/Ruby186/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/action_mailer/base.rb:627:in
`perform_delivery_smtp''
C:/Ruby186/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/action_mailer/base.rb:508:in
`__send__''
C:/Ruby186/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/action_mailer/base.rb:508:in
`deliver!''
C:/Ruby186/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/action_mailer/base.rb:383:in
`method_missing''
app/controllers/emailer_controller.rb:8:in `sendmail''
here the program is
class Emailer < ActionMailer::Base
def contact(recipient, subject, message, sent_at = Time.now)
@subject = subject
@recipients = recipient
@from =
''no-reply-FBj3rGVNSac4Q++5jOxPmw@public.gmane.org''
@sent_on = sent_at
@body["title"] = ''This is title''
@body["email"] =
''sender-FBj3rGVNSac4Q++5jOxPmw@public.gmane.org''
@body["message"] = message
@headers = {}
end
end
contact.rhtml file
Hi!
You are having one email message from <%= @email %> with a tilte
<%= @title %>
and following is the message:
<%= @message %>
Thanks
class EmailerController < ApplicationController
def sendmail
email = @params["email"]
recipient = email["recipient"]
subject = email["subject"]
message = email["message"]
Emailer.deliver_contact(recipient, subject, message)
return if request.xhr?
render :text => ''Message sent successfully''
end
def index
render :file => ''app\views\emailer\index.rhtml''
end
end
index.rhtml
<h1>Send Email</h1>
<%= start_form_tag :action => ''sendmail'' %>
<p><label for="email_subject">Subject</label>:
<%= text_field ''email'', ''subject''
%></p>
<p><label for="email_recipient">Recipient</label>:
<%= text_field ''email'', ''recipient''
%></p>
<p><label
for="email_message">Message</label><br/>
<%= text_area ''email'', ''message''
%></p>
<%= submit_tag "Send" %>
<%= end_form_tag %>
please give me the solution
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.