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
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  = '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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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