Jump to content

AddCC behave like AddBCC in phpmailer


fifin04

Recommended Posts

Hi everyone...I just need help to look at my code why the AddCC function in phpmailer behave like AddBCC ..is it something wrong with my code...I got no issues with sending email because it run smoothly and nothing was wrong... only this portion curiousity question why is this AdCC function behave like AddBCC ....suppose to when Im sendign email using AddCC function the recipients should see others email add list in CC..but what happen now its empty...I mean it's not reveal the others email .. but the email was sent to everyone...eg:-

 

 

the current  situation happen when sendign using AddCC

 

from = blala@c.com

name = admin

to = recipientemail@z.com

cc = "blank here"!!! but the email was sending to everyone but not reveal here

 

suppose to like this

 

from = blala@c.com

name = admin

to = recipientemail@z.com

cc = othersemail1@blabla.com,othersemail1@blabla.com,othersemail1@blabla.com,

othersemail1@blabla.com,

 

So below are my code


include_once('class.phpmailer.php');
include_once("class.smtp.php"); 

$typeemail = $_POST['typeemail'];
$subject = $_POST['subject'];
$msg = $_POST['msg'];
$cat = $_POST['cat'];
$attachment = $_POST['attachstuff'];

$mail = new phpmailer();

$mail->IsSMTP();
$mail->SMTPAuth   = true;   
$mail->Host     = "some host";  
$mail->Mailer   = "smtp";  
$mail->Username   = "some username";  
$mail->Password = "somepassword";

$mail->FromName = "Admin";
$mail->From = "admin@blablabla.com";
$mail->Subject = $subject;
$mail->Body = $msg;
$mail->WordWrap = 65;

$host		= "localhost";
$dbuser		= "someusername";	
$dbpass		= "somepass";
$dbname		= "somedb";				

$conn = mysql_connect($host,$dbuser,$dbpass);
if (!$conn){
  die('Could not connect: ' . mysql_error());
}
mysql_select_db($dbname, $conn);	

$sql="SELECT * FROM user WHERE category = '$cat'";

$result = mysql_query($sql)or die(mysql_error()); 	

function fetch_all_array($query_string){
    $out = array();
    while ($row = mysql_fetch_array($query_string)){
	$out[] = $row;
}

   return $out;
}

$all_rows = fetch_all_array($result);

$mail->AddAttachment("attachmentfile/".$attachment);  

foreach($all_rows as $key => $value){
  //the format is correct the email was sendign to everyone but why it keep still un reveal the address huhuhu
    $mail->AddCC($value['email'],$value['name']);
}

if(!$mail->Send()) {
    echo "Mailer Error: " . $mail->ErrorInfo;
 $answer = "0";
      echo "answer=".$answer;
} else {
  	$mail->ClearAddresses();
$mail->ClearAttachments();
   $answer = "1";
    echo "answer=".$answer;
unlink("attachmentfile/".$attachment);
}

mysql_close($conn);


?>

 

Im  end of my wit here...hope someone can give em some shed of light or at least point me ...

 

Tq

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.