Jump to content

Checkbox To Attach Cc To Sender


Joycie

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/272109-checkbox-to-attach-cc-to-sender/
Share on other sites

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  = '[email protected]' . ', '; // 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.