# Update / Control Email Address Dynamically

**URL:** <https://forum.kirupa.com/t/update-control-email-address-dynamically/315708>\
**Category:** Uncategorized\
**Created:** [November 2, 2010, 2:37pm UTC](https://forum.kirupa.com/t/update-control-email-address-dynamically/315708 "2010-11-02T14:37:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![worthless](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@worthless](https://forum.kirupa.com/u/worthless)\
**Post date:** [November 2, 2010, 2:37pm UTC](https://forum.kirupa.com/t/update-control-email-address-dynamically/315708/1 "2010-11-02T14:37:20Z")

</div>

Here is a PHP scripts for sending mail. I want to know is there any way to update / control the email address ( ie $to = "HOT@gmail .com ) from any outside file ( like XML or Text File)  
Here is the PHP mail code.

```auto

<?PHP
$theName = $_REQUEST["theName"];
$theEmail = $_REQUEST["theEmail"];
$my_cb_month = $_REQUEST["my_cb_month"];
$to = "HOT@gmail.com";
$subject = "DHDHHD";
$message = "Name:" . $theName;
$message .= "
Email:" . $theEmail;
$message .= "
\Date Of Booking = " . $my_cb_month ;
$headers = "From: ". $theName . " " . "<" . $theEmail. ">
";
$headers .= "Reply-To: " . $theEmail. "
";
$headers .= "Return-path: ". $theEmail;
$sentOk = mail($to,$subject,$message,$headers);
echo"sentOk=" . $sentOk;

?>

```

Thanks for your time.

Worthless
