RON_ron Posted October 12, 2009 Share Posted October 12, 2009 How to code to receive a mail Cc? $headers Link to comment https://forums.phpfreaks.com/topic/177406-solved-code-help/ Share on other sites More sharing options...
cags Posted October 12, 2009 Share Posted October 12, 2009 Yes, using $headers. $headers = "CC: [email protected], [email protected]\r\n"; http://www.htmlite.com/php029.php Link to comment https://forums.phpfreaks.com/topic/177406-solved-code-help/#findComment-935391 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; Link to comment https://forums.phpfreaks.com/topic/177406-solved-code-help/#findComment-935399 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? Link to comment https://forums.phpfreaks.com/topic/177406-solved-code-help/#findComment-935400 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; ?> Link to comment https://forums.phpfreaks.com/topic/177406-solved-code-help/#findComment-935402 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? Link to comment https://forums.phpfreaks.com/topic/177406-solved-code-help/#findComment-935411 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. Link to comment https://forums.phpfreaks.com/topic/177406-solved-code-help/#findComment-935446 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. Link to comment https://forums.phpfreaks.com/topic/177406-solved-code-help/#findComment-935448 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! Link to comment https://forums.phpfreaks.com/topic/177406-solved-code-help/#findComment-935451 Share on other sites More sharing options...
RON_ron Posted October 12, 2009 Author Share Posted October 12, 2009 THANKS GUYS!!!!!!! Link to comment https://forums.phpfreaks.com/topic/177406-solved-code-help/#findComment-935510 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.