Problems with Contact form

Couple of days ago I had a problem with contact form not working in Magento Professional Magento was throwing error “Unable to submit your request. Please, try again later” after submitting form. Of course all requested fields was filled. Here I will explain what needs to be done if you have same problems.

First thing, which would probably solve the problem, was to change following function of app/code/core/Mage/Core/Model/Email/Template.php

  public function setReplyTo($email)
        $this->getMail()->addHeader('Reply-To', $email);
        return $this;


public function setReplyTo($email)
        return $this;

You can override this function in a dirty way by creating same folder hierarchy to Template.php file in your app/code/local or creating separate module (Magento way which will avoid possible overwriting when upgrading to newer version of Magento)

Additional problem solving steps are:

  1. Create new CMS page and call form.phtml from there. You can do this by following:
    • Create new CMS page
    • URL key value: contacts
    • Content value:
      < !โ€“ CONTACT FORM โ€“>
      {{block type=’core/template’ name=’contactForm’ template=’contacts/form.phtml’}}
      < !โ€“ END OF CONTACT FORM โ€“>
      P.S. Watch to have single quotes!
  2. Check if form action attribute is set right. Sometimes this can generate a problem. Action attribute value should point to: Originally value for action attribute is
    <?php echo $this->getFormAction(); ?>

    but you can try it to set it manually to “”

  3. Check if you maybe missed configuration settings for enabling email sending functionalities.
  4. Try to change “Sending emails to” to some other email which do not have same email domain as your Magento website. Some hosts can produce problem if “Sending from” email is from same host provider as the “Sending to” email.
  5. Create new transaction email for Contact form transactional email and name it differently than default.

Hope this helps someone!

You made it all the way down here so you must have enjoyed this post! You may also like:

Moving the Add to Cart validation error message on product page Danijel Vrgoc
, | 0

Moving the Add to Cart validation error message on product page

5 UX improvements for Magento checkout page design Marko Brisevac
, | 0

5 UX improvements for Magento checkout page design

Contact Form in Magento Domagoj Potkoc
Domagoj Potkoc, | 113

Contact Form in Magento


  1. Hello,
    I experience the same situation as described by Ryan.

    This fix doesn’t work on Entreprise 1.9

    Any suggestion?

  2. Hello,

    I saw this fix on another site that pointed out it might break all other emails. This is the case for us, as this did not resolve the stated issue with contact_us and made it so that no other emails came out either.

    Any other options? There are so many threads on this error, and I have tried them all.

    I’m on Enterprise Magento ver.

  3. @Kevin $this->getMail() returns Zend_Mail object. Method “setReplyTo($email)” is not called on Mage_Core_Model_Email_Template, therefore that’s not an infinite loop.

  4. @Ana
    You were right. There was a typo, but corrected really fast. Thank you for input ๐Ÿ˜‰

  5. public function setReplyTo($email)
    return $this;

    Surely thats an infinite loop???

  6. It was originally written : โ€œProblems with Contact fromโ€, instead of: โ€œProblems with Contact formโ€. I noticed that so I wrote, and few hours later, somebody changed that. ๐Ÿ™‚ Maybe because of my comment or somebody else also noticed that. ๐Ÿ˜‰


  7. Vanja, I hoticed one small mistake in your headline. I suppose that you wanted to write: “Problems with Contact form”. ๐Ÿ˜‰

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.

Tell us about your project

Drop us a line. We'd love to know more about your project.