Jump to content

BCC not sending to Gmail


Recommended Posts

please i have been working on a code that will help me send bulk mail to me subscribers, i tried to use BCC but i notice that it works for yahoomail, but does not work for gmail, it sends only to yahoomails in the list and will not send to gmail, please these are my codes i need help

<?phperror_reporting(0);  if (isset($_POST['formType'])) {    if ($_POST['formType'] === "join_us") {// read the list of emails from the file.$email_list = file("elist.txt");// count how many emails there are.$total_emails = count($email_list);// go through the list and trim off the newline character.for ($counter=0; $counter<$total_emails; $counter++) {   $email_list[$counter] = trim($email_list[$counter]);   }// implode the list into a single variable, put commas in, apply as $to value.$to = "";// how to send an email with BCC$headers  = 'MIME-Version: 1.0' . "r";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "r";// this email may not exist$headers .= 'To: Website <noreply@website.com>' . "r";// this is a good email, that must exist (some user may send a reply)$headers .= 'From: Website <goodExistingEmail@website.com>' . "r";// mails to be delivered to$headers .= 'BCC: ' . implode(', ',$email_list) . "rn";$subject = "My email test.";$message = "Hello morrissing, how are you today bro?";if ( mail($to,$subject,$message, $headers) ) {   echo "The email has been sent!";   } else {   echo "The email has failed!";   }} } ?>
Edited by Panta
Link to comment
Share on other sites

This topic is now closed to further replies.

  • Create New...