# How to Modify From Address in Email Sent From mailer.php

**URL:** <https://forum.kirupa.com/t/how-to-modify-from-address-in-email-sent-from-mailer-php/328984>\
**Category:** programming\
**Created:** [July 9, 2012, 7:37pm UTC](https://forum.kirupa.com/t/how-to-modify-from-address-in-email-sent-from-mailer-php/328984 "2012-07-09T19:37:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Walters](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@Chris\_Walters](https://forum.kirupa.com/u/Chris_Walters)\
**Post date:** [July 9, 2012, 7:37pm UTC](https://forum.kirupa.com/t/how-to-modify-from-address-in-email-sent-from-mailer-php/328984/1 "2012-07-09T19:37:13Z")

</div>

I need to modify the From Address in the Email Sent From mailer.php to the user’s supplied email address, so that I can just reply to their email, rather than having to compose a new email to the user’s email address. How can I modify that? Here is a link to my form page and PHP code below:

[http://tbs-inc.com/proposal.html](http://tbs-inc.com/proposal.html)

\<?PHP  
$to = "btraylor@tbs-inc.com, [cwalters@tbs-inc.com](mailto:cwalters@tbs-inc.com)";  
$subject = “Proposal Inquiry from [TBS-Inc.com](http://TBS-Inc.com)”;  
$headers = “From: Form Mailer”;  
$forward = 1;  
$location = “thanks.html”;

$date = date (“l, F jS, Y”);  
$time = date (“h:i A”);

$msg = "You have received a proposal request from the TBS website. It was submitted on $date at $time.

";

if ($\_SERVER[‘REQUEST\_METHOD’] == “POST”) {  
foreach ($\_POST as $key =\> $value) {  
$msg .= ucfirst ($key) ." : ". $value . "  
“;  
}  
}  
else {  
foreach ($\_GET as $key =\> $value) {  
$msg .= ucfirst ($key) .” : ". $value . "  
";  
}  
}

mail($to, $subject, $msg, $headers);  
if ($forward == 1) {  
header (“Location:$location”);  
}  
else {  
echo “Thank you for submitting our form. We will get back to you as soon as possible.”;  
}

?\>
