Jump to content

Recommended Posts

I've never needed to do this before so I'm having a few problems, but I have a list of email addresses like so.. "email@1, email@2, etc.."

 

They are posted through the form with the name of the field as "sendTo". Fine so far, but I'm trying to send them all in one email rather than looping through them and sending one at a time. I've put the contacts in the Bcc header like so.. (I've removed my validation and what not from this code)..

 

$subject = $_POST['subject'];
$message = $_POST['message'];
$contacts = $_POST['sendTo'];

$headers = 'From: MiniMerc <noreply@minimerc.co.uk>' ."\r\n";
$headers .= 'Bcc: ' .$contacts. "\r\n";

$sendMail = mail('noreply@minimerc.co.uk', $subject, $message, $headers);

 

I've been then running a conditional on the $sendMail var to find out if its been sent, and it keeps saying it has, but no email, not even spam in the spam..

 

Can anybody see something I've done wrong or.. provide any help?

 

Cheers!

Link to comment
https://forums.phpfreaks.com/topic/108849-sending-email-with-php/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.