\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "X-Mailer: PHP/".phpversion()."\r\n"; // Obter os dados dos emails diretamente do formulário $lines = explode("\n", $to); $i = 0; $count = 1; $ok = "ok"; while(isset($lines[$i])) { $line = trim($lines[$i]); if (!$line) { $i++; continue; } // Dividir a linha em partes list($current_email, $cnpj, $razao, $telefone, $socio) = explode(';', $line) + [null, null, null, null, null]; $current_email = trim($current_email); $subject = $_POST['assunto']; $message = $_POST['html']; if ($current_email) { // Substituir as tags no assunto e mensagem $message = str_replace(['{{cnpj}}', '{{razao}}', '{{telefone}}', '{{socio}}', '%EMAIL%', '%random_num%'], [trim($cnpj), trim($razao), trim($telefone), trim($socio), $current_email, random_num()], $message); $subject = str_replace(['{{cnpj}}', '{{razao}}', '{{telefone}}', '{{socio}}', '%EMAIL%', '%random_num%'], [trim($cnpj), trim($razao), trim($telefone), trim($socio), $current_email, random_num()], $subject); $message = stripslashes($message); // Enviar o email if(mail($current_email, $subject, $message, $headers)) echo "* Numero: $count ".$current_email." OK

"; else echo "* Numero: $count ".$current_email." ERRO AO ENVIAR

"; } else { echo "* Numero: $count ".$line." EMAIL NÃO ENCONTRADO

"; } $i++; $count++; } if($ok == "ok") echo ""; } ?> Envio de Email

Envio de Emails

*Lembrete: texto em HTML *Separado por quebra de linha
Nome do Servidor:
Sistema Operacional:
Endereço IP:
Software usado:
Email admin:
Safe Mode: