Note that there are some explanatory texts on larger screens.

plurals
  1. POmultiple emails attachment are not working
    primarykey
    data
    text
    <p>i am trying to send multiple email same time. it works sometime it not.</p> <p>Help me ....</p> <pre><code># DYNAMICALLY GET ALL ATTACHMENTS for($i=1;$i&lt;count($_FILES)+1; $i++){ if(!empty($_FILES['atachment'.$i]['tmp_name'])){ $file_name = $_FILES['atachment'.$i]['name']; $temp_name = $_FILES['atachment'.$i]['tmp_name']; $file_location = $_FILES['atachment'.$i]['tmp_name']; $filetype = $_FILES['atachment'.$i]['type']; move_uploaded_file($temp_name,'temp_upload/'.$file_name); $files[] = 'temp_upload/'.$file_name; } } # EMAIL SETTING $headers = "From:$from"; $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; // headers for attachment $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; // multipart boundary $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" . $message . "\n\n"; # PREPARE ATTACMENTS for($x=0;$x&lt;count($files);$x++){ $file = fopen($files[$x],"rb"); $data = fread($file,filesize($files[$x])); fclose($file); $data = chunk_split(base64_encode($data)); $message .= "Content-Type: {\"application/octet-stream\"};\n" . " name=\"$files[$x]\"\n" . "Content-Disposition: attachment;\n" . " filename=\"$files[$x]\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n"; $message .= "–{$mime_boundary}–\n"; } # CHECK IF SEND FUNCTION $ok = @mail($to, $subject, $message, $headers); if ($ok) { echo "&lt;p&gt;mail sent to $to!&lt;/p&gt;"; } else { echo "&lt;p&gt;mail could not be sent!&lt;/p&gt;"; } enter code here </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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