# Contact form which generates e-mail

**URL:** <https://www.ruby-forum.com/t/contact-form-which-generates-e-mail/98519>\
**Category:** Rails\
**Created:** [January 29, 2006, 7:24pm UTC](https://www.ruby-forum.com/t/contact-form-which-generates-e-mail/98519 "2006-01-29T19:24:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chidori](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/edb3f5/32.png) [@chidori](https://www.ruby-forum.com/u/chidori)\
**Post date:** [January 29, 2006, 7:24pm UTC](https://www.ruby-forum.com/t/contact-form-which-generates-e-mail/98519/1 "2006-01-29T19:24:43Z")

</div>

I’m still struggling with my first RoR application, and have now  
encountered yet another problem I have no idea how to solve.

I would like to have a contact form where people can write e-mails to me  
directly from my site. I can do this with php, but have no clue  
whatsoever on how to do it with RoR. I tried searching for it, but RoR  
is really lacking tutorials and example code, I feel. I’m guessing it  
might have something to do with ActionMailer, but I’m not sure on how to  
do it.

The concept is simple; a few input fields where the sender specifies  
subject, body and maybe even his own e-mail, clicks a button and the  
e-mail is sent to my address (which I’ve specified somewhere behind the  
scenes).

Is this possible - and if so, how?

---

<div class="post-metadata">

**Author:** ![chidori](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/edb3f5/32.png) [@chidori](https://www.ruby-forum.com/u/chidori)\
**Post date:** [January 29, 2006, 8:56pm UTC](https://www.ruby-forum.com/t/contact-form-which-generates-e-mail/98519/2 "2006-01-29T20:56:30Z")

</div>

Have you looked at this:

[http://wiki.rubyonrails.com/rails/pages/HowToSendEmailsWithActionMailer](http://wiki.rubyonrails.com/rails/pages/HowToSendEmailsWithActionMailer)

b

---

<div class="post-metadata">

**Author:** ![chidori](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/edb3f5/32.png) [@chidori](https://www.ruby-forum.com/u/chidori)\
**Post date:** [January 29, 2006, 9:22pm UTC](https://www.ruby-forum.com/t/contact-form-which-generates-e-mail/98519/3 "2006-01-29T21:22:49Z")

</div>

> Have you looked at this:
> 
> [Peak Obsession](http://wiki.rubyonrails.com/rails/pages/HowToSendEmailsWithActionMailer)

Yes, I have, but that does not explain how I get have a form with  
different fields and the “click on button” to send the mail. I could  
probably work out how to get the field entries to serve as different  
variables in ActionMailer, but how would I call the function with the  
button click?
