# How to encode an email ? (spam protection)

**URL:** <https://www.ruby-forum.com/t/how-to-encode-an-email-spam-protection/107227>\
**Category:** Rails\
**Created:** [June 19, 2007, 12:07pm UTC](https://www.ruby-forum.com/t/how-to-encode-an-email-spam-protection/107227 "2007-06-19T12:07:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [June 19, 2007, 12:07pm UTC](https://www.ruby-forum.com/t/how-to-encode-an-email-spam-protection/107227/1 "2007-06-19T12:07:23Z")

</div>

hi,

i would like to encode an email adresss in ascii format.  
How to do that in ruby, i can’t find a method.

Maybe exist a rails plugin to protect email collecting ?

Thanks for your help

---

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [June 19, 2007, 2:54pm UTC](https://www.ruby-forum.com/t/how-to-encode-an-email-spam-protection/107227/2 "2007-06-19T14:54:44Z")

</div>

On Jun 19, 3:07 am, Frioffol F. \<rails-mailing-l…@andreas-  
[s.net](http://s.net)\> wrote:

> Posted viahttp://www.ruby-forum.com/.  
> you have to google for “enkode email address”!

> **[Dan Benjamin](https://danbenjamin.com)**
>
> Dan Benjamin's personal website.

[http://forthecode.com/user/index/26](http://forthecode.com/user/index/26)

---

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [June 19, 2007, 4:07pm UTC](https://www.ruby-forum.com/t/how-to-encode-an-email-spam-protection/107227/3 "2007-06-19T16:07:53Z")

</div>

On Jun 19, 2007, at 8:54 AM, removed\_email\_address@domain.invalid wrote:

> > –  
> > Posted viahttp://www.ruby-forum.com/.
> 
> you have to google for “enkode email address”!
> 
> [Dan Benjamin](http://hivelogic.com/enkoder)  
> [http://forthecode.com/user/index/26](http://forthecode.com/user/index/26)

Use the mail\_to helper

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

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [June 19, 2007, 5:36pm UTC](https://www.ruby-forum.com/t/how-to-encode-an-email-spam-protection/107227/4 "2007-06-19T17:36:49Z")

</div>

Rob B. wrote:

> On Jun 19, 2007, at 8:54 AM, removed\_email\_address@domain.invalid wrote:
> 
> > > –  
> > > Posted viahttp://www.ruby-forum.com/.
> > 
> > you have to google for “enkode email address”!
> > 
> > [Dan Benjamin](http://hivelogic.com/enkoder)  
> > [http://forthecode.com/user/index/26](http://forthecode.com/user/index/26)
> 
> Use the mail\_to helper
> 
> [http://api.rubyonrails.org/classes/ActionView/Helpers/](http://api.rubyonrails.org/classes/ActionView/Helpers/)  
> UrlHelper.html#M000492
> 
> -Rob
> 
> Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
> removed\_email\_address@domain.invalid

great !

thanks for your answers
