-2

Possible Duplicates:
How to send e-mail to multiple recipients from database query (PHP)
Sending mass email using PHP

Hello,

I want to send email to more then 1000 users in php.Can anybody help me aur tell me. How can i send.I try to use PHP Mailer but it is giving problem.

Thanks, Jubin Mehta

Community
  • 1
  • 1
jubin
  • 97
  • 1
  • 2
  • 9

1 Answers1

3

First: the php manual of the function mail() is very detailed with a lot of examples...

so look:

mail( $to, $subject, $message, $header)

$to = "email@email.com";
//if you want add more 
$to .= ", anotheremail@email.com";
//you can seperate the mails with ","

$subject = "";
$message = "Hello world!";

// for html-emails you must set the content-type-header
$header  = 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// so here we are, here you can add an return address
// and add Cc and Bcc, that are added addresses, they will also get the email, so email to multiple addresses
$header = 'Reply-To: webmaster@example.com' . "\r\n";
$header .= 'From: Geburtstags-Erinnerungen <geburtstag@example.com>' . "\r\n";
$header .= 'Cc: geburtstagsarchiv@example.com' . "\r\n";
$header .= 'Bcc: geburtstagscheck@example.com' . "\r\n";

So you can add addresses by seperating them by ",", you cann add Cc and Bcc and a lot more in the header. Check out the manual!

Note: The difference between Cc and Bcc is that when you are using Cc all addresses will see who you addressed, too, when using Bcc that is a "blind carbon copy" so the addresses can not see who you addressed additionally.

David Stutz
  • 2,578
  • 1
  • 17
  • 25