Change magento contact form FROM address as User contact address

  1. In magento we could set the contact from FROM address in admin under Admin->Configuration->Contact->Email Sender(Field)

  2. In our case, we cant able to send email from Same address like XXX@knowledgebags.com to XXX@knowledgebags.com. So, we need to change the email from address as like user emails address. So, we did as like below!
  3. //Copy
    /app/code/core/Mage/Contacts/controllers/IndexController.php
     //Copy above file Into below location: 
    /app/code/local/Mage/Contacts/controllers/IndexController.php
    //You can comment out line 97, don’t need that anymore:
    //->setReplyTo($post['email'])
     //Comment out line 100, the one causing the problem:
    //Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
     //Add a new line 101:
    array('email' => $post['email'], 'name' => $post['name']),
     //Save and you’re done!

4. Also, in my case Copy file into local folder not worked. So, we have did the test in /core folder itself and tested. Its worked fine.

NOTE: Also, we have changed all email sender admin as different address. For customer, order emails…etc

One thought on “Change magento contact form FROM address as User contact address”

Leave a Reply

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