fifin04 Posted March 30, 2009 Share Posted March 30, 2009 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 = [email protected] name = admin to = [email protected] cc = "blank here"!!! but the email was sending to everyone but not reveal here suppose to like this from = [email protected] name = admin to = [email protected] cc = [email protected],[email protected],[email protected], [email protected], 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 = "[email protected]"; $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 https://forums.phpfreaks.com/topic/151706-addcc-behave-like-addbcc-in-phpmailer/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.