Customizing the Contact Form Module - Set their Email as Reply-to Address

The Contact Form Module for Exponent CMS automatically sets the reply address for the contact form to be info@yourdomain.com, which is useless because the email you can't reply to the email you get from the site. This tweak will change the reply-address to the email address that they entered, so you can just reply to the email.

First, open exponentroot/modules/contactmodule/actions/contact.php in a text editor. If you cannot edit them directly on the server, first download this file, make your changes, save it again, and upload it. I recommend that you use Filezilla as your FTP client.

Find the line:

$headers = array();

Above this line, insert

//hack to make reply-to the email that they entered
$config->replyto_address = $_POST['email'];
//make the from address the email that they entered
$config->from_address = $_POST['email'];
//make their name the name they entered (for your address book)
$config->from_name = $_POST['name'];

Thats it! Leave a comment if you have any questions or suggestions.