RON_ron Posted October 12, 2009 Share Posted October 12, 2009 How to code to receive a mail Cc? $headers Quote Link to comment Share on other sites More sharing options...
cags Posted October 12, 2009 Share Posted October 12, 2009 Yes, using $headers. $headers = "CC: name1@domain1.com, name2@domain1.com\r\n"; http://www.htmlite.com/php029.php Quote Link to comment Share on other sites More sharing options...
RON_ron Posted October 12, 2009 Author Share Posted October 12, 2009 I'm not getting the Cc. here's the code. $to = "$email"; $subject = "heading!"; $headers = "From:" .$email."\r\n"; $headers = "CC: $tf\r\n"; $message = "thank you!"; $message = "Name: " . $thename; Quote Link to comment Share on other sites More sharing options...
cags Posted October 12, 2009 Share Posted October 12, 2009 a.) is $tf a valid e-mail address, b.) what does your call to mail() look like? Quote Link to comment Share on other sites More sharing options...
RON_ron Posted October 12, 2009 Author Share Posted October 12, 2009 yes 4tf is a valid mail address. $sentOk = mail("$email",$subject,$message,$headers); echo "sentOk=" . $sentOk; ?> Quote Link to comment Share on other sites More sharing options...
cags Posted October 12, 2009 Share Posted October 12, 2009 Are you sure? The code you are using works fine. Did you check your junk mail forlder? Quote Link to comment Share on other sites More sharing options...
Adam Posted October 12, 2009 Share Posted October 12, 2009 Should be: $headers = "From:" .$email."\r\n"; $headers .= "CC: $tf\r\n"; $message = "thank you!"; $message .= "Name: " . $thename; Notice ".=" instead of just "=", this basically means to append to the end of the string rather than over write. Quote Link to comment Share on other sites More sharing options...
cags Posted October 12, 2009 Share Posted October 12, 2009 Can't believe I didn't see that, D'oh! Either way, as CC was the second value set it should have worked, unless the mail wasn't being sent because there was no FROM header. Quote Link to comment Share on other sites More sharing options...
Adam Posted October 12, 2009 Share Posted October 12, 2009 It's possible not including the 'from' header made it look suspicious, and so was filtered out before it even reached his inbox. Can't say for sure of course, have to see what happens now! Quote Link to comment Share on other sites More sharing options...
RON_ron Posted October 12, 2009 Author Share Posted October 12, 2009 THANKS GUYS!!!!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.