Jump to content

sending a copy of mail to sender


mathan5481

Recommended Posts

i need to send a copy of the form to the sender as well as to myself..i can receive email to my own email but not a copy to the sender... how do i go about it?

plz help

 

 

this is the code

 

<?php
$subject = 'Order Form'; 
$msg = "<html><body>
 
<b>Name : " . strip_tags($_POST['name']) . " </b><br><br>
<b>Tel No. : " . strip_tags($_POST['phone']) . " </b><br><br>
<b>E-Mail  : " . strip_tags($_POST['email']) . " </b><br><br>
<b>Address : " . strip_tags($_POST['add']) . " </b><br><br>
<b>Messages : " . strip_tags($_POST['messages']) . " </b><br><br>
 
</body>
</html>";
 
// Make sure to escape quotes
 
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From  <[email protected]>' . "\r\n";
 
 
 
mail($to, $subject, $msg, $headers);
 
 
 
?>
 

 

Link to comment
https://forums.phpfreaks.com/topic/287556-sending-a-copy-of-mail-to-sender/
Share on other sites

i checked in few sites and added few lines, but it dont seems to work..

 

 

<?php


$Cc = '($_POST['email']) ';

$subject = 'Order Form'; 

$msg = "<html><body>

 


<b>Name : " . strip_tags($_POST['name']) . " </b><br><br>

<b>Tel No. : " . strip_tags($_POST['phone']) . " </b><br><br>

<b>E-Mail  : " . strip_tags($_POST['email']) . " </b><br><br>

<b>Address : " . strip_tags($_POST['add']) . " </b><br><br>

<b>Messages : " . strip_tags($_POST['messages']) . " </b><br><br>

 


</body>

</html>";

 


// Make sure to escape quotes

 

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers .= 'From  <[email protected]>' . "\r\n";

 

 

 

mail($to, $Cc, $subject, $msg, $headers);

 

 

 

?>


 


 

mail($to, $Cc, $subject, $msg, $headers);

 

You can't just add parameters to a function call.

 

You need to put the CC as a header:

 

$headers .= "Cc: <[email protected]>\r\n";
Keep in mind. When you do that, whoever you are sending the CC to will see YOUR email address as well.

 

If you want to prevent that, send it TO: the user and BCC: to your email.

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.