ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to really hide email address in contact form?

July 09, 2008 1:24pm

Subscribe [5]
  • #1 / Jul 09, 2008 1:24pm

    Gabriel

    130 posts

    I’m building simple contact form using Email module. I’m trying set up recipients, but not using hidden field. The reason is simple - security and spam robot prevention. So I would like to “remove” email address in source code of the contact form side. Is there any quick solution for that?

  • #2 / Jul 09, 2008 4:18pm

    Ingmar

    29245 posts

    If you use

    {exp:email:contact_form recipients="[email protected]"}

    the address should not be visible in the plaintext output.

  • #3 / Jul 09, 2008 7:03pm

    Gabriel

    130 posts

    If you use

    {exp:email:contact_form recipients="[email protected]"}

    the address should not be visible in the plaintext output.

    Hi Ingmar. As i wrote before. I would like to “remove” email address from source code of the contact form. Something similar like user email form in their profiles. There is ID of the member, not his e-mail address.

  • #4 / Jul 09, 2008 8:08pm

    Joobs

    362 posts

    But the user emails arent shown in the source code in a readable form? Aren’t they garbled up into lots of random letters?

  • #5 / Jul 09, 2008 8:14pm

    Ingmar

    29245 posts

    Gabriel, did you take a look at the source code? This is what I get:

    <input type="hidden" name="recipients" value="EH9G0hMJtZzxWynI3wuqUdsCAwpA9ESf0AFStBfGEM0=" />

    Good enough for me.

  • #6 / Jul 09, 2008 8:37pm

    Gabriel

    130 posts

    Ingmar: uuups. I’ve missed something. That’s exactly what I talk about!

    Let’s to next level. I want to create select field with recipients (see below). Is any possibility encode email address in the list?

    {exp:email:contact_form user_recipients="true" recipients="[email protected]" charset="utf-8" redirect="5" return="{homepage}"} 
    
    <input type="hidden" id="subject" name="subject" value="Web contact" />
    
    <select name="to">
      <option value="[email protected]">Store</option>
      <option value="[email protected]">Marketing</option>
      <option value="[email protected]">Director</option>
    </select>
    
    <input type="text" id="from" name="from" value="" />
    
    <textarea id="message" name="message" rows="5" cols="50"></textarea>
    
    <input name="submit" type="submit" value="Send" />
    
    {/exp:email:contact_form}
  • #7 / Oct 09, 2008 10:16am

    Embody_Bruce

    76 posts

    I’d like to do exactly this to. To have on my site one standard contact form but with a drop down of five potential recipients. Could anyone help with how to do this? Is the solution above the right way?

    (perhaps this is a separate thread ... )

  • #8 / Oct 09, 2008 10:35am

    Peter Lewis

    280 posts

    I use SpamMeNot plugin http://www.masugadesign.com/ to obfuscate all email addresses.

    Alternatively try doing it directly: http://alicorna.com/obfuscator.html.

    Peter.

  • #9 / Oct 09, 2008 10:39am

    Embody_Bruce

    76 posts

    I use SpamMeNot plugin http://www.masugadesign.com/ to obfuscate all email addresses.

    Alternatively try doing it directly: http://alicorna.com/obfuscator.html.

    Peter.

    Thanks but that isn’t the question I’m asking.

  • #10 / Oct 09, 2008 11:22am

    Peter Lewis

    280 posts

    Actually I was posting a suggestion based on Gabriel’s post, there’s a dropdown <select> of recipients, the thread was about how to mask these email addresses.  As the <select> list of recipients will be outside the expressionengine tag which would encrypt the email, it was a suggestion of working around it.

    One thought - if exp✉️contact_form can have multiple recipients, you could access them via JavaScript, populate the Select list based on the EE Form fields and therefore encrypting all your recipients emails…?

    Edit:
    Regarding using a select, I don’t know without trying if just maintaining the ID or Name tags will work for the “to”, or that EE specifically requires an input field.  Either way, on the form submit, you could copy the select value into a hidden field before the form is submitted to EE.

  • #11 / Oct 09, 2008 12:45pm

    Embody_Bruce

    76 posts

    I think I’ve found a sort of solution to this question with the addition of a protected list of email addresses.

    It looks similar to the solution above but I’ve used the suggested obfuscator to extract the email address from.

    <option value="[email protected]">Store</option>

    Then becomes

    <option value="a long string of what looks like random characters">Store</option>

    NB the obfuscator code puts the email address into href tags so you need to cut and past just the bit you want for the form field.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases