<?php } if($acao == "enviar") { $dados = file($file_cad); $aux = 0; $url.="apaga.php"; while (each($dados)) { $subdados_aux = explode("][",$dados[$aux]); $mailaddr = $subdados_aux[1]; $chave_ap = $subdados_aux[2]; $corpo_a = $corpo; $corpo_a .= "\n\nSe deseja sair da lista clique no link:"; $corpo_a .= " $url?chave_ap=$chave_ap"; $mime_list = array("html"=>"text/html","htm"=>"text/html", "txt"=>"text/plain", "rtf"=>"text/enriched","csv"=>"text/tab-separated-values","css"=>"text/css","gif"=>"image/gif"); $ABORT = FALSE; $boundary = "XYZ-" . date(dmyhms) . "-ZYX"; $message = "--$boundary\n"; $message .= "Content-Transfer-Encoding: 8bits\n"; $message .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\n\n"; $message .= $corpo_a; $message .= "\n"; #//attachment file names with full path $attachments[1] = $anexo; #$attachments[2] = "c:\etc"; #$attachments[3] = "c:\etc"; //verifica se existe um arquivo anexado no código foreach ($attachments as $key => $full_path) { if ($full_path !='') { if (file_exists($full_path)) { //try to open if ($fp = fopen($full_path,"rb")) { //get the file name from the path $filename = array_pop(explode(chr(92),$full_path)); $contents = fread($fp,filesize($full_path)); //encode data $encoded = base64_encode($contents); //*****SPLIT THE ENCODED DATA***** $encoded_split = chunk_split($encoded); fclose($fp); $message .= "--$boundary\n"; $message .= "Content-Type: $anexo_type\n"; $message .= "Content-Disposition: attachment; filename=\"$anexo_name\" \n"; $message .= "Content-Transfer-Encoding: base64\n\n"; $message .= "$encoded_split\n"; } else { echo "Cannot open file$key: $filename"; $ABORT = TRUE; } } else { echo "File$key does not exist: $filename"; $ABORT = TRUE; } } } $message .= "--$boundary--\r\n"; $headers = "MIME-Version: 1.0\n"; $headers .= "From: <$from>\r\n"; $headers .= "Content-type: multipart/mixed; boundary=\"$boundary\"\r\n"; $mensagem=mail($mailaddr, $mailsubject, $message, $headers); /* mail($mailaddr, $mailsubject, "$corpo Se deseja sair da lista clique no limk a frente $url?chave_ap=$chave_ap","Remetido por $nome_ad <$mail_ad>");*/ $aux++; } ?>
No Remetente ele envia o meu e-mail, ao invés do meu nome. Será que alguém pode ajudar a mudar isso?
Ex.:
De: paulo@paulo.com.br
Assunto: Blá blá blá!
Mensagem:
fdfdfdfdfdfd
fdfdsfdsfds
fdfdsfds
fdsfds
E deveria ser assim:
De: Paulo Henrrique
Assunto: Blá blá blá
Mensagem:
fdfdfdfdfdfd
fdfdsfdsfds
fdfdsfds
fdsfds
Valeu!
Fabian