note 74237 added to function.mail

From: Date: Sat, 31 Mar 2007 14:03:13 +0000
Subject: note 74237 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-124971@lists.php.net to get a copy of this message
This is my code. The echo thing is quite good. Unfortunnly this code doesn't have an option to send 500 contacts at each time for example. So the server have problems sending my 20000 contacts. Any of you know how to send 500 contacts by hour? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Tralala</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $to = " "; /* assunto */ $subject = "tralala"; /* mensagem */ $message = ' <html> <head> <title>20070001a</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <bgsound src="http://www.blastedmechanism.com/musik/all_the_way.mp3" loop = "1" /> <style type="text/css"> <!-- a:link { color: #666666;} a:visited { color: #666666;} a:hover { color: #ffffff;} a:active { color: #666666;} .style1 { font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-style: normal; color: #FFFFFF} .style2 { font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-style: normal; color: #666666} .style13 { font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-style: normal; color: #999999} .passa { font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-style: normal; color: #FF0000} --> </style> </head> <body leftmargin="0" topmargin="0" bgcolor="#DACAB4"> text text text </body> </html> '; /* Atenção se você pretende inserir numa variável uma mensagem html mais complexa do que essa sem precisar escapar os carateres necessários pode ser feito o uso da sintaxe heredoc, consulte tipos-string-sintaxe-heredoc */ /* Para enviar email HTML, você precisa definir o header Content-type. */ $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "Return-Path: viagensdomeuser@gmail.com\r\n"; $headers .= "X-Priority: 1\n"; $headers .= "From: me <address@gmail.com>\r\n"; $headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters $myarray = array ( "emailaddress@hotmail.com" ); for($k=0;$k<=20650;$k++){ mail($myarray[$k], $subject, $message, $headers); echo 'email enviado para:' , $myarray[$k] , '<br>', "\n"; } /* Enviar o email mail($to, $subject, $message, $headers); echo $headers; */ ?> </body> </html> ---- Server IP: 200.185.109.13 Probable Submitter: 89.180.135.208 ---- Manual Page -- http://www.php.net/manual/en/function.mail.php Edit -- https://master.php.net/note/edit/74237 Del: integrated -- https://master.php.net/note/delete/74237/integrated Del: useless -- https://master.php.net/note/delete/74237/useless Del: bad code -- https://master.php.net/note/delete/74237/bad+code Del: spam -- https://master.php.net/note/delete/74237/spam Del: non-english -- https://master.php.net/note/delete/74237/non-english Del: in docs -- https://master.php.net/note/delete/74237/in+docs Del: other reasons-- https://master.php.net/note/delete/74237 Reject -- https://master.php.net/note/reject/74237 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#124971) next »