Search code examples
phpemaillistsmtpmailing

Best way to send mass email to my subscribers ( BCC or PEAR mail queue ? )


I need to send email to my 5000 subscribers. What is the best way to do this ?

1) By using BCC ?:

  $from_addr = 'myemail@example.com';
  $mailing_list = 'sub1@example.com', 'sub2@example.com', 'sub3@example.com0;
  $message_subject = 'this is a test';

 `$headers = array ("From" => $from_addr,
                    "Bcc" => $mailing_list,
                    "Subject" => $message_subject);

  $smtp = Mail::factory("smtp", array ('host' => "smtp.example.com",
                                       'auth' => true,
                                       'username' => "xxx",
                                       'password' => "xxx"));

  $mail = $smtp->send($email, $headers, $message_body);`

.

2) by using PEAR mail queue ?


Solution

  • I haven't used PEAR mail_queue yet, but using a queue is definitively the way to go! BCC shouldn't be used because your mails would easily get flagged as Spam by big email providers like gmail/hotmail. Also having thousands of addresses in an email header seems to be crazy. There may even be a limit. Also some mail servers could refuse your mail because of the over-sized header. On top of that the mail server that is supposed to send your email wouldn't be to happy about it.