Ruby on rails

I had created one form just like there is one text field where user has to enter email id and subject is there and content when user click on submit button the mail has to be send.i am unable to send the mail what i have to write in the controller please give me step by step explanation

I suggest starting with the relevant rails guide:
http://guides.rubyonrails.org/action_mailer_basics.html

Colin