# No rhtml, rxml, rjs or delegate template found for sent

**URL:** <https://www.ruby-forum.com/t/no-rhtml-rxml-rjs-or-delegate-template-found-for-sent/84877>\
**Category:** Rails\
**Created:** [February 8, 2007, 10:47am UTC](https://www.ruby-forum.com/t/no-rhtml-rxml-rjs-or-delegate-template-found-for-sent/84877 "2007-02-08T10:47:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7ba0ec/32.png) [@abhishek](https://www.ruby-forum.com/u/abhishek)\
**Post date:** [February 8, 2007, 10:47am UTC](https://www.ruby-forum.com/t/no-rhtml-rxml-rjs-or-delegate-template-found-for-sent/84877/1 "2007-02-08T10:47:58Z")

</div>

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 “removed\_email\_address@domain.invalid”  
from “removed\_email\_address@domain.invalid”  
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  
  
  
\<%= start\_form\_tag(:name =\> ‘myFrm’, :action =\> ‘sendmail’)%\>  
\<%= submit\_tag “Send Mail”%\>  
\<%= end\_form\_tag%\>

Please help me somebody.

---

<div class="post-metadata">

**Author:** ![abhishek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7ba0ec/32.png) [@abhishek](https://www.ruby-forum.com/u/abhishek)\
**Post date:** [February 8, 2007, 12:31pm UTC](https://www.ruby-forum.com/t/no-rhtml-rxml-rjs-or-delegate-template-found-for-sent/84877/2 "2007-02-08T12:31:01Z")

</div>

> **[ActionMailer::Base](https://api.rubyonrails.org/classes/ActionMailer/Base.html)**
>
> Action Mailer allows you to send email from your application using a mailer model and views. Mailer Models To use Action Mailer, you need to create a mailer model.

read the section titled ‘Mailer Views’

in a nutshell, rails is looking for apps/views/mymailer/sent.rhtml and  
can’t find it.

---

<div class="post-metadata">

**Author:** ![abhishek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7ba0ec/32.png) [@abhishek](https://www.ruby-forum.com/u/abhishek)\
**Post date:** [February 8, 2007, 12:48pm UTC](https://www.ruby-forum.com/t/no-rhtml-rxml-rjs-or-delegate-template-found-for-sent/84877/3 "2007-02-08T12:48:05Z")

</div>

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](http://f8p.com/6z1smm)

…and here…

[http://f8p.com/c0vvgh](http://f8p.com/c0vvgh)

-christos
