Ben bir eki kabul ve eki göndermek için formu var ama bir doktor ise boş bulunuyor:
$fileatt = $_FILES['file']['tmp_name'];
$fileattType = $_FILES['file']['type'];
$fileattName = $_FILES['file']['name'];
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers = "from: $email";
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$content = "Info about user";
$content = "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" .
$content . "\n\n";
$data = chunk_split(base64_encode($data));
$content .= "--{$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";
$send = mail( "user@provider.com", "Form", $content, $headers);
if($send)
header('Location: success page');
else
header('Location: fail page');
E-posta, doğru adı, dosya türü ve dosya boyutu ile bir eki var, doğru gönderir. o açtığında boş olduğunu.
http://articles.sitep ...... mail-php / 5: Ben sitepoint gelen öğretici var
Ben sağladıkları dosyaları test edilmiş ve aynı şey olur. Herhangi bir fikir harika olurdu. teşekkürler herkese!