title: PHP email, how to include variable in message
body: <p>I have an upload script that I have purchased. I need to add some more functionality to it however and my php knowledge is pretty basic. What I need is for an email containing the file location to be sent out via email to a set address. Basically a notification that something has been uploaded.</p>
  
  <p>I have worked out what part of the code these needs to go in, and have got as far as adding this which works perfectly:</p>
  
  <pre><code>// Send Email Notification
         $to = "info@email.co.uk";
         $subject = "A Website User uploaded files";
         $message = "The download link goes here. ";
         $from = "registrations@email.co.uk";
         $headers = "From:" . $from;
         mail($to,$subject,$message,$headers);
  </code></pre>
  
  <p>The next line of code in the script outputs the value I want to send in the message of the email like this:</p>
  
  <pre><code>$TMPL['message'] .= '&lt;div class="success"&gt;Download: 
  &lt;a href="index.php?a=download&amp;q='.$execLastRow[0].'" 
  target="_blank"&gt;'.$_FILES['fileselect']['name'][$key].'&lt;/a&gt;&lt;/div&gt;';
  </code></pre>
  
  <p>Obviously this is the wrong syntax but this is the gist of what Im trying to do:</p>
  
  <pre><code>// Send Email Notification
         $to = "info@email.co.uk";
         $subject = "A Website User uploaded files";
         $message = "Download: &lt;a href="index.php?a=download&amp;q='.$execLastRow[0].'" target="_blank"&gt;'.$_FILES['fileselect']['name'][$key].'&lt;/a&gt;. ";
         $from = "registrations@email.co.uk";
         $headers = "From:" . $from;
         mail($to,$subject,$message,$headers);
  </code></pre>
  
  <p>Assistance as always is appreciated!</p>