# Mail\_to tag

**URL:** <https://www.ruby-forum.com/t/mail-to-tag/106813>\
**Category:** Rails\
**Created:** [June 14, 2007, 11:02am UTC](https://www.ruby-forum.com/t/mail-to-tag/106813 "2007-06-14T11:02:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/779978/32.png) [@Mahendra](https://www.ruby-forum.com/u/Mahendra)\
**Post date:** [June 14, 2007, 11:02am UTC](https://www.ruby-forum.com/t/mail-to-tag/106813/1 "2007-06-14T11:02:11Z")

</div>

Hi,

In my html i use textarea and on submit button i want to place  
textarea  
content in body of mailer opened using mail\_to tag.  
how it is possible. I am using the ruby code.

---

<div class="post-metadata">

**Author:** ![Mahendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/779978/32.png) [@Mahendra](https://www.ruby-forum.com/u/Mahendra)\
**Post date:** [June 14, 2007, 11:33am UTC](https://www.ruby-forum.com/t/mail-to-tag/106813/2 "2007-06-14T11:33:10Z")

</div>

first off, make sure that the content you want to be in the body is  
assigned;  
( content\_var = “text submitted in texarea” )

and then:

mail\_to “email@someplace”, “Mail to someplace”, :body =\> content\_var

which will create a link

Mail to someplace

neat enough?  
btw, generally speaking, there is a cool api for ruby on rails called,  
(suprisingly enough) [api.rubyonrails.com](http://api.rubyonrails.com)

i found the above info right here:

[Peak Obsession](http://api.rubyonrails.com/classes/ActionView/Helpers/UrlHelper.html#M000492)

hth,  
shai
