الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ارسال بريد باكثر من مرفق مطلوب مساعدة في تصحيح الكود

بدأه oneyemenweb2 في 24 مارس 2012 · 0 رد · 288 مشاهدة · في منتدى تطوير المواقع بـ PHP
مشاركة: واتساب X فيسبوك تيليجرام
#1

السلام عليكم

ارسال بريد باكثر من مرفق مطلوب مساعدة في تصحيح الكود المشكلة ان الرسالة لا تظهر المرفقات ترسل لكن الرسالة لا تظهر

<?php

$file_path[0]=$_GET["f1"];
$file_path[1]=$_GET["f2"];
$file_path[2]=$_GET["f3"];
$file_path_name[0]=$_GET["f4"];
$file_path_name[1]=$_GET["f5"];
$file_path_name[2]=$_GET["f6"];
$file_path_type[0]=$_GET["f7"];
$file_path_type[1]=$_GET["f8"];
$file_path_type[2]=$_GET["f9"];


    // we'll begin by assigning the To address and message subject
    $to=$_GET["f10"];
    $subject= $_GET["f11"];

    // get the sender's name and email address
    // we'll just plug them a variable to be used later
    $from = $_GET["f12"];
	$me=$_GET["f13"];

    // generate a random string to be used as the boundary marker
    $mime_boundary= md5(uniqid(time()));
    //body message
    $messagebody =$me;

    $headers = "From: $from\r\nMIME-Version: 1.1\r\n";
    $headers .= "Content-Type: multipart/mixed; boundary=\"{$mime_boundary}\"\r\n";


    $message .= "--{$mime_boundary}\r\n";
    $message .= "Content-Type: text/html;charset=\"UTF-8\"";
    $message .= "Content-Transfer-Encoding: 7bit\r\n";
	$a="";
    $message .= $messagebody;
  for ($i=0; $i<3; $i++){


            // check to make sure that it is an uploaded file and not a system file
            // check to see if a file has been uploaded and see if it is NOT empty

            if($file_path_name[$i] != "N" ){
                 $headers .= "--{$mime_boundary}\r\n";
               // echo "File $i Uploaded<br />";
                // note that we insert two dashes in front of the
                // MIME boundary when we use it
                // now we'll insert a boundary to indicate we're starting the attachment

//$file = fopen($file_path,'rb');
//$data = fread($file,filesize($file_path));
                // open the file for a binary read
                $file = fopen($file_path[$i],'rb');
                // read the file content into a variable
                $data = fread($file,filesize($file_path[$i]));
                // close the file
                fclose($file);
                // now we encode it and split it into acceptable length lines
                $files = chunk_split(base64_encode($data));

                // we have to specify the content type, file name, and disposition as
                $headers .="Content-Type: application/{$file_path_type[$i]}; name=\"{$file_path_name[$i]}\"\r\n";
                $headers .="Content-Transfer-Encoding: base64\r\n";
                $headers .= "Content-Disposition: attachment; filename=\"{$file_path_name[$i]}\"\r\n\r\n";
              $headers.= $files . "\r\n";

            }//سس سسس

    }*/
     //$message .= "{$mime_boundary}--\r\n";
    // now we just send the message
    // an attachment, then add the file content and set another boundary to
    // indicate that the end of the file has been reached
    // next, we'll build the message body

  if(mail($to, $subject, $message, $headers)){
      echo "message sent";
 } else {
     echo "mail failed";
   }




?>

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…