you have to follow the previous advice, too.
Depending on whether register_globals is on or off, you will have to access the variable a little differently.
If you are using post method, you will be able to use $POST['fromAddress'], if you are using GET you can use $GET['fromAddress'] where fromAddress is the name of the input in the form. Using it in that manner is also more secure.
once you have it, you can build the from string.
you can look up register globals setting, as well and POST and GET in the manual. www.php.net/manual/en
Here's another tip... whenever you seem to be having trouble accessing a variable, especially if it's coming from a form, do:
print_r($GLOBALS);
this wil show you ALL the variables in your script.