mail function not working

Tragic

New Member
I've tried searching for an answer here and on the web and I might be just missing something tiny here.I got a website hoted (not wamp or anything).I've written very simple email function to send also an attachment.for some reason I got no errors and no results.here is the PHP \[code\] if(isset($_POST['Submit'])){ $strTo = "[email protected]"; $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,$strMessage,$strHeader); // @ = No Show Error // if($flgSend) { echo "<p>works</p>"; } else { echo "<p>not working</p>"; } } ?>\[/code\]the form is on different page:\[code\]<form action="#!/studentform.2ndpahse" 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="http://stackoverflow.com/questions/13728117/???"></td> </tr> </table> </form> \[/code\]Will appriciate any assistance given
 
Back
Top