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.

Contact Form Error: A valid sender email is required

November 05, 2008 7:29pm

Subscribe [2]
  • #1 / Nov 05, 2008 7:29pm

    secondlamppost

    22 posts

    I am getting an error when I try to submit contact forms using the Email Module on a site I am developing.  Upon clicking “submit” I get “A valid sender email is required.

    I am trying to use this as a general contact form for all of the sites visitors, most of whom will not be members.  Here is my code:

    {exp:email:contact_form recipients="[email protected]" redirect="6" user_recipients="false"}
    
                    <label for="name">Your Name:</label>
    
                    <input type="text" id="name" name="name" size="40" maxlength="60" value="" /></p>
        
                    <label for="email">Your Email:</label>
    
                    <input type="text" id="email" name="email" size="40" maxlength="60" value="" /></p>
        
                    <label for="subject">Subject:</label>
    
                    <input type="text" id="subject" name="subject" size="40" maxlength="60" value="" /></p>
        
                    <label for="message">Message:</label>
    
                    <textarea id="message" name="message" rows="15" cols="40"></textarea>
        
                    <input name="submit" type="submit" value="Submit Form" /></p>
        
                {/exp:email:contact_form}


    What am I doing wrong here? I found a reference to a similar problem in a post that was several years old, but I didn’t want to start chopping away at my .php files based on recommendations from 4 years ago.

    For reference I am using Expression Engine 1.6.5, Build:  20081028.

  • #2 / Nov 05, 2008 8:47pm

    Greg Aker

    6022 posts

    Greetings Brian!

    Take a peek at the docs page on the email contact form.

    Notice that the input for the email address is:

    <input type="text" id="from" name="from" size="40" maxlength="35" value="{member_email}" />

    Whereas you have:

    <input type="text" id="email" name="email" size="40" maxlength="60" value="" />

    So ExpressionEngine is not able to grab the post data.

    Try changing the id/name of your “email” input to “from” and give it a whirl.

    Thanks,

    -greg

  • #3 / Nov 06, 2008 12:37pm

    secondlamppost

    22 posts

    Hi Greg,

    Thanks for your response. I just added that value but it did not change the error. I have tested both as a logged in member and as a visitor. Is there any configuration in the Email Module itself that perhaps I have missed in the documentation?

    I just took the site online while I finish cleaning up some bugs, so you can view the contact page here:

    The Human Solution Contact Page

  • #4 / Nov 06, 2008 3:05pm

    Sue Crocker

    26054 posts

    Brian, I viewed the source of your contact page and saw that you’re using:

    <label for="email">Your Email:</label>
    
                    <input type="text" id="email" name="email" size="40" maxlength="60" value="" /></p>

    id and name should be set to from instead of email.

  • #5 / Nov 06, 2008 3:27pm

    secondlamppost

    22 posts

    Ah, I just got ahead of myself creating that form without analyzing the Docs example close enough. Great, that fixed it. Thanks for your help Greg and Sue.

  • #6 / Nov 06, 2008 3:30pm

    Sue Crocker

    26054 posts

    No worries! Glad everything is up and running. If you have any further issues, don’t hesitate to open a new thread!

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

ExpressionEngine News!

#eecms, #events, #releases