Jump to content

Please help how to send Bcc or Cc email in my existing form


oavs

Recommended Posts

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>");
}
?>

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>");
}
?>

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.