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.
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:
// Send Email Notification
$to = "[email protected]";
$subject = "A Website User uploaded files";
$message = "The download link goes here. ";
$from = "[email protected]";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
The next line of code in the script outputs the value I want to send in the message of the email like this:
$TMPL['message'] .= '<div class="success">Download:
<a href="index.php?a=download&q='.$execLastRow[0].'"
target="_blank">'.$_FILES['fileselect']['name'][$key].'</a></div>';
Obviously this is the wrong syntax but this is the gist of what Im trying to do:
// Send Email Notification
$to = "[email protected]";
$subject = "A Website User uploaded files";
$message = "Download: <a href="index.php?a=download&q='.$execLastRow[0].'" target="_blank">'.$_FILES['fileselect']['name'][$key].'</a>. ";
$from = "[email protected]";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
Assistance as always is appreciated!