Q:

Form email sending with file attachment not sending email nor reporting errors

I'm trying to send form with file upload , which the user entered, and for some reason it seems not to send the mail.
Problem is that I don't get an error to understand where I have a mistake.
Before everything, I do not want to use any libraries to do it, I want to keep it simple.
Here is the code:
<?php  

if(isset($_POST['Submit'])){
    $strTo = "my.email@address.com";  
    $strSubject = "Purchase request from " . $_POST["formName"] . $_POST["formSurname"];  
    $strMessage = nl2br($_POST["formName"] . $_POST["formEmail"] . $_POST["formInstitute"] . $_POST["formCourse"] . $_POST["formNotes"]);  

    //*** Uniqid Session ***//  
    $strSid = md5(uniqid(time()));  

    $strHeader = "";  
    $strHeader .= "From: ".$_POST["formEmail"]."<".$_POST["formEmail"].">\nReply-To: ".$_POST["formEmail"]."";  

    $strHeader .= "MIME-Version: 1.0\n";  
    $strHeader .= "Content-Type: multipart/mixed; boundary=\"".$strSid."\"\n\n";  
    $strHeader .= "This is a multi-part message in MIME format.\n";  

    $strHeader .= "--".$strSid."\n";  
    $strHeader .= "Content-type: text/html; charset=utf-8\n";  
    $strHeader .= "Content-Transfer-Encoding: 7bit\n\n";  
    $strHeader .= $strMessage."\n\n";  

    //*** Attachment ***//  
    if($_FILES["fileAttach"]["name"] != "")  
    {  
        $strFilesName = $_FILES["fileAttach"]["name"];  
        $strContent = chunk_split(base64_encode(file_get_contents($_FILES["fileAttach"]["tmp_name"])));  
        $strHeader .= "--".$strSid."\n";  
        $strHeader .= "Content-Type: application/octet-stream; name=\"".$strFilesName."\"\n";  
        $strHeader .= "Content-Transfer-Encoding: base64\n";  
        $strHeader .= "Content-Disposition: attachment; filename=\"".$strFilesName."\"\n\n";  
        $strHeader .= $strContent."\n\n";  
    }  

    $flgSend = mail($strTo,$strSubject,null,$strHeader);  // @ = No Show Error //  

    if($flgSend)  
    {  
        echo "Mail send completed.";  
    }  
    else  
    {  
        echo "Cannot send mail.";  
    }  
}
?>

and here is the form:
    <form action="#!/studentform.2ndphase" method="post" name="form1" enctype="multipart/form-data">  
        <table width="500">  
        <tr>  
            <td>שם פרטי: </td>  
            <td><input name="formName" type="text" id="name"></td>  
        </tr>  
        <tr>  
            <td>שם משפחה: </td>  
            <td><input name="formSurname" type="text" id="surname"></td>  
        </tr>  
        <tr>  
            <td>דואר אלקטרוני: </td>  
            <td><input name="formEmail" type="text"></td>  
        </tr>  
        <tr>  
            <td>מוסד אקדמי: </td>  
            <td><input name="formInstitute" type="text"></td>  
        </tr>  
            <td>מסלול: </td>  
            <td><input name="formCourse" type="text"></td>  
        </tr> 
        <tr>  
            <td>הערות</td>  
            <td><textarea name="formNotes" cols="30" rows="4" id="formNotes"></textarea></td>  
        </tr>  

        <tr>  
        <td>Attachment</td>  
        <td><input name="fileAttach" type="file"></td>  
        </tr>  
        <tr>  
        <td>&nbsp;</td>  
        <td><input type="submit" name="Submit" value="שלח"></td>  
        </tr>  
        </table>  
    </form>  

The action directs to different page, since I'm using framework based on php, this is why the link is set as #!studentform.2ndphase
Thanks for any help given.

A:

Create a new php file, add this to it
<?php
phpinfo();
?>

upload and open it in your browser, scroll down the page and check if the "sendmail_path" is empty or find the disabled functions chances are the mail function has been disabled by your host.
or you could just run a small function to check,
<?php
$to      = 'you@yourdomain.com';
$subject = 'Mail test';
$message = 'This is a test email';
$headers = 'From: you@yourdomain.com' . "\r\n" .
   'Reply-To: you@yourdomain.com' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?> 

change the "you@yourdomain.com" to your email address
{UPDATE}
you could use another email system to send it. or use a SMTP script
I like: htmlMimeMail5
<?php
require_once("htmlMimeMail5.php");
$mail = new htmlMimeMail5();
$mail->setFrom("YourName <you@example.com>");
$mail->setSubject('Test email');
$mail->setHTML('<body background="background.gif"><b>Sample HTML</b></body>');
$mail->send(array('sentto@example.com'));
?>

