note 74237 deleted from function.mail by philip

From: Date: Sun, 01 Apr 2007 09:34:27 +0000
Subject: note 74237 deleted from function.mail by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-124990@lists.php.net to get a copy of this message
Note Submitter: hugofrlima at hotmail dot com ---- 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>

« previous php.notes (#124990) next »