Thursday, 15 August 2013

php mail() to multiple recipients - dont share email adresses -



php mail() to multiple recipients - dont share email adresses -

im sending batch email multiple recipients using:

mail(implode(',', $emails), $subject, $content, $headers);

however, each person can see list of email sent to. want maintain private, , email appears more personal.

is there way without sending mail() each email, i'm guessing take long time run?

you looking simple bcc address. in same mail service not able see each others email address.

look here: http://php.net/manual/en/function.mail.php , find bcc.

this piece need:

$headers = array(); $headers[] = "mime-version: 1.0"; $headers[] = "content-type: text/plain; charset=iso-8859-1"; $headers[] = "from: sender name <sender@domain.com>"; $headers[] = "bcc: jj chong <bcc@domain2.com>"; $headers[] = "reply-to: recipient name <receiver@domain3.com>"; $headers[] = "subject: {$subject}"; $headers[] = "x-mailer: php/".phpversion(); mail($to, $subject, $email, implode("\r\n", $headers));

php email

No comments:

Post a Comment