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 - not working

September 12, 2011 6:24pm

Subscribe [5]
  • #1 / Sep 12, 2011 6:24pm

    somwicked

    26 posts

    Ok, I feel really, really dumb asking this. But for the life of me cannot get the contact form to send email.

    I’ve stripped the template down to nothing but the example copied and pasted from the docs - changing only the address to send to via the recipients parameter.

    {exp:email:contact_form user_recipients="true" recipients="[email protected]" charset="utf-8"}
    
        <h2>Support Form</h2>
    
    <p>    <label for="from">Your Email:</label></p>
    
    <p>    <input type="text" id="from" name="from" size="40" maxlength="35" value="{member_email}" /></p></p>
    
    <p>    <label for="subject">Subject:</label></p>
    
    <p>    <input type="text" id="subject" name="subject" size="40" value="Contact Form" /></p></p>
    
    <p>    <label for="message">Message:</label></p>
    
    <p>    <textarea id="message" name="message" rows="18" cols="40">Support Email from: {member_name}<br />
            Sent at:  {current_time format="%Y %m %d"}</textarea></p></p>
    
    <p>        <input name="submit" type='submit' value='Submit Form' /></p></p>
    
    <p>{/exp:email:contact_form}

    I’ve tried adding the hidden field with the recipient address instead - no change.
    I’ve changed the address being sent to, no change.
    I’ve ran the email_test utility - no errors reported.
    Mail config is set to PHP. Also tested with SMTP. No change.
    Emails from the exp-resso store module are received just fine (to the same address).

    Is it possible I have a corrupt file somewhere that handles the contact form - and doesn’t throw errors anywhere else?

    Any other ideas? This is usually brain dead easy, and I’m stumped.

    Running 2.2.2 (latest build) on Apache 2, PHP 5.2.14, removing index.php from the URLs.

  • #2 / Sep 12, 2011 11:51pm

    somwicked

    26 posts

    This makes no sense.

    Went into tools | communicate and am able to send a message using the form there. The from address is the same as set in email config. The recipient address is the same as being used in the contact form above.

    I am really at a loss here.

    Anyone?

  • #3 / Sep 13, 2011 12:34am

    Manoj Thomas

    185 posts

    Does it work if you set user_recipients = to false?

  • #4 / Sep 13, 2011 12:37am

    somwicked

    26 posts

    No, setting user recipients to false fails too.

    I replaced the system folder. No difference.

    I even installed the mailing list module and tested. Works ok.

    I installed freeform and copied and pasted the sample contact forms. Both of them fail as well. But I could be overlooking something there.

    This is weird. Maybe I’m just blind tonight.

    Testing phpFormMail at the moment. I have a feeling its going to work fine.

  • #5 / Sep 13, 2011 12:38am

    somwicked

    26 posts

    Yep. phpFormMail works a treat. May be the answer for now until I can figure it out.

  • #6 / Sep 13, 2011 2:57am

    John Henry Donovan

    12339 posts

    somwicked,

    How does the form fail?
    Do you get an error message or does the email just not arrive?

    Leave user_recipients=“false” in your template

    In your Email Configuration make sure you have Return email address for auto-generated emails filled in.

    Can you try with a different recipient address in your form. Add mine to test it. john.donovan [at] ellislab.com

    Can you also disable your htaccess temporarily and try again

  • #7 / Sep 13, 2011 3:40am

    somwicked

    26 posts

    Hi JHD,

    After hitting submit, the form just redirects to the home page; ignoring any redirect/return statements it may include.

    Leaving user recipients=false is fine. Actually preferred if I can get it working.

    Return email address is filled in with a valid email address.

    Removed all htaccess rules.

    I’ve tested with multiple recipient addresses and had no luck. Will add yours and sent a test as soon as I post.

    Tests sent from 2 different forms. One copied and pasted from a know working site.

  • #8 / Sep 13, 2011 12:43pm

    Mark Bowen

    12637 posts

    Hi somwicked,

    You mentioned above that you removed all htaccess rules. I’m just wondering how you did this?

    Really all you need to do is to rename the htaccess file from .htaccess to htaccess (note the missing dot) and then it won’t apply any more. No need to delete anything from it though.

    One thing to note is that if you take the .htaccess file out of the equation then you need to ensure that you replace index.php into Admin > General Configuration > Name of your site’s index page.

    Could you add that back in again and then try again please.

    Thanks,

    Mark

  • #9 / Sep 13, 2011 1:00pm

    somwicked

    26 posts

    I opened htaccess in Transmit (FTP client), cut all of the rules out so it was empty, gave the server a few minutes to catch up and reloaded the page.

    I did call the page using index.php in the path after removing htaccess rules.

    I did forget to put index.php back in the general config after removing the rules though. I can test this later this evening after the client is done entering/tweaking some of their content.

  • #10 / Sep 13, 2011 1:51pm

    Mark Bowen

    12637 posts

    Hi somwicked,

    I did forget to put index.php back in the general config after removing the rules though. I can test this later this evening after the client is done entering/tweaking some of their content.

    No problem. Just let us know when you’ve had a chance to try it again. We’ll be here 😉

    Also it might be a good idea to just rename the .htaccess file to htaccess without the dot anyway just for whilst you’re testing this.

    Thanks,

    Mark

  • #11 / Sep 14, 2011 1:24am

    somwicked

    26 posts

    Interestingly enough, that worked - kinda.

    Removing htaccess and adding index.php in the general config settings worked.

    So I dug a little deeper to see if I could find the root.

    Replaced htaccess, removed index.php setting (per instructions in docs). Tests failed.

    With htaccess in place, put index.php in general config. Test WORKED.

    Enabled ‘force query strings’, no index.php in settings - test failed.
    Made sure I had a session directory set in php.ini (had issues with v1 and photo uploads once). Test failed.

    I tried removing the first / in /index.php/$1 - no change.
    I tried adding the ? - /index.php?/$1 - no change.

    Feels like I tested more than this but .. essentially, the only way I could make the contact form work was to leave index.php in the general settings config.

    I also noticed the simple search form was not working earlier either. After this change, it is working. No noticeable effects elsewhere on the site yet.

  • #12 / Sep 14, 2011 2:53pm

    somwicked

    26 posts

    Only issue I can see with leaving index.php in general settings and using htaccess to remove it is the auto-generated paths still include index.php.

    I do have a few others v2 sites using older methods of removing index.php. I will use that code and see what I get.

    Thanks for the assist so far!

  • #13 / Sep 14, 2011 3:44pm

    Sue Crocker

    26054 posts

    Is index.php in the url working OK, or do you have to use index.php? instead?

  • #14 / Sep 14, 2011 3:47pm

    somwicked

    26 posts

    Seems to be working ok without using index.php in the URLs.

    The only issue I’ve noticed is some of the auto-generated URLs have the index.php.

  • #15 / Sep 15, 2011 1:29pm

    Mark Bowen

    12637 posts

    Hi somwicked,

    So everything is okay with index.php in there?

    When you say auto-generated URLs which are you referring to?

    Thanks,

    Mark

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

ExpressionEngine News!

#eecms, #events, #releases