Note that there are some explanatory texts on larger screens.

plurals
  1. POmail send but its empty in php
    primarykey
    data
    text
    <p>i want to send mail and mail is going to send but problem is that mail is empty in mail box. What is the problem in my code?</p> <pre><code>$afile = $_FILES['myFile']; //Getting info about above taken file $fileatttype = $afile['type']; $fileattname = $afile['name']; $filesize=$afile['size']; if($fileatttype=="application/octet-stream" or $fileatttype=="text/plain" or $fileatttype=="application/msword" or $fileatttype=="application/pdf") { $otherData="**********************Personal Details*********************\n Position Applied For :$Position\n First Name :$First\n Last Name:$LastName\n Date Of Birth :$DD-$MM-$yy\n Correspondence Address :$Caddress1 $Caddress2 $Caddress2\n Permanent Address :$Paddress1 $Paddress2 $Paddress2\n Contact No(HOME):$Home\n Mobile :$Mobile\n E-Mail :$EMail\n **********************Education*********************\n Quallification :$Quallification\n OtherCourse:$OtherCourse\n **********************Previous Working Details*********************\n Company Name-$WCompany1\n Title-$WTitle1\n CTC-$WCTC1\n Reasons of Leaving-$WReason1\n Company Name-$WCompany2\n Title-$WTitle2\n CTC-$WCTC2\n Reasons of Leaving-$WReason2\n Company Name-$WCompany3\n Title-$WTitle3\n CTC-$WCTC3\n Reasons of Leaving-$WReason3\n Company Name-$WCompany4\n Title-$WTitle4\n CTC-$WCTC4\n Reasons of Leaving-$WReason4\n Current CTC:$CCTC\n Expected CTC:$ECTC\n Notice Period Required :$NoticePeriod\n Total no of years experience :$TotalExperience Years\n Current Location :$Clocation\n Preferred Location:$Plocation\n Resume:$Resume\n **********************Family Details*********************\n Father / Guardian Name :$Fname\n Father / Spouse: Occupation:$Focc\n Kids:$Kids\n Age of Kids:$AOK\n "; $to="renu_activa@yahoo.co.in"; $from=$_POST['First']; $subject=$Position; $headers = "From: $First"; if($filesize&gt;0) { $file = fopen($afile['tmp_name'],'rb'); $data = fread($file,$afile['size']); fclose( $file ); } //Making a random number to use afterwards with help of current time $semi_rand = md5( time() ); //Defining the type of email as Mime email $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; //Appending to headers, telling that its multipart message with text and attachment $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; //The text part of message in variable $otherData with other details $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $otherData . "\n\n"; //Encoding all the data read from file to "base64" the standard for email attachments $data = chunk_split(base64_encode($data)); //Appending the file data to the email including the file name etc $message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatttype};\n" . " name=\"{$fileattname}\"\n" . "Content-Disposition: attachment;\n" . " filename=\"{$fileattname}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n"; $sentmail=mail($to, $subject, $message, $headers); if($sentmail) { header('location: career-with-us.php'); } else { echo "Mail Not Send Successfully...."; } } else { echo "Wrong format: Please upload only PDF/DOC/DOCX/TXT file format..."; } </code></pre> <p>I am not getting why its empty neither textbox value nor file attachment is showing in mail. Its totally empty.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload