Jump to content

php mail Bcc not working


conan318

Recommended Posts

email not working at all

 

<?php
$e=$_POST['email'];
$e1=$_POST['email1'];
$e2=$_POST['email2'];
$e3=$_POST['email3'];
$e4=$_POST['email4'];
$e5=$_POST['email5'];
$e6=$_POST['email6'];
$e7=$_POST['email7'];
$e8=$_POST['email8'];
$e9=$_POST['email9'];

$cc=$e1.",".$e2.",".$e3.",".$e4.",".$e5.",".$e6.",".$e7.",".$e28.",".$e39.",";
$to      = $e;  
$subject = 'You have Been Invited ';  
$message = ' 

test message
--------------------------------------------------------------------------------------

';
$headers = 'From:'.$email . "\r\n"; 
$headers .= 'Bcc:'. $cc . "\r\n";
  
mail($to, $subject, $message, $headers);
?>

Link to comment
Share on other sites

are you sure that all of those email forms were filled out? You don't check if all of them are sent, and if some aren't, that will result in a BCC string like

my@email.com,other@email.com,,,ISkippedLines@email.com....

 

which would result in a malformed header and may cause your email to fail

Link to comment
Share on other sites

mail() does not care if the email address doesnt actually exist, as long as it is valid (by valid i mean correctly formed).

As long as an email address is accepted for delivery it shouldnt cause an issue.

To ensure your script has the best chance of success, you will need to remove all empty elements as mikesta707 said and test the emails to the best of your ability for validity.

Link to comment
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.