note 85476 added to function.mail

From: Date: Mon, 01 Sep 2008 21:53:39 +0000
Subject: note 85476 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-144058@lists.php.net to get a copy of this message
The work-around for a large quantity of recipients is putting the adresses in the header-section as Bcc adresses. In this way the mail()-function opens and closes the SMTP connection only once: <? $count_recip= count($recip);//where $recip represents an array of mail-adresses, from MySql-query or otherwise $count='0'; $headers.="Bcc: "; while($count < $count_recip){ $headers.=$recip[$count].", "; $count ++; } $headers.="admin@mailinglist.com\r\n"; ?> ---- Server IP: 213.249.64.162 Probable Submitter: 80.101.181.202 ---- Manual Page -- http://www.php.net/manual/en/function.mail.php Edit -- https://master.php.net/note/edit/85476 Del: integrated -- https://master.php.net/note/delete/85476/integrated Del: useless -- https://master.php.net/note/delete/85476/useless Del: bad code -- https://master.php.net/note/delete/85476/bad+code Del: spam -- https://master.php.net/note/delete/85476/spam Del: non-english -- https://master.php.net/note/delete/85476/non-english Del: in docs -- https://master.php.net/note/delete/85476/in+docs Del: other reasons-- https://master.php.net/note/delete/85476 Reject -- https://master.php.net/note/reject/85476 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#144058) next »