I'm working on a multiple files upload script and i want to be warned when users upload some files. Here is my code for the upload :
if(isset($_POST['submit_image'])){
   for($i=0;$i<count($_FILES["upload_file"]["name"]);$i++){
    $uploadfile=$_FILES["upload_file"]["tmp_name"][$i];
    $folder="galerie/evg/";
    move_uploaded_file($_FILES["upload_file"]["tmp_name"][$i], "$folder".$_FILES["upload_file"]["name"][$i]);
    $to = "benoit@lalilou.com";
    $subject = "Nouvelles photos uploadées";
    $message = "
        <html>
            <head>
                <title>".$userRow['user_firstname']." a uploadé de nouvelles photos.</title>
            </head>
            <body>
                ".$userRow['user_firstname']." a uploadé de nouvelles photos.
                ".$_FILES["upload_file"]["name"][$i]."
                <br/>
                <br/>
            </body>
        </html>
    ";
    $headers = "MIME-Version: 1.0" . "\r\n";
    $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
    $headers .= 'From: <webmaster@lalilou.com>' . "\r\n";
}
mail($to,$subject,$message,$headers);
exit();}
My problem : I receive the mail but in the message, i only have the last file uploaded. And if i put the mail function into the for loop, i receive 2 or 3 mail depending of the amount of pictures uploaded.
My question : What is the right method to do that?
Thanks in advance :)
****EDIT****
Thanks to @menaka Here is the working final code for those who are looking for :
if(isset($_POST['submit_image'])){
$to = "benoit@lalilou.com";
$subject = "Nouvelles photos uploadées";
$message =  "
    <html>
        <head>
            <title>".$userRow['user_firstname']." a uploadé de nouvelles photos.</title>
        </head>
        <body>".$userRow['user_firstname']." a uploadé de nouvelles photos.<br/>";
for($i=0;$i<count($_FILES["upload_file"]["name"]);$i++){
    $uploadfile=$_FILES["upload_file"]["tmp_name"][$i];
    $folder="galerie/evg/";
    move_uploaded_file($_FILES["upload_file"]["tmp_name"][$i], "$folder".$_FILES["upload_file"]["name"][$i]);
    $message .= "<img style='width:200px;' src='http://exemple.com/galerie/".$_FILES["upload_file"]["name"][$i]."' />";
}
$message .= "<br/>
            <br/>
        </body>
    </html>
";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <webmaster@lalilou.com>' . "\r\n";
mail($to,$subject,$message,$headers);
exit();}