tags:

views:

68

answers:

3

i want know how i can send one mail to 200 user and i want when the email sendt it appeare send to:[email protected] from:my mail

because i think i see many email like that to:[email protected];[email protected];[email protected]; ithink this from bbc

i mean i want every user see sent to this email only

+1  A: 

if use mail function

use bcc in header like this :

$headers .= 'Bcc: [email protected],[email protected].............' . "\r\n";

u can use a class like phpmailer and use AddBCC() function

Haim Evgi
how my dear i can use it
moustafa
+2  A: 

You can use the native mail() function, separate the addresses with a comma, and put them all in the blind carbon copy list with additional headers.

$to       = "[email protected],[email protected]";
$subject  = "Mini-mass Emailer";
$message  = "Hello World";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Your Name <[email protected]>' . "\r\n";
$headers .= 'Bcc: {$to}' . "\r\n";

mail($to, $subject, $message, $headers);

Or you could iterate over the collection of email addresses and send each message individually:

$emails = array("[email protected]","[email protected]");
foreach ($emails as $email) {
  $to = $email;
  $subject = "My Subject";
  $message = "Hello World";

  mail($to, $subject, $message);
}
Jonathan Sampson
how i can do that
moustafa
and will appear to:only uer mail or all emails
moustafa
Blind carbon copies don't show other recipients.
Jonathan Sampson
what the meaning of Blind carbon
moustafa
and i think the second method will increase server load
moustafa
+1  A: 

Send each mail separately to each user. You can write a helper utility function to do this iteratively.

this. __curious_geek