i m trying to send e-mail. i have generated model, controller & view file for it. but its giving me error like "No rhtml, rxml, rjs or delegate template found for sent" model: class MyMailer < ActionMailer::Base def sent(msg) subject "Hello" recipients "hiral29_desai29-/E1597aS9LQAvxtiuMwx3w@public.gmane.org" from "abhi.janu83-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" sent_on Time.now content_type "text/html" body "msg"=> msg end end controller: def sendmail msg="hi from abhi..." email=MyMailer.create_sent(msg) MyMailer.deliver(email) render :text=>"Mail has been sent...!" end view: hello.rhtml <html> <body> <%= start_form_tag(:name => ''myFrm'', :action => ''sendmail'')%> <%= submit_tag "Send Mail"%> <%= end_form_tag%> </body> </html> Please help me somebody. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Hall
2007-Feb-08 11:30 UTC
Re: No rhtml, rxml, rjs or delegate template found for sent
http://api.rubyonrails.org/classes/ActionMailer/Base.html read the section titled ''Mailer Views'' in a nutshell, rails is looking for apps/views/mymailer/sent.rhtml and can''t find it. On 2/8/07, abhishek <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > i m trying to send e-mail. > i have generated model, controller & view file for it. > but its giving me error like "No rhtml, rxml, rjs or delegate template > found for sent" > > model: > class MyMailer < ActionMailer::Base > def sent(msg) > subject "Hello" > recipients "hiral29_desai29-/E1597aS9LQAvxtiuMwx3w@public.gmane.org" > from "abhi.janu83-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" > sent_on Time.now > content_type "text/html" > body "msg"=> msg > end > end > > controller: > def sendmail > msg="hi from abhi..." > email=MyMailer.create_sent(msg) > MyMailer.deliver(email) > render :text=>"Mail has been sent...!" > end > > view: > hello.rhtml > <html> > <body> > <%= start_form_tag(:name => ''myFrm'', :action => ''sendmail'')%> > <%= submit_tag "Send Mail"%> > <%= end_form_tag%> > </body> > </html> > > Please help me somebody. > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Christos Zisopoulos
2007-Feb-08 11:46 UTC
Re: No rhtml, rxml, rjs or delegate template found for sent
Abhishek, You need to have an RHTML template for each action of your ActionMailer model. So in your case, you will need: app/views/mymailer/sent.rhtml What you put in this template is the HTML (in your case) that will be sent to the user. You have access to the variables you defined in your sent action, just like any in other view. Have a look here... http://f8p.com/6z1smm ...and here... http://f8p.com/c0vvgh -christos On 8 Feb 2007, at 10:47, abhishek wrote:> > i m trying to send e-mail. > i have generated model, controller & view file for it. > but its giving me error like "No rhtml, rxml, rjs or delegate template > found for sent" > > model: > class MyMailer < ActionMailer::Base > def sent(msg) > subject "Hello" > recipients "hiral29_desai29-/E1597aS9LQAvxtiuMwx3w@public.gmane.org" > from "abhi.janu83-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" > sent_on Time.now > content_type "text/html" > body "msg"=> msg > end > end > > controller: > def sendmail > msg="hi from abhi..." > email=MyMailer.create_sent(msg) > MyMailer.deliver(email) > render :text=>"Mail has been sent...!" > end > > view: > hello.rhtml > <html> > <body> > <%= start_form_tag(:name => ''myFrm'', :action => ''sendmail'')%> > <%= submit_tag "Send Mail"%> > <%= end_form_tag%> > </body> > </html> > > Please help me somebody.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks christos, the code from the given link is working. but everytime for sending the mail i have to restart my webrick server. also it gives me warning like "ipV6 is disabled". so how to solve this problem. thanks again for giving me reply. please send some solution for this problem. abhishek -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---