Joycie Posted December 17, 2012 Share Posted December 17, 2012 Hi! Any suggestions of how to set the // Set email variables & // simple email content for a checkbox to attach a copy of the message to the actual sender? In which case, I obviously do not know in advance to which email address this Cc attachment should be send... Anyone who can help me further? Thx Quote Link to comment https://forums.phpfreaks.com/topic/272109-checkbox-to-attach-cc-to-sender/ Share on other sites More sharing options...
Drongo_III Posted December 17, 2012 Share Posted December 17, 2012 Hi Is there supposed to be an attachment? You seem to be referring to something... Anyway you could probably achieve this by simply setting the checkbox and then in your php code do a check for it, e.g. $to = 'aidan@example.com' . ', '; // note the comma if(isset($_POST['ccEmail'])){ $to .= $_POST['userEmail']; Obviously you wouldn't directly use post variables in your code without validating and sanitising them but you get the idea. At least I think this is what you're after. Alternatively you could substitute the $to for a Bcc with an extra header: $headers .= 'Bcc: $_POST['userEMAIL'] . "\r\n"; All mail functions are explained here: http://php.net/manual/en/function.mail.php Quote Link to comment https://forums.phpfreaks.com/topic/272109-checkbox-to-attach-cc-to-sender/#findComment-1399955 Share on other sites More sharing options...
Joycie Posted December 18, 2012 Author Share Posted December 18, 2012 Thanks Drongo_III, Got it sorted now Quote Link to comment https://forums.phpfreaks.com/topic/272109-checkbox-to-attach-cc-to-sender/#findComment-1400106 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.