note 85476 deleted from function.mail by cmb

From: Date: Sun, 21 Jul 2019 08:30:02 +0000
Subject: note 85476 deleted from function.mail by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211639@lists.php.net to get a copy of this message
Note Submitter: webmaster at plumage dot nl ---- 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: <?php $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@example.com\r\n"; ?>

« previous php.notes (#211639) next »