oavs Posted January 27, 2008 Share Posted January 27, 2008 Hi I want without modifying too much send (Bcc and/or Cc) a copy of the email to the sender. Here is my existing code which works but can't figure out the the copy to Bcc/Cc to the sender. Can anyone please help. <? $to = "[email protected]"; //$to.= ",".$Email; $Cc = $Email; $from_header = "Hello $Name,\n\n Please use following login details to see your artwork.\n URL: http://www.oavs.com.au\n Username: admin\n Password: enter \n\n\n You have entered following details.\n\nName: $Name $Surname,\n Company: $Company\n Phone: $Phone \n Email: $Email \n\n\n Accepts Terms and Conditions of viewing their logo commissioned to OAVS - Visual Concepts"; if($Name != "") if($Surname != "") if($Company != "") if($Phone != "") if($Email != "") { //send mail - $subject & $contents come from surfer input mail($to, $Company, $from_header, $Phone, $Email); // redirect back to url visitor came from //header("Location: $HTTP_REFERER"); header("Location: select.php"); } else { print("<HTML><BODY>Error, no comments were submitted!"); print("</BODY></HTML>"); } ?> Link to comment https://forums.phpfreaks.com/topic/88008-please-help-how-to-send-bcc-or-cc-email-in-my-existing-form/ Share on other sites More sharing options...
Northern Flame Posted January 27, 2008 Share Posted January 27, 2008 make your $Email variable like this: $Email = "[email protected]\r\n"; $Email .= "cc: [email protected]\r\n"; $Email .= "Bcc: [email protected]"; Link to comment https://forums.phpfreaks.com/topic/88008-please-help-how-to-send-bcc-or-cc-email-in-my-existing-form/#findComment-450337 Share on other sites More sharing options...
oavs Posted January 27, 2008 Author Share Posted January 27, 2008 Thanks for your reply I did it slightly differently and now is working but I can not get the subject field now. What I want is to send the recipient different Subject then one I am getting. How would you do that? Appreciate your help heaps. <? $to = "[email protected]"; //$to.= ",".$Email; $headers = "From: [email protected]" . "\r\n" . "Subject: Your Login Details for your Art Work" . "\r\n" . "Reply-To: [email protected]" . "\r\n" . "bcc:$Email" . "\n" . "X-Mailer: PHP/" . phpversion(); $from_header = "Hello $Name,\n\n Please use following login details to see your artwork.\n URL: http://www.abc.com.au\n Username: admin\n Password: enter \n\n\n You have entered following details.\n\nName: $Name $Surname,\n Company: $Company\n Phone: $Phone \n Email: $Email \n\n\n Accepts Terms and Conditions of viewing their logo commissioned to OAVS - Visual Concepts"; if($Name != "") if($Surname != "") if($Company != "") if($Phone != "") if($Email != "") { //send mail - $subject & $contents come from surfer input // mail($to, $Company, $from_header, "Bcc: $Email" . $headers); mail($to, $Company, $from_header, $headers); // redirect back to url visitor came from //header("Location: $HTTP_REFERER"); header("Location: select.php"); } else { print("<HTML><BODY>Error, no comments were submitted!"); print("</BODY></HTML>"); } ?> Link to comment https://forums.phpfreaks.com/topic/88008-please-help-how-to-send-bcc-or-cc-email-in-my-existing-form/#findComment-450339 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.