Jump to content

Sending email with PHP


Adam

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.