function doset() { set_time_limit(200000); ini_set("memory_limit", "256M"); ignore_user_abort(true); } doset(); if ($_POST['action']=="send"){ $message = urlencode($_POST['message']); $message = ereg_replace("%5C%22", "%22", $message); $message = urldecode($message); $message = stripslashes($message); $subject = stripslashes($_POST['subject']); } ?>
Email:
Nume:
Reply-To:
Ataseaza Fisier:
Subiect:
print stripslashes($_POST['message']); ?>
Plain Text
HTML
(EMAIL TEST)
Pentru fiecare
emailuri astept
secunde
if ($_POST['action']=="send"){ $message = urlencode($_POST['message']); $message = ereg_replace("%5C%22", "%22", $message); $message = urldecode($message); $message = stripslashes($message); $subject = stripslashes($_POST['subject']); $from=$_POST['from']; $realname=$_POST['realname']; $replyto=$_POST['replyto']; $emaillist=$_POST['emaillist']; if( strpos($_POST['emailfinal'], "@") !== false) $emaillist .= "\n". $_POST['emailfinal']; $contenttype=$_POST['contenttype']; $allemails = split("\n", $emaillist); $numemails = count($allemails); #Deschide fisierul atasat dacă este cazul, base64_encode encodeaza emailu $file_name = $_FILES["file"]["name"]; $file = $_FILES["file"]["tmp_name"]; If ($file_name){ //@copy($file, "./$file_name") or die("Fisierul pe care încercati să încărcati nu a putut fi copiat la server"); $content = fread(fopen($file,"r"),filesize($file)); $content = chunk_split(base64_encode($content)); $uid = strtoupper(md5(uniqid(time()))); $name = basename($file); } for($x=0; $x<$numemails; $x++){ if($_POST['emailz'] && $_POST['wait']) if( fmod($x,$emailz) == 0 ) { echo "-------------------------------> Trimit mail $x, si $wait secunde astept.
"; sleep($wait); } $to = $allemails[$x]; if ($to){ $to = ereg_replace(" ", "", $to); $message = ereg_replace("&email&", $to, $message); $subject = ereg_replace("&email&", $to, $subject); print "Trimit mail catre $to......."; flush(); $header = "From: $realname <$from>\r\nReply-To: $replyto\r\n"; $header .= "MIME-Version: 1.0\r\n"; If ($file_name) $header .= "Content-Type: multipart/mixed; boundary=$uid\r\n"; If ($file_name) $header .= "This is a multi-part message in MIME format.\r\n"; If ($file_name) $header .= "--$uid\r\n"; $header .= "Content-Type: text/$contenttype\r\n"; $header .= "Content-Transfer-Encoding: 8bit\r\n\r\n"; $header .= "$message\r\n"; If ($file_name) $header .= "--$uid\r\n"; If ($file_name) $header .= "Content-Type: application/octet-stream; name=\"$file_name\"\r\n"; If ($file_name) $header .= "Content-Transfer-Encoding: base64\r\n"; If ($file_name) $header .= "Content-Disposition: attachment; filename=\"$file_name\"\r\n\r\n"; If ($file_name) $header .= "$content\r\n"; If ($file_name) $header .= "--$uid--"; mail($to, $subject, "", $header); print " SEND
"; flush(); } } } ?>