Jump to content

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
$to = 'mathan5481@hotmail.com'; 
$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  <me@mysite.com>' . "\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

$to = 'mathan5481@hotmail.com'; 

$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  <me@mysite.com>' . "\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: <me@home.tld>\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.

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.